/* ==================================================================
   EROTS AI — Sistema de design
   Identidade oficial: cores, tipografia e componentes reutilizáveis.
   ================================================================== */

/* Tipos de letra alojados no próprio servidor (licença OFL, ver fonts/OFL.txt) */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/space-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/space-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  /* Paleta oficial */
  --bg-0: #050817;          /* fundo principal */
  --bg-1: #080B14;          /* fundo secundário */
  --panel: #101624;         /* painéis */
  --deep: #0B1633;          /* azul profundo */
  --electric: #2563EB;      /* azul elétrico */
  --cyan: #00D4FF;          /* azul ciano */
  --cyan-glow: #00F0FF;     /* ciano luminoso */
  --violet: #8B5CF6;        /* violeta */
  --purple: #A855F7;        /* roxo luminoso */
  --magenta: #D946EF;       /* magenta */
  --text: #F1F5F9;          /* texto principal */
  --text-2: #94A3B8;        /* texto secundário */
  --ok: #10B981;            /* online */
  --err: #EF4444;           /* erro */
  --warn: #F59E0B;          /* aviso */

  /* Superfícies */
  --glass: rgba(16, 22, 36, 0.62);
  --glass-strong: rgba(16, 22, 36, 0.86);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.24);

  /* Gradientes */
  --grad-primary: linear-gradient(90deg, #2563EB 0%, #00D4FF 100%);
  --grad-neon: linear-gradient(90deg, #00D4FF 0%, #2563EB 45%, #8B5CF6 75%, #D946EF 100%);
  --grad-violet: linear-gradient(135deg, #8B5CF6 0%, #D946EF 100%);

  /* Tipografia */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-brand: "Space Grotesk", "Inter", system-ui, sans-serif;

  /* Raios e sombras */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;
  --glow-cyan: 0 0 0 1px rgba(0, 212, 255, 0.35), 0 0 22px rgba(0, 212, 255, 0.25);
  --glow-violet: 0 0 0 1px rgba(168, 85, 247, 0.4), 0 0 22px rgba(168, 85, 247, 0.28);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Fundo com profundidade (brilhos azul e violeta) */
.erots-backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1000px 560px at 56% 26%, rgba(37, 99, 235, 0.30), transparent 70%),
    radial-gradient(620px 380px at 56% 30%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(700px 500px at 18% 105%, rgba(139, 92, 246, 0.26), transparent 70%),
    radial-gradient(900px 300px at 60% 108%, rgba(37, 99, 235, 0.22), transparent 70%),
    radial-gradient(600px 420px at 95% 0%, rgba(0, 212, 255, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
}

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo { width: 56px; height: 56px; filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.45)); }
.brand-name { font-family: var(--font-brand); font-weight: 700; font-size: 32px; line-height: 1; letter-spacing: 0.5px; }
.brand-name em, .ai { font-style: normal; color: var(--cyan); }
.brand-sub { font-size: 14px; color: var(--text); opacity: 0.9; margin-top: 4px; }

/* ---------- Painel de vidro ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* ---------- Botões ---------- */
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--text); position: relative;
  transition: background 0.15s, transform 0.15s;
}
.icon-btn:hover { background: rgba(148, 163, 184, 0.12); }
.icon-btn:focus-visible, .nav-item:focus-visible, .btn:focus-visible, .card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }

.btn-primary {
  display: flex; align-items: center; gap: 14px; width: 100%; border: 0; cursor: pointer;
  padding: 13px 18px; border-radius: var(--r-sm); background: var(--grad-primary); color: var(--bg-0);
  font-weight: 600; font-size: 17px; box-shadow: 0 0 24px rgba(0, 212, 255, 0.35);
  transition: filter 0.15s, transform 0.15s;
}
.btn-primary .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

.btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; margin-top: 8px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(148, 163, 184, 0.05);
  color: var(--text); cursor: pointer; text-align: left; text-decoration: none; font-size: 14px;
}
.btn:hover { background: rgba(148, 163, 184, 0.1); }
.btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
.btn.danger:hover { background: rgba(239, 68, 68, 0.12); }

.pill-soon {
  margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: 0.2px; padding: 2px 6px;
  border-radius: var(--r-pill); color: var(--text-2); border: 1px solid var(--line-strong); white-space: nowrap; flex-shrink: 0;
}

/* ---------- Estado ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--text-2); }
.status.online { color: var(--ok); }
.status.online::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status.offline { color: var(--err); }
.status.offline::before { background: var(--err); }

/* ---------- Campo de mensagens (borda neon em gradiente) ---------- */
.composer {
  position: relative; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 10px 10px 18px; border-radius: 28px; background: rgba(8, 11, 20, 0.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.composer::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: var(--grad-neon);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: 0.85;
}
.composer textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent; color: var(--text);
  font-size: 17px; line-height: 1.45; padding: 12px 6px; min-height: 48px; max-height: 180px;
}
.composer textarea::placeholder { color: var(--text-2); }
.composer .icon-btn { width: 46px; height: 46px; color: var(--text-2); }
.composer .icon-btn:hover { color: var(--text); }
.composer .mic { border: 1px solid var(--line-strong); background: rgba(148, 163, 184, 0.06); }
.composer .mic.listening { color: var(--err); border-color: var(--err); box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
.send-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  background: var(--cyan); color: var(--bg-0); display: grid; place-items: center;
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.55); transition: transform 0.15s, filter 0.15s;
}
.send-btn .ico { width: 24px; height: 24px; stroke-width: 2.4; }
.send-btn:hover { filter: brightness(1.1); }
.send-btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.send-btn.stop { background: var(--text); box-shadow: 0 0 14px rgba(241, 245, 249, 0.35); }

/* ---------- Janelas (folhas) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 8, 23, 0.6); backdrop-filter: blur(4px);
}
.overlay.open { display: flex; }
.sheet {
  width: 100%; max-width: 480px; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 255, 0.08);
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 12px 20px; border-bottom: 1px solid var(--line); }
.sheet-head b { flex: 1; font-family: var(--font-brand); font-size: 18px; }
.sheet-head .icon-btn { width: 38px; height: 38px; }
.sheet-body { padding: 16px 20px 20px; overflow-y: auto; }
.sheet-body p { color: var(--text-2); font-size: 14px; line-height: 1.55; margin: 0 0 12px; }

.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.switch-row span { flex: 1; }
.switch-row small { display: block; color: var(--text-2); font-size: 12px; margin-top: 2px; }
.switch { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: rgba(148, 163, 184, 0.3); position: relative; cursor: pointer; transition: background 0.15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch:checked { background: var(--electric); }
.switch:checked::after { transform: translateX(18px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
