/* =====================================================================
   css/login.css — tela de entrada (login.html)
   =====================================================================
   Desenho: Figma "Campos Solo — Login" (desktop claro, desktop escuro e
   celular). Substitui o css/style.css antigo, que só o login usava.

   Carregado DEPOIS do sistema.css: ele força fundo, raio e fonte com
   `html body … !important`, então as regras daqui que disputam com ele
   também começam por `html body`.

   Cor: só tokens do base.css. As quatro cores próprias da tela (o painel
   da marca e o destaque quente do título) ficam em --lg-*, declaradas
   para claro e escuro — variável vai FORA do :where() (CLAUDE.md §17).

   Ícones: Bootstrap Icons. O Font Awesome antigo não aparecia: a regra de
   fonte do sistema.css troca a família de todo elemento que não é .bi.
   ===================================================================== */

@font-face{font-family:'IBM Plex Serif';font-style:normal;font-weight:300;font-display:swap;src:url('./fontes/plex-serif-300.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Serif';font-style:italic;font-weight:300;font-display:swap;src:url('./fontes/plex-serif-300-italic.woff2') format('woff2')}

:root {
  --lg-marca:        #34433A;   /* painel da marca                               */
  --lg-marca-tinta:  #FFFFFF;   /* 11,1:1 no painel                              */
  --lg-marca-tinta-2:#C9D3CA;   /*  7,4:1                                        */
  --lg-destaque:     #E7B48F;   /*  6,1:1 — "num só lugar.", sobretítulo, ícones */
  --lg-serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
}
html[data-tema-escuro] {
  --lg-marca:        #161C18;
  --lg-marca-tinta:  #E6E9E3;
  --lg-marca-tinta-2:#A8AFA5;
  --lg-destaque:     #D4895C;
}

/* ── estrutura: duas colunas na altura da tela ─────────────────────── */
html body.lg-body { margin: 0; min-height: 100vh; background: var(--superficie) !important; }

/* O script de login liga as telas com style.display = 'flex' — por isso
   o contêiner é flex, não grid. */
.login-container { display: flex; min-height: 100vh; width: 100%; }

/* ── painel da marca ───────────────────────────────────────────────── */
.lg-marca {
  position: relative; overflow: hidden; isolation: isolate;
  flex: 0 0 55.5%;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--e-6);
  padding: 56px 64px 48px;
  background: var(--lg-marca);
  color: var(--lg-marca-tinta);
}
/* curvas de nível (o "campo") e um brilho quente no canto — decorativos */
.lg-marca::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: url('../images/login-curvas.svg') right bottom / 800px 900px no-repeat;
  opacity: .09;
}
.lg-marca::after {
  content: ''; position: absolute; z-index: -1; width: 900px; height: 900px; right: -360px; bottom: -320px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lg-destaque) 22%, transparent), transparent);
  pointer-events: none;
}
/* No escuro o brilho terracota sobre o quase-preto virava uma mancha marrom
   ("não combinou"). Lá ele passa a ser um verde frio e bem baixo, só para o
   painel não ficar chapado, e as curvas descem um pouco. */
html[data-tema-escuro] .lg-marca { background: linear-gradient(160deg, #1A231D 0%, #141A16 100%); }
html[data-tema-escuro] .lg-marca::before { opacity: .06; }
html[data-tema-escuro] .lg-marca::after {
  background: radial-gradient(closest-side, rgba(139,163,143,.12), transparent);
}

.lg-logo { display: flex; align-items: center; gap: 12px; }
.lg-selo {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--lg-destaque);
  background: color-mix(in srgb, var(--lg-destaque) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--lg-destaque) 40%, transparent);
}
html body .lg-logo-nome { display: flex; flex-direction: column; line-height: 1.25; }
html body .lg-logo-nome strong { font-size: 17px; font-weight: 600; color: var(--lg-marca-tinta); }
html body .lg-logo-nome small  { font-size: 12px; color: var(--lg-marca-tinta-2); }

.lg-manchete { max-width: 680px; }
html body .lg-sobretitulo {
  display: flex; align-items: center; gap: 12px; margin: 0 0 var(--e-5);
  font-size: 13px; font-weight: 500; color: var(--lg-destaque);
}
.lg-sobretitulo::before { content: ''; width: 28px; height: 1px; background: currentColor; }
html body .lg-titulo {
  margin: 0 0 var(--e-5);
  /* !important: o sistema.css troca a fonte de TODO elemento com uma regra
     de peso (0,3,2) — sem ele o título voltaria para a Plex Sans. */
  font-family: var(--lg-serif) !important; font-weight: 300;
  font-size: clamp(40px, 4.2vw, 60px); line-height: 1.13; letter-spacing: -0.015em;
  color: var(--lg-marca-tinta);
}
html body .lg-titulo em { font-family: var(--lg-serif) !important; font-weight: 300; font-style: italic; color: var(--lg-destaque); }
html body .lg-sub { margin: 0; max-width: 520px; font-size: 17px; line-height: 1.6; color: var(--lg-marca-tinta-2); }

