/* Casca de autenticação — mesmo padrão visual do appVistoria (Vist.OS).
 *
 * Os tokens abaixo são os mesmos do `tailwind.config` daquele projeto:
 * paleta `brand` ancorada em #0F172A (slate-900) e `accent` em sky.
 * Aqui eles viram CSS puro porque a CSP do PruCord é `script-src 'self'`
 * e o Tailwind por CDN injeta <style> em runtime — seria bloqueado.
 *
 * Equivalências, para quem for portar telas entre os dois projetos:
 *   bg-gradient-to-br from-brand-800 to-brand-900 -> .auth-bg
 *   bg-white rounded-2xl shadow-2xl p-8 max-w-md  -> .auth-card
 *   text-2xl font-extrabold text-brand-800        -> .auth-brand
 *   block text-sm font-medium mb-1 text-slate-700 -> .auth-label
 *   w-full px-3 py-2 rounded-lg border ...        -> .auth-input
 *   w-full py-2.5 bg-accent-500 hover:accent-600  -> .auth-btn
 *   border border-brand-700 text-brand-700        -> .auth-btn-outline
 *   text-sm text-accent-600 hover:underline       -> .auth-link
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/vendor/fonts/inter-latin-variable.woff2') format('woff2-variations');
}

:root {
  --brand-50: #f8fafc;
  --brand-100: #f1f5f9;
  --brand-500: #64748b;
  --brand-600: #475569;
  --brand-700: #1e293b;
  --brand-800: #0f172a;
  --brand-900: #020617;

  --accent-400: #38bdf8;
  --accent-500: #0ea5e9;
  --accent-600: #0284c7;

  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-800: #1e293b;
}

html.auth, body.auth {
  height: 100%;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--slate-800);
  color-scheme: light;
}

.auth-bg {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom right, var(--brand-800), var(--brand-900));
}

.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }

.auth-card {
  width: 100%;
  /* Mais estreito que o `max-w-md` do appVistoria: a tela de login do PruCord
     tem menos campo, e com 28rem o cartão ficava largo demais para o conteúdo.
     Os modais continuam em 28rem, onde há formulário maior. */
  max-width: 23rem;
  background: #fff;
  border-radius: 1rem;              /* rounded-2xl */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);   /* shadow-2xl */
  padding: 2rem;                    /* p-8 */
}

.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-brand {
  margin: 0;
  font-size: 1.5rem;                /* text-2xl */
  font-weight: 800;                 /* font-extrabold */
  letter-spacing: .025em;           /* tracking-wide */
  color: var(--brand-800);
}
.auth-sub { margin: .5rem 0 0; font-size: .875rem; color: var(--slate-500); }

/* --- formulário -------------------------------------------------------- */
.auth-field { display: block; margin-bottom: 1rem; }
.auth-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .25rem; color: var(--slate-700); }

.auth-input {
  width: 100%;
  padding: .5rem .75rem;            /* px-3 py-2 */
  font: inherit;
  color: var(--slate-800);
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: .5rem;             /* rounded-lg */
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.auth-input:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, .45);   /* focus:ring-2 ring-accent-500 */
}
.auth-input::placeholder { color: var(--slate-400); }

.auth-btn {
  width: 100%;
  padding: .625rem 1rem;            /* py-2.5 */
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--accent-500);
  border: 1px solid var(--accent-500);
  border-radius: .5rem;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.auth-btn:hover:not(:disabled) { background: var(--accent-600); border-color: var(--accent-600); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }

.auth-btn-outline {
  width: 100%;
  padding: .625rem 1rem;
  font: inherit;
  font-weight: 500;
  color: var(--brand-700);
  background: transparent;
  border: 1px solid var(--brand-700);
  border-radius: .5rem;
  cursor: pointer;
  transition: background .12s;
}
.auth-btn-outline:hover:not(:disabled) { background: var(--brand-50); }

.auth-link {
  font-size: .875rem;
  color: var(--accent-600);         /* link em texto é accent-600, não brand */
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.auth-link:hover { text-decoration: underline; }

/* --- abas -------------------------------------------------------------- */
.auth-tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--slate-200); }
.auth-tab {
  flex: 1;
  padding: .5rem .25rem .625rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: var(--slate-500);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.auth-tab:hover { color: var(--slate-700); }
.auth-tab.is-active { color: var(--accent-600); border-bottom-color: var(--accent-500); }

/* --- avisos ------------------------------------------------------------ */
.auth-msg { margin-top: 1rem; padding: .75rem; border-radius: .5rem; font-size: .875rem; }
.auth-msg.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.auth-msg.info  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.auth-msg.ok    { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }

/* --- separador "ou" ---------------------------------------------------- */
.auth-or { display: flex; align-items: center; gap: .5rem; margin: .75rem 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--slate-200); }
.auth-or span { font-size: .75rem; color: var(--slate-400); text-transform: uppercase; }

