/* Telas de entrada (login, sem acesso, erro), comuns a player e manager.
   Tokens iguais aos do preview/, para o login já ter a cara do produto. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --sunken: #f3f1ed;
  --line: #e4e1da;
  --line-2: #cfcbc1;
  --text: #1d1c1a;
  --muted: #6c6862;
  --accent: #0b2e6d;
  --teal: #14b8b4;
  --chip: #0a6f6c;
  --chip-bg: #ddf5f4;
  --warn: #8a5a10;
  --warn-bg: #fbf2e2;
  --no: #b3413c;
  --no-bg: #fbeceb;
  --shadow: 0 1px 2px rgba(29, 28, 26, .04), 0 12px 32px -12px rgba(11, 46, 109, .16);

  /* Botão do Google: cores fixadas pelas diretrizes de marca dele. */
  --gsi-bg: #ffffff;
  --gsi-line: #747775;
  --gsi-text: #1f1f1f;
  --gsi-hover: rgba(31, 31, 31, .06);
}

/* Escuro seguindo o sistema, salvo se o usuário escolheu o claro no player. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181a;
    --surface: #1f2124;
    --sunken: #26282c;
    --line: #34373c;
    --line-2: #474b52;
    --text: #eceae6;
    --muted: #9a958d;
    --accent: #6f9ae0;
    --teal: #55d7d2;
    --chip: #55d7d2;
    --chip-bg: #12312f;
    --warn: #e0b060;
    --warn-bg: #2d2415;
    --no: #e58b86;
    --no-bg: #2f1f1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    --gsi-bg: #131314;
    --gsi-line: #8e918f;
    --gsi-text: #e3e3e3;
    --gsi-hover: rgba(227, 227, 227, .08);
  }
}

:root[data-theme="dark"] {
  --bg: #17181a;
  --surface: #1f2124;
  --sunken: #26282c;
  --line: #34373c;
  --line-2: #474b52;
  --text: #eceae6;
  --muted: #9a958d;
  --accent: #6f9ae0;
  --teal: #55d7d2;
  --chip: #55d7d2;
  --chip-bg: #12312f;
  --warn: #e0b060;
  --warn-bg: #2d2415;
  --no: #e58b86;
  --no-bg: #2f1f1e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  --gsi-bg: #131314;
  --gsi-line: #8e918f;
  --gsi-text: #e3e3e3;
  --gsi-hover: rgba(227, 227, 227, .08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.auth {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code {
  font: 500 .86em ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--sunken);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- estrutura ---------- */

.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
}

/* ---------- painel da marca ---------- */

.auth-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(20, 184, 180, .22) 0%, transparent 55%),
    linear-gradient(160deg, #0d3580 0%, #0b2e6d 45%, #071c45 100%);
}

.auth-brand-in {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(32px, 5vw, 56px);
}

.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-mark { width: 38px; height: 38px; flex: none; }
.auth-wordmark {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-hero { max-width: 30rem; }

.auth-tagline {
  margin: 0 0 16px;
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.auth-pitch {
  margin: 0;
  max-width: 34ch;
  font-size: 16px;
  color: rgba(255, 255, 255, .74);
}

/* A marca em escala grande, vazando pelo canto: dá profundidade sem competir
   com o texto. */
.auth-art {
  position: absolute;
  right: -18%;
  bottom: -20%;
  width: 92%;
  max-width: 720px;
  pointer-events: none;
}
.auth-art path:nth-child(1) { fill: rgba(255, 255, 255, .05); }
.auth-art path:nth-child(2) { fill: rgba(20, 184, 180, .16); }
.auth-art path:nth-child(3) { fill: rgba(85, 215, 210, .20); }

/* ---------- formulário ---------- */

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 24px;
}

.auth-card {
  width: min(100%, 408px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
}

.auth-head { margin-bottom: 26px; }

.auth-head h1 {
  margin: 14px 0 6px;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.auth-head p { margin: 0; color: var(--muted); font-size: 15px; }

.auth-product {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--chip);
  background: var(--chip-bg);
  padding: 4px 10px;
  border-radius: 99px;
}

.auth-text { margin: 0 0 22px; color: var(--text); font-size: 15px; }

.auth-account {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: -8px 0 18px;
  padding: 12px 14px;
  background: var(--sunken);
  border-radius: 10px;
}
.auth-account-label { font-size: 12px; color: var(--muted); }
.auth-account-email { font-weight: 600; word-break: break-all; }

.auth-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}
.auth-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-icon-warn { color: var(--warn); background: var(--warn-bg); }
.auth-icon-bad { color: var(--no); background: var(--no-bg); }

.auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.auth-note svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}
.auth-btn:hover { background: var(--sunken); }

.auth-legal { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- botão do Google ---------- */

.gsi-form { margin: 0; }

.gsi {
  position: relative;
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--gsi-line);
  border-radius: 99px;
  background: var(--gsi-bg);
  color: var(--gsi-text);
  font: 500 15px/1 Roboto, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  transition: box-shadow .15s ease, background-color .15s ease;
}
.gsi:hover {
  background-image: linear-gradient(var(--gsi-hover), var(--gsi-hover));
  box-shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}
.gsi:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gsi:disabled { cursor: progress; }

.gsi-g { width: 20px; height: 20px; flex: none; }

.gsi-wait {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: .7;
  animation: gsi-spin .7s linear infinite;
}
.gsi.is-wait .gsi-g { display: none; }
.gsi.is-wait .gsi-wait { display: block; order: -1; }

@keyframes gsi-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .gsi-wait { animation-duration: 2.4s; }
  .gsi { transition: none; }
}

/* ---------- telas estreitas ---------- */

/* O painel da marca vira uma faixa: no celular a tela é do formulário. */
@media (max-width: 880px) {
  /* minmax(0, …): com 1fr puro a coluna não encolhe abaixo do conteúdo e a
     página ganha rolagem lateral no celular. */
  .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-hero { min-width: 0; }
  .auth-tagline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .auth-brand-in {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .auth-mark { width: 30px; height: 30px; }
  .auth-wordmark { font-size: 15px; }
  .auth-tagline { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, .78); }
  .auth-pitch { display: none; }
  .auth-art { width: 260px; right: -60px; bottom: -120px; }

  .auth-main { justify-content: flex-start; padding: 32px 16px 40px; }
  .auth-card { padding: 28px 22px 22px; border-radius: 16px; }
}

@media (max-width: 420px) {
  .auth-tagline { display: none; }
}