.lg-modulos { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; padding: 0; }
html body .lg-modulos li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--lg-marca-tinta);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18);
}
html[data-tema-escuro] body .lg-modulos li { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.13); }
.lg-modulos i { color: var(--lg-destaque); font-size: 15px; }

html body .lg-rodape { display: flex; justify-content: space-between; gap: var(--e-4); font-size: 12px; color: var(--lg-marca-tinta-2); }

/* ── lado do formulário ────────────────────────────────────────────── */
.lg-lado {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: var(--e-6);
  padding: 48px 48px 40px;
  background: var(--superficie);
}
.lg-lado::before { content: ''; }   /* empurra o formulário para o meio */
.lg-form { width: 100%; max-width: 380px; }

.lg-cab { margin-bottom: 28px; }
html body .lg-sobre { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--barro); }
html body .lg-cab h2 { margin: 0 0 8px; font-size: 32px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; color: var(--tinta); }
html body .lg-cab p:last-child { margin: 0; font-size: 15px; color: var(--tinta-2); }

.lg-campo { margin-bottom: 20px; }
html body .lg-campo label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--tinta-2); }
.lg-entrada { position: relative; }
.lg-entrada > .bi {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--tinta-2); pointer-events: none;
}
html body .lg-entrada input {
  box-sizing: border-box; width: 100%; height: 48px; padding: 0 44px 0 40px;
  font-size: 15px; color: var(--tinta);
  background-color: var(--campo); border: 1px solid var(--risco-forte);
  transition: border-color .15s;
}
html body .lg-entrada input:hover { border-color: var(--tinta-3); }
html body .lg-entrada input:focus { outline: none; border-color: var(--barro-acao); }
html body .lg-entrada input:focus-visible { outline: 2px solid var(--barro-acao) !important; outline-offset: 1px; }
html body .password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: var(--r); background: transparent; color: var(--tinta-2); cursor: pointer;
}
html body .password-toggle:hover { color: var(--tinta); background: var(--superficie-2); }

.form-options { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); margin: 4px 0 20px; }
html body .remember-me { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--tinta-2); cursor: pointer; }
html body .remember-me .form-check-input { margin: 0; width: 16px; height: 16px; border-color: var(--risco-forte); background-color: var(--campo); }
html body .remember-me .form-check-input:checked { background-color: var(--barro-acao); border-color: var(--barro-acao); }
html body .forgot-password, html body .lg-ajuda a { font-size: 14px; font-weight: 500; color: var(--barro); text-decoration: none; }
html body .forgot-password:hover, html body .lg-ajuda a:hover { text-decoration: underline; }

html body .btn-login {
  width: 100%; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--barro-acao); color: #fff;
  transition: filter .15s;
}
html[data-tema-escuro] body .btn-login { color: var(--superficie); }
html body .btn-login:hover { filter: brightness(1.08); }
html body .btn-login .bi { transition: transform .15s; }
html body .btn-login:hover .bi { transform: translateX(3px); }
html body .btn-login:disabled { opacity: .6; cursor: progress; }

/* mensagem do script (Entrando… / erro / e-mail enviado). O script ainda
   escreve style.color; aqui fica só o tamanho e o espaço. */
html body #auth-status, html body #passwordResetStatus { min-height: 0; margin: 12px 0 0; font-size: 14px; text-align: center; }
html body #auth-status:empty, html body #passwordResetStatus:empty { margin: 0; }

.lg-ou { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.lg-ou::before, .lg-ou::after { content: ''; flex: 1; height: 1px; background: var(--risco); }
html body .lg-ou span { font-size: 13px; color: var(--tinta-3); }

html body .lg-google {
  height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--risco-forte); border-radius: var(--r);
  background: var(--superficie); color: var(--tinta); font-size: 15px; font-weight: 500; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
html body .lg-google:hover { background: var(--superficie-2); border-color: var(--tinta-3); }
/* No escuro a regra geral de link pinta todo <a> de barro; este é um botão. */
html body a.lg-google, html body a.lg-google:hover { color: var(--tinta) !important; }

html body .lg-ajuda { margin: 28px 0 0; font-size: 14px; color: var(--tinta-2); }

html body .lg-nota { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--tinta-3); }

/* ── celular: a marca vira uma faixa no topo ───────────────────────── */
@media (max-width: 900px) {
  .login-container { flex-direction: column; }
  .lg-marca { flex: 0 0 auto; padding: 28px 24px 32px; gap: 28px; }
  .lg-marca::before { background-position: -330px -520px; }
  .lg-sobretitulo, .lg-sub, .lg-modulos, .lg-rodape { display: none !important; }
  html body .lg-titulo { font-size: 32px; line-height: 1.2; margin: 0; }
  .lg-lado { padding: 28px 24px 24px; justify-content: flex-start; }
  .lg-lado::before { display: none; }
  .lg-form { max-width: none; }
  .lg-cab { margin-bottom: 22px; }
  html body .lg-cab h2 { font-size: 24px; }
  .lg-sobre { display: none; }
  .lg-nota { margin-top: auto; padding-top: var(--e-5); }
}