.auth-foot { padding: 0 1rem 1.5rem; text-align: center; }
.auth-foot p { margin: 0; font-size: .75rem; color: rgba(148, 163, 184, .6); }

.auth-hint { display: block; font-size: .75rem; color: var(--slate-500); margin-top: .375rem; }

/* Linha de texto com o link que abre um modal ("Não tem conta? Crie a sua"). */
.auth-switch { margin: 1rem 0 0; text-align: center; font-size: .875rem; color: var(--slate-500); }
.auth-switch .auth-link { margin-left: .25rem; font-weight: 500; }

/* Texto de abertura de cada etapa dos modais. */
.auth-intro { margin: 0 0 1.25rem; font-size: .875rem; color: var(--slate-500); }

/* Páginas de texto corrido (privacidade): mesmo cartão, mais largo, porque
   parágrafo em coluna de formulário fica ilegível. */
.auth-card-larga { max-width: 46rem; }
.auth-h2 {
  margin: 1.5rem 0 .5rem;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--slate-800);
}
.auth-lista { margin: 0 0 1.25rem; padding-left: 1.25rem; font-size: .875rem; color: var(--slate-500); }
.auth-lista li { margin-bottom: .375rem; }
.auth-aviso {
  padding: .625rem .75rem;
  border-radius: .5rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.auth-ok-inline {
  padding: .625rem .75rem;
  border-radius: .5rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

/* Dois botões lado a lado (Voltar | Confirmar). */
.auth-row { display: flex; gap: .75rem; }
.auth-row > * { flex: 1; margin: 0; }

.auth-btn-ghost {
  padding: .625rem 1rem;
  font: inherit;
  font-weight: 500;
  color: var(--slate-700);
  background: var(--slate-200);
  border: 1px solid var(--slate-200);
  border-radius: .5rem;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.auth-btn-ghost:hover { background: var(--slate-300); border-color: var(--slate-300); }

/* Campo de código: dígitos grandes e espaçados, como no appVistoria. */
.auth-code {
  text-align: center;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 1.125rem;
  letter-spacing: .35em;
  text-indent: .35em;   /* compensa o espaçamento sobrando à direita */
}
.auth-input-lido { background: var(--brand-100); color: var(--slate-500); border-color: var(--slate-200); }

/* --- modais ------------------------------------------------------------ */
/* Fundo escuro com desfoque — o `backdrop-filter` é o "blur" do appVistoria
   (lá vem de `bg-black/60 backdrop-blur-sm`). */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  animation: modal-entra .14s ease-out;
}
@keyframes modal-entra { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 28rem;
  margin: auto;
  background: #fff;
  border-radius: .75rem;             /* rounded-xl */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);
  text-align: left;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-200);
}
.modal-title { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--slate-800); }
.modal-close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 .25rem;
  color: var(--slate-400);
  background: none;
  border: 0;
  cursor: pointer;
}
.modal-close:hover { color: var(--slate-700); }

.modal-body { padding: 1rem 1.25rem 1.25rem; }

/* Com modal aberto o fundo não rola junto. */
body.sem-rolagem { overflow: hidden; }

/* Etapa de sucesso, no fim da recuperação. */
.auth-sucesso { text-align: center; padding: .5rem 0; }
.auth-sucesso-titulo { margin: 0 0 .5rem; font-size: 1.125rem; font-weight: 600; color: var(--slate-800); }

/* Linha de texto com o link que troca de tela ("Não tem conta? Crie a sua"). */
.auth-switch { margin: 1rem 0 0; text-align: center; font-size: .875rem; color: var(--slate-500); }
.auth-switch .auth-link { margin-left: .25rem; font-weight: 500; }

/* Texto de abertura das telas de recuperação. */
.auth-intro { margin: 0 0 1.25rem; font-size: .875rem; color: var(--slate-500); }

.hidden { display: none !important; }

/* O helper showMsg() do api.js é compartilhado com as telas escuras e emite
   `.msg.<tipo>`; aqui ele ganha a roupa clara do padrão de auth. */
.msg { margin-top: 1rem; padding: .75rem; border-radius: .5rem; font-size: .875rem; }
.msg.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.msg.info  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.msg.ok    { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.auth-center-row { margin-top: 1rem; text-align: center; }
.auth-spacer { margin-top: 1rem; }
