/* auth.css — folha compartilhada das telas de autenticação
   (login, esqueci-senha, redefinir-senha). Identidade EscJus:
   papel quente + esmeralda + dourado. Mobile-first. */

:root {
  --bg:        #F6F2EA;   /* papel */
  --ink:       #0C1510;
  --accent:    #0E5C43;   /* esmeralda */
  --accent-d:  #0A4533;
  --accent-l:  #1B7A5A;
  --gold:      #B8894B;
  --gold-text: #7D5A1C;   /* dourado legível */
  --border:    #D9D3C5;   /* borda quente */
  --error-bg:  #F7ECEA;
  --error-ink: #8C2F23;
  --ok-bg:     #E3EDE6;
  --ok-ink:    #0A4533;
  --muted:     #49564E;
}

* { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.card {
  width: 100%; max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px -20px rgba(14,92,67,.25), 0 8px 20px -8px rgba(15,26,20,.12);
}

.brand-logo-login { display: block; max-width: 230px; height: auto; margin: 0 auto 8px; }

.brand-mark {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-text); margin-bottom: 16px;
  text-align: center;
}

h1 {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 600; font-size: 26px; line-height: 1.15;
  margin: 0 0 6px; text-align: center;
}

.sub { font-size: 13.5px; color: var(--muted); margin: 0 0 20px; text-align: center; line-height: 1.5; }

label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 6px; }

input[type=email], input[type=password], input[type=text] {
  width: 100%; font-size: 16px; /* >=16px evita zoom iOS */
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FAF8F2;
  font-family: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }

/* Campo de senha com botão mostrar/ocultar (alvo de toque 44x44) */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle {
  position: absolute; top: 50%; right: 4px;
  transform: translateY(-50%);
  width: 44px; height: 44px; min-height: 44px;
  margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 10px;
  color: var(--muted); cursor: pointer;
  box-shadow: none;
}
.pw-toggle:hover,
.pw-toggle:active { color: var(--accent); background: none; transform: translateY(-50%); box-shadow: none; }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye     { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye-off { display: block; }

button, .btn-link {
  width: 100%; margin-top: 22px;
  min-height: 48px; /* touch target */
  background: linear-gradient(180deg, var(--accent-l) 0%, var(--accent) 50%, var(--accent-d) 100%);
  color: #fff;
  border: 0; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.2),
    0 6px 16px -4px rgba(14,92,67,.4);
  transition: transform .2s, box-shadow .2s;
}
button:hover  { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-d) 100%); transform: translateY(-1px); }
button:active { transform: translateY(0); box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 2px 4px rgba(14,92,67,.3); }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Estado de envio: desabilita e mostra spinner (via js/auth.js) */
button[disabled] { opacity: .75; cursor: default; }
button[disabled]:hover { transform: none; }
button.is-loading::after {
  content: ""; display: inline-block;
  width: 14px; height: 14px;
  margin-left: 10px; vertical-align: -2px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.btn-link {
  display: inline-block; width: auto;
  padding: 12px 26px; margin-top: 18px;
  text-decoration: none; font-size: 14px; text-align: center;
}

.error {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--error-bg); color: var(--error-ink);
  border-radius: 8px; font-size: 13px;
}
.notice {
  margin-bottom: 4px;
  padding: 10px 12px;
  background: #F1EBDD; color: var(--gold-text);
  border: 1px solid #E4D9C2;
  border-radius: 8px; font-size: 13px; line-height: 1.45;
}
.ok  { padding: 16px; background: var(--ok-bg); color: var(--ok-ink); border-radius: 12px; font-size: 14px; line-height: 1.5; text-align: center; }
.ok strong { display: block; margin-bottom: 4px; }
.bad { padding: 16px; background: var(--error-bg); color: var(--error-ink); border-radius: 12px; font-size: 14px; line-height: 1.5; text-align: center; }

.hint { font-size: 12px; color: #6A7872; margin-top: 6px; }

.voltar { display: block; text-align: center; margin-top: 20px; font-size: 13px; color: #6A7872; text-decoration: none; }
.voltar:hover { color: var(--accent); }

.link-sutil { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500; }

.tx-accent { color: var(--accent); }
.tx-error  { color: var(--error-ink); }
.center    { text-align: center; }
.mt-16     { margin-top: 16px; }

.card-foot {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12px; color: #8a8275;
}
.card-foot svg { vertical-align: -1px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .01ms !important; }
}
