/* Telas de acesso (login e verificação em duas etapas) — lateral clara (bege) + área de
   acesso (branco quente). Só Figtree. Cores alinhadas à identidade oficial (--primary #582836
   em style.css). */
.lg {
  --wine:        #602B3D;
  --wine-dark:   #4E2232;
  --gold-soft:   #B88950;
  --paper:       #FFFEFA;
  --sand:        #F3ECE2;
  --ink:         #2a1a12;
  --ink-muted:   #6f5a4b;
  --line:        #e3d8cb;
  --line-strong: #cbbcab;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: #FFFEFA;
  color: #2a1a12;
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
}

.lg {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 4px solid var(--wine-dark);
  box-sizing: border-box;
}

/* ─────────── Lateral clara ─────────── */
.lg-side {
  background: var(--sand);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 64px;
}
.lg-side-inner { width: 100%; max-width: 400px; margin: 0 auto; }

/* Letreiro oficial. O PNG (640x453) tem fundo branco e margem larga:
   a janela recorta o letreiro e o "multiply" funde o branco ao bege, sem alterar a marca. */
.lg-logo { width: 325px; height: 100px; overflow: hidden; margin-bottom: 36px; }
.lg-logo img {
  display: block;
  width: 403px;
  max-width: none;
  height: auto;
  margin: -93px 0 0 -39px;
  mix-blend-mode: multiply;
}

.lg-rule { width: 48px; height: 3px; background: var(--gold-soft); margin-bottom: 20px; }
.lg-side p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 38ch;
}

/* ─────────── Área de acesso ─────────── */
.lg-access {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 32px 40px 24px;
}
.lg-form-wrap {
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding: 24px 0;
}

.lg-access h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
}
.lg-lead {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.lg-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #ebc7c7;
  background: #fdf3f3;
  color: #7a1c1c;
  font-size: 14px;
  line-height: 1.45;
  padding: 11px 13px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.lg-error svg { flex-shrink: 0; margin-top: 2px; }
.lg-error[hidden] { display: none; }
.lg-error strong { font-variant-numeric: tabular-nums; }

.lg-field { margin-bottom: 18px; }
.lg-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}
.lg-field input {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lg-field input:hover { border-color: #b3a08b; }
.lg-field input:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(96, 43, 61, .18);
}

.lg-pass { position: relative; }
.lg-pass input { padding-right: 92px; }
.lg-show {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  padding: 0 12px;
  background: none;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--wine);
  cursor: pointer;
}
.lg-show:hover { background: #f5eee6; }
.lg-show:focus-visible { outline: 2px solid var(--wine); outline-offset: 1px; }

/* Espaço reservado para o widget do Cloudflare Turnstile (300x65) */
.lg-captcha { min-height: 65px; margin: 6px 0 20px; display: flex; justify-content: center; }

.lg-submit {
  width: 100%;
  height: 48px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  background: var(--wine);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease;
}
.lg-submit:hover { background: var(--wine-dark); }
.lg-submit:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }
.lg-submit:disabled { opacity: .75; cursor: progress; }

.lg-help {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-muted);
}

.lg-foot { font-size: 12.5px; color: #7a6554; text-align: center; }

/* ─────────── Verificação em duas etapas ─────────── */
/* Campo único de 6 dígitos: aceita colar o código inteiro e o preenchimento automático
   do celular (autocomplete="one-time-code"). */
.lg-field .lg-otp {
  height: 60px;
  padding: 0 12px;
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5em;
  text-indent: .5em;      /* compensa o espaço após o último dígito e centraliza */
  text-align: center;
}
.lg-otp::placeholder { color: #d6c9ba; letter-spacing: .5em; }
.lg-hint {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* Aviso logo abaixo do campo (código inválido, limite de tentativas) */
.lg-field-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #8a1f1f;
}
.lg-field-msg[hidden] { display: none; }
.lg-field-msg svg { flex-shrink: 0; margin-top: 2px; }
.lg-field-msg strong { font-variant-numeric: tabular-nums; }
.lg-field input.is-invalid { border-color: #c56b6b; }
.lg-field input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(197, 107, 107, .2); }
.lg-field input:disabled { background: #f6f1ea; color: #a8998a; cursor: not-allowed; }
.lg-submit:disabled:not(.is-sending) { cursor: not-allowed; }
.lg-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--wine);
  text-decoration: none;
}
.lg-back:hover { text-decoration: underline; }
.lg-back:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; border-radius: 4px; }

/* ─────────── Ativar a verificação em duas etapas ─────────── */
.lg-form-wrap--wide { max-width: 440px; }

.lg-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #cfdcc2;
  background: #f3f7ee;
  color: #3d5328;
  font-size: 14px;
  line-height: 1.45;
  padding: 11px 13px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.lg-notice svg { flex-shrink: 0; margin-top: 2px; }

.lg-steps { list-style: none; margin: 0; padding: 0; }
.lg-steps > li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 0 0 22px;
  position: relative;
}
/* linha que liga os passos */
.lg-steps > li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.lg-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--wine);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lg-steps strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 28px;
}
.lg-steps p {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.lg-step-body form { margin-top: 12px; }
.lg-step-body .lg-error { margin: 12px 0 0; }

.lg-qr-card {
  display: grid;
  grid-template-columns: 184px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lg-qr { width: 168px; height: 168px; padding: 8px; background: #fff; }
.lg-qr img, .lg-qr canvas { display: block; width: 168px; height: 168px; }
.lg-qr-alt p { margin: 0 0 8px; font-size: 13px; }
.lg-key {
  display: block;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--sand);
  border-radius: 6px;
  padding: 8px 10px;
  word-break: break-word;
}
.lg-copy {
  margin-top: 8px;
  height: 34px;
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--wine);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
}
.lg-copy:hover { background: #f5eee6; }
.lg-copy:focus-visible { outline: 2px solid var(--wine); outline-offset: 1px; }

.lg-leave {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 4px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-muted);
}
.lg-leave .lg-back { margin-top: 0; }
.lg-link-btn {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  color: var(--wine);
  cursor: pointer;
}
.lg-link-btn:hover { text-decoration: underline; }
.lg-link-btn:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; border-radius: 4px; }

/* ─────────── Celular: lateral vira cabeçalho compacto ─────────── */
@media (max-width: 860px) {
  .lg { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lg-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .lg-logo { width: 196px; height: 60px; margin-bottom: 0; }
  .lg-logo img { width: 243px; margin: -56px 0 0 -23px; }
  .lg-rule, .lg-side p { display: none; }
  .lg-access { padding: 8px 20px 20px; }
  .lg-form-wrap { max-width: 400px; padding: 24px 0 28px; margin: 0 auto; }
  .lg-access h1 { font-size: 24px; }
  .lg-foot { margin-top: auto; }
  .lg-qr-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

/* App instalado no tablet (PWA): a tela de acesso também não rola como página;
   se o conteúdo não couber (tela pequena), rola por dentro. Ver style.css. */
@media screen and (display-mode: standalone) {
  .lg { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: none; }
}
