/* =====================================================================
   Redesign: painéis flutuantes, violeta da marca e cantos generosos.

   Carrega DEPOIS do app.css e só sobrescreve: apagar este arquivo (e o
   <link> do app.html) devolve o visual anterior. As cores vêm dos tokens do
   base.css, então o tema claro acompanha sem regra própria.
   ===================================================================== */
/* Fontes variáveis hospedadas aqui mesmo (o CSP só aceita font-src 'self').
   Subconjunto latino: cobre o português inteiro. Ambas sob licença OFL. */
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url('/fonts/figtree-latin-wght.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin-wght.woff2') format('woff2');
}

:root {
  --fonte: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fonte-titulo: 'Bricolage Grotesque', 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --linha-suave: rgba(255, 255, 255, .06);
  --coral: #ff6b57;
  --coral-txt: #ff8c7b;
  --coral-fundo: rgba(255, 107, 87, .16);
  --violeta-txt: #b9a8ff;
  --violeta-fundo: rgba(123, 92, 245, .16);
  --verde-fundo: rgba(61, 220, 151, .12);
  --ilha: 28px;
}
:root[data-theme="light"] {
  --linha-suave: rgba(0, 0, 0, .07);
  --coral-txt: #c2412f;
  --violeta-txt: #5b3fd6;
  --violeta-fundo: rgba(123, 92, 245, .13);
}

body { font-family: var(--fonte); }
.app h1, .app h2, .app h3, .modal h2 { font-family: var(--fonte-titulo); letter-spacing: -.01em; }

/* ------------------------- botões e campos --------------------------- */
.btn { border-radius: 14px; }
.btn.sm { border-radius: 11px; }
.btn.primary { background: var(--brand); }
.btn.primary:hover { background: var(--brand-h); filter: none; }
.modal { border-radius: 26px; padding: 28px; }
.modal h2 { font-size: 21px; }
.icon-btn { border-radius: 12px; }

/* --------------------- painéis flutuantes (desktop) ------------------ */
@media (min-width: 801px) {
  .app {
    padding: 12px; gap: 12px;
    grid-template-columns: 72px 272px minmax(0, 1fr) 256px;
  }
  .app.hide-members { grid-template-columns: 72px 272px minmax(0, 1fr); }
  .rail, .side, .main, .members {
    background: var(--bg-1); border-radius: var(--ilha); overflow: hidden; min-height: 0;
  }
}
/* O overflow: hidden acima serve aos cantos arredondados, mas esta coluna é uma
   lista longa: sem isto a rolagem do mouse não chegava aos últimos membros. */
