/* ============================================================
   UrielChat — design system base
   Tema cyber: sfondo deep navy, accento verde acido/ciano.
   Nessuna risorsa esterna.
   ============================================================ */

:root {
  --bg: #050b14;
  --bg-elev: #0a1420;
  --bg-elev2: #0f1c2e;
  --line: #1e3a4f;
  --line-soft: #142a3a;
  --text: #e0f2fe;
  --text-dim: #8fb3c9;
  --text-faint: #5a7d94;
  --accent: #00ff9d;
  --accent-dim: #00c47a;
  --accent-bright: #5fffb8;
  --accent-glow: rgba(0, 255, 157, .25);
  --cyan: #00d4ff;
  --cyan-dim: #009ec2;
  --danger: #ff5a5a;
  --ok: #00ff9d;
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------- bottoni ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-elev2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, background .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { filter: brightness(1.15); }
.btn-primary {
  background: linear-gradient(160deg, var(--accent-bright), var(--accent));
  color: #001a10;
  box-shadow: 0 0 12px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--danger);
}
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--bg-elev2); }

/* ---------- form ---------- */

.field {
  display: block;
  margin: 0 0 14px;
}
.field > span {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
input[type="text"], input[type="url"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 2px var(--accent-glow); }
textarea { resize: none; font-family: var(--mono); font-size: 13px; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}
.toggle-row input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ---------- barre & toast ---------- */

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(16px + var(--sab));
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 60;
  border-radius: 18px 18px 0 0;
}
.sheet button {
  text-align: left;
  padding: 13px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.sheet button:active { background: var(--bg-elev2); }
.sheet button.danger { color: var(--danger); }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--sab));
  transform: translateX(-50%);
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 70;
  max-width: 88vw;
  text-align: center;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  margin-right: 5px;
}
.dot-ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot-warn { background: var(--cyan); }
.dot-off { background: var(--text-faint); }

.mono-small {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}
