/* Ayiti Law — pages d'authentification (connexion, double authentification, mot de passe, erreurs).
   Même direction que la page d'accueil : graphite sombre par défaut, serif pour les titres, filets fins,
   quelques lueurs. Les couleurs, boutons, logo et bouton de thème viennent de theme.css. */

.auth-page {
  --border: var(--line);          /* pour les petits styles en ligne des vues (ex. cadre du QR code) */
  --text-faint: var(--ink3);
  min-height: 100vh; display: flex; flex-direction: column;
}

/* En-tête : double filet comme la page d'accueil */
.auth-top { border-top: 5px double var(--ink); border-bottom: 1px solid var(--line); background: var(--page); }
.auth-top__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.auth-top__tools { display: flex; align-items: center; gap: 14px; }
.auth-back { font-size: 14px; color: var(--ink2); }
.auth-back:hover { color: var(--ink); text-decoration: underline; }
.auth-top .theme-toggle__label { display: inline; }
@media (max-width: 520px) {
  .auth-back { display: none; }
  .auth-top .theme-toggle__label { display: none; }
}

/* Zone centrale, avec deux lueurs discrètes (bleue en haut à gauche, rouge en bas à droite) */
.auth-main { flex: 1; position: relative; isolation: isolate; overflow-x: hidden; overflow-x: clip; display: grid; place-items: center; padding: 40px 20px 56px; }
.auth-main::before, .auth-main::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.auth-main::before { width: 620px; height: 620px; left: -240px; top: -260px; background: radial-gradient(closest-side, var(--glow-blue), transparent); }
.auth-main::after { width: 520px; height: 520px; right: -160px; bottom: -200px; background: radial-gradient(closest-side, var(--glow-red), transparent); }

/* Carte */
.auth-card {
  position: relative; width: 100%; max-width: 440px; padding: 34px 32px 30px;
  background: var(--surface); border: 1px solid var(--line); border-top: 1px solid var(--rule); border-radius: 6px;
  box-shadow: var(--win-shadow);
}
.auth-card::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 4%, var(--blue-ink) 30%, var(--red-ink) 70%, transparent 96%);
  opacity: var(--hair-opacity);
}
.auth-card h2 { font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1.12; letter-spacing: -.02em; margin-bottom: 10px; }
.auth-card .lead { margin: 0 0 24px; font-size: 15px; line-height: 1.55; color: var(--lead); }
.auth-card p.hint { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--ink3); }
.auth-card a { color: var(--blue-ink); font-weight: 550; }
.auth-card a:hover { text-decoration: underline; }
.auth-card a.btn { font-weight: 600; text-decoration: none; }
.auth-card a.btn-primary { color: var(--btn-ink); }
.auth-card a.btn-outline { color: var(--ink); }
.auth-alt { margin-top: 22px; text-align: center; font-size: 14px; color: var(--ink2); }
.muted { color: var(--ink3); }
.small { font-size: 13px; line-height: 1.5; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 12px; }
.mono, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--page); font-size: .92em; color: var(--ink); word-break: break-all; }

/* Champs */
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.field input {
  width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--page); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.4;
  transition: border-color .15s;
}
.field input::placeholder { color: var(--ink3); opacity: .8; }
.field input:hover { border-color: var(--ink3); }
.field input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); box-shadow: 0 0 0 5px var(--glow-blue); }
.otp-input { text-align: center; font-family: ui-monospace, "SF Mono", Menlo, monospace !important; font-size: 22px !important; font-weight: 600; letter-spacing: 8px; }

/* Boutons (noms hérités des vues) */
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); min-height: 50px; }
.btn-primary:hover { background: var(--btn-hover); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--surface2); }
.btn-block { display: flex; width: 100%; }

/* Messages */
.flash { margin-bottom: 20px; padding: 11px 14px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 4px; background: var(--page); font-size: 14px; line-height: 1.45; }
.flash-success { border-left-color: var(--green-ink); color: var(--green-ink); }
.flash-error { border-color: var(--red-line); border-left-color: var(--red-ink); background: var(--red-bg); color: var(--red-ink); }

/* Codes de secours */
.backup-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 22px; }
.backup-codes code { display: block; padding: 10px; text-align: center; font-size: 14px; letter-spacing: .05em; }

/* Pages d'erreur (403, 404, 500) */
.auth-card .empty { text-align: center; }
.auth-card .card, .auth-card .card-pad { padding: 0; border: 0; background: transparent; box-shadow: none; }
.auth-card .empty h2 { font-size: 3rem !important; color: var(--ink3) !important; margin-bottom: 10px !important; }
.auth-card .empty p { color: var(--ink2); }
.auth-card .empty .mt { margin-top: 22px; }

@media (max-width: 520px) {
  .auth-main { padding: 24px 16px 40px; }
  .auth-card { padding: 28px 22px 24px; }
  .auth-card h2 { font-size: 1.75rem; }
}