@media (min-width: 801px) {
  .members { overflow-x: hidden; overflow-y: auto; }
}
@media (min-width: 801px) and (max-width: 1080px) {
  .app { grid-template-columns: 72px 248px minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .rail, .side, .main { background: var(--bg-1); }
}

/* ------------------------------- rail -------------------------------- */
.rail { padding: 14px 0; gap: 10px; }
.rail .server.logo {
  width: 48px; height: 48px; border-radius: 16px; background: var(--bg-2);
}
.rail .server.logo img { width: 38px; height: 38px; filter: none; }
.rail .divider { width: 28px; height: 1px; background: var(--linha-suave); border-radius: 0; margin: 4px 0; }
.rail .icon-btn {
  width: 48px; height: 48px; border-radius: 16px; background: transparent; color: var(--txt-dim);
}
.rail .icon-btn:hover { background: var(--bg-2); color: var(--txt); border-radius: 16px; }
.rail .friend-launch, .rail .instalar-rail { color: var(--green); }
.rail .friend-launch:hover, .rail .instalar-rail:hover { background: var(--verde-fundo); color: var(--green); }
.rail .icon-btn svg { width: 22px; height: 22px; }

/* ------------------------------ canais ------------------------------- */
.side-head { height: 64px; padding: 0 20px; border-bottom: 0; box-shadow: none; }
.chan-list { padding: 4px 12px 12px; }
.group {
  padding: 18px 10px 6px; font-size: 11.5px; letter-spacing: .08em; color: var(--txt-mute);
}
.chan {
  min-height: 38px; padding: 0 12px; border-radius: 12px; gap: 10px;
  font-size: 14.5px; font-weight: 500;
}
.chan:hover { background: var(--bg-2); }
.chan.on { background: var(--violeta-fundo); color: var(--txt); font-weight: 600; }
.chan.on svg { color: var(--violeta-txt); }
.chan.live { background: var(--verde-fundo); font-weight: 600; }
.chan .count { font-weight: 600; }
.chan.on::before { background: var(--violeta-txt); }
.selo { background: var(--brand); }
.selo-mencao { background: var(--coral); color: #1a0b08; }

.voice-members { padding: 2px 0 6px 26px; gap: 2px; }
.vm { padding: 4px 8px; border-radius: 10px; }
.vm .av { width: 24px; height: 24px; }
.vm.speaking .av { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--green); }

.voice-panel {
  margin: 0 12px 10px; padding: 12px; border: 0; border-radius: 20px; background: var(--bg-2);
}
.voice-signal { border-radius: 10px; }
.voice-actions { gap: 8px; }
.voice-action { height: 38px; border-radius: 12px; background: var(--bg-3); }
.voice-action:hover { background: var(--bg-hover); }
.voice-action.active { background: var(--brand); color: #fff; }
.voice-action.leave { background: var(--coral-fundo); color: var(--coral-txt); }
.voice-action.leave:hover { background: var(--coral); color: #1a0b08; filter: none; }

.me-bar { margin: 0 12px 12px; padding: 10px 12px; border-radius: 20px; background: var(--bg-2); }
.me-bar .av { width: 36px; height: 36px; }
.me-bar .icon-btn { width: 32px; height: 32px; border-radius: 10px; }

/* ------------------------------ principal ---------------------------- */
.main-head {
  height: 68px; padding: 0 24px; gap: 8px;
  border-bottom: 1px solid var(--linha-suave); box-shadow: none;
}
.main-head .title { font-family: var(--fonte-titulo); font-size: 20px; font-weight: 700; gap: 10px; }
.main-head .title svg { width: 20px; height: 20px; color: var(--violeta-txt); }
.main-head .icon-btn { width: 40px; height: 40px; border-radius: 14px; background: var(--bg-2); }
.main-head .icon-btn:hover { background: var(--bg-3); }
.pill { background: var(--bg-2); padding: 6px 12px; font-weight: 600; }
.painel-fixadas { top: 76px; right: 20px; border-radius: 22px; border-color: var(--linha-suave); }

/* ------------------------------- chat -------------------------------- */
.msgs { padding: 14px 18px; }
.msg { gap: 12px; padding: 4px 10px; border-radius: 14px; margin-top: 10px; }
.msg .av { width: 38px; height: 38px; font-size: 14px; }
.msg .hora-flutuante { width: 38px; }
.msg .who { font-size: 14px; font-weight: 700; }
.msg .who time { font-size: 11px; margin-left: 8px; }
.msg .txt { font-size: 14px; line-height: 1.45; }
.msg .txt img.chat-img { border-radius: 18px; max-width: min(380px, 100%); }
.msg .txt audio.chat-audio { border-radius: 14px; }
.msg.sys .txt { font-style: normal; }
.typing { padding: 0 28px; font-size: 12px; height: 22px; }
.msg-acoes { border-radius: 14px; }
.reacao { border-radius: 14px; background: var(--bg-2); }
.reacao.minha { background: var(--violeta-fundo); border-color: transparent; color: var(--violeta-txt); }

.attach-preview { margin: 0 24px 8px; border-radius: 16px; background: var(--bg-2); }
.barra-gravando { margin: 0 24px 8px; border-radius: 16px; background: var(--bg-2); }
.barra-resposta { margin-left: 24px; margin-right: 24px; border-radius: 16px 16px 0 0; }

.composer {
  margin: 6px 24px 22px; padding: 8px 10px; gap: 4px; align-items: center;
  border-radius: 22px; background: var(--bg-2); border: 1px solid transparent;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.composer:focus-within { border-color: rgba(123, 92, 245, .55); box-shadow: 0 0 0 3px rgba(123, 92, 245, .16); }
.composer .icon-btn { margin: 0; width: 40px; height: 40px; border-radius: 14px; }
.composer textarea {
  background: transparent; border: 0; border-radius: 0; padding: 11px 8px; font-size: 14px;
}
.composer textarea:focus { border: 0; }

/* ------------------------------ palco -------------------------------- */
.grid { padding: 20px; gap: 12px; }
.tile {
  border-radius: 26px; background: var(--bg-2); border-width: 3px;
}
.tile video { border-radius: 24px; }
.tile .label {
  left: 12px; bottom: 12px; padding: 5px 12px; border-radius: 14px;
  background: rgba(7, 8, 12, .74); backdrop-filter: blur(6px);
}
.tile .badge { right: 12px; top: 12px; border-radius: 12px; background: rgba(7, 8, 12, .74); }
.tile .tile-actions { right: 12px; bottom: 12px; }
.tile-actions .icon-btn { background: rgba(7, 8, 12, .74); border-radius: 12px; }
.tile-actions .sel-qualidade { background: rgba(7, 8, 12, .74); border-radius: 12px; }

.dock {
  margin: 0 auto 22px; padding: 10px; width: fit-content; max-width: calc(100% - 24px);
  border: 0; border-radius: 30px; background: var(--bg-2); gap: 10px; justify-content: center;
}
.ctl { width: 52px; height: 52px; border-radius: 20px; background: var(--bg-3); }
.ctl:hover { background: var(--bg-hover); }
.ctl svg { width: 22px; height: 22px; }
.ctl.active { background: var(--brand); color: #fff; }
.ctl.wide { width: auto; padding: 0 22px; border-radius: 20px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.ctl.danger { background: var(--coral); color: #1a0b08; }
.ctl.danger:hover { background: var(--coral); filter: brightness(1.08); }
.ctl .lvl { border-radius: 22px; }
.painel-efeitos { border-radius: 22px; border-color: var(--linha-suave); }

/* ------------------------------ membros ------------------------------ */
.members { padding: 22px 14px; }
.members .group { padding: 16px 10px 8px; }
.members .group:first-child { padding-top: 0; }
.member { padding: 6px 10px; gap: 12px; border-radius: 14px; }
.member:hover { background: var(--bg-2); }
.member .av { width: 38px; height: 38px; font-size: 15px; }
.member .av::after { width: 13px; height: 13px; border: 3px solid var(--bg-1); right: -2px; bottom: -2px; }
.member .nm { font-size: 14.5px; font-weight: 600; color: var(--txt); }
.member .activity { font-size: 12.5px; }
.member .tag-mini { border-radius: 6px; padding: 2px 6px; font-weight: 700; letter-spacing: .04em; }
.member-vol { padding-left: 58px; }

/* ------------------------- menus e listas flutuantes ------------------ */
.lista-mencao { border-radius: 18px; }
.ctx, .menu-ctx, [role="menu"] { border-radius: 18px; }

/* ===================================================================== *
 * Entrar: painel de marca ao lado do cartão e cantos mais generosos.
 * Só em .auth-body (entrar.html); o /admin usa .auth na tela de "Área
 * restrita" e não carrega esta folha.
 * ===================================================================== */
.auth-hero { display: none; }
.auth-body .auth { border-radius: 32px; padding: 36px; }
.auth-body .auth h1 { font-family: var(--fonte-titulo); font-size: 30px; font-weight: 700; }
.auth-body .field { border-radius: 16px; }
.auth-body .tabs { border-radius: 18px; }
.auth-body .tabs::before { border-radius: 14px; }
.auth-body .tabs button { border-radius: 14px; }
.auth-body .btn.primary { border-radius: 18px; padding-top: 15px; padding-bottom: 15px; font-size: 16px; }

@media (min-width: 1000px) {
  .auth-body .auth-page {
    display: flex; align-items: center; justify-content: center; gap: 88px; padding: 40px 48px;
  }
  .auth-hero {
    display: flex; flex-direction: column; gap: 22px; max-width: 480px; flex: none;
  }
  .auth-hero img {
    width: 150px; height: 150px; object-fit: contain;
    filter: drop-shadow(0 0 36px rgba(123, 92, 245, .5));
  }
  .auth-hero h2 {
    margin: 0; font-family: var(--fonte-titulo); font-weight: 800;
    font-size: clamp(42px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -.01em;
  }
  .auth-hero p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--txt-dim); }
  .auth-hero .chips { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
  .auth-hero .chips li {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
    border-radius: 19px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06);
    font-size: 14px; font-weight: 600; color: var(--msg-txt);
  }
  .auth-hero .chips svg {
    width: 16px; height: 16px; fill: none; stroke: var(--green); stroke-width: 2.4;
    stroke-linecap: round; stroke-linejoin: round;
  }
}
