/* =====================================================================
   HoDigit – pages de connexion (connexion, code 2FA, mot de passe oublié,
   réinitialisation) et pages publiques (RGPD, confidentialité)
   ===================================================================== */
* { box-sizing: border-box; }
:root { --circle-x: 50%; --circle-y: 50%; --accent: #4f46e5; --accent-2: #7c3aed; --ink: #0b1020; --muted: #6b7280; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; min-height: 100dvh; background: #fff; color: var(--ink); }
.login-wrapper { min-height: 100dvh; display: grid; }
.logo { background-image: url("assets/logo_index.png"); background-repeat: no-repeat; background-position: left center; background-size: contain; width: min(620px, 90%); height: 140px; margin-left: 6%; }
.login-panel { display: flex; justify-content: center; align-items: center; width: 100%; }
.login-card {
  position: absolute; left: var(--circle-x); top: var(--circle-y); transform: translate(-50%, -50%);
  width: min(420px, 92vw); background: #fff; border-radius: 24px; padding: 30px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  animation: auth-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes auth-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
.login-title { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.error, .notice, .success { border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.error { background: #fee2e2; color: #b91c1c; }
.notice { background: #eef2ff; color: #3730a3; }
.success { background: #dcfce7; color: #166534; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; }
.field input { width: 100%; border-radius: 12px; border: 1px solid #e5e7eb; padding: 10px 12px; font-size: 14px; outline: none; font-family: inherit; }
.field input:focus { border-color: #111827; box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.10); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row a, .auth-link { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.field-row a:hover, .auth-link:hover { text-decoration: underline; }
.btn-primary { width: 100%; border: none; border-radius: 999px; padding: 11px 16px; background: #111827; color: #fff; font-size: 14px; cursor: pointer; margin-top: 6px; font-family: inherit; transition: transform 0.15s ease, box-shadow 0.2s ease; }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }
.btn-link { background: none; border: none; padding: 0; color: var(--accent); font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-link:disabled { color: #9ca3af; cursor: default; }
.auth-foot { margin-top: 16px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #374151; margin: 4px 0 12px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.back { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }

/* Saisie du code à 6 chiffres */
.code-inputs { display: flex; gap: 8px; justify-content: space-between; margin: 8px 0 14px; }
.code-inputs input {
  width: 100%; max-width: 52px; height: 58px; text-align: center; font-size: 24px; font-weight: 700;
  border-radius: 12px; border: 1.5px solid #e5e7eb; outline: none; font-family: ui-monospace, Consolas, monospace;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.2s ease;
}
.code-inputs input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18); transform: translateY(-2px); }
.code-inputs.is-error input { border-color: #ef4444; animation: auth-shake 0.4s ease; }
@keyframes auth-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Force du mot de passe */
.strength { height: 5px; border-radius: 5px; background: #e5e7eb; overflow: hidden; margin-top: 8px; }
.strength i { display: block; height: 100%; width: 0; border-radius: 5px; transition: width 0.3s ease, background-color 0.3s ease; }
.strength-label { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.visual-zone { position: relative; min-height: 100dvh; background-image: url("assets/backgroud.jpg"); background-repeat: no-repeat; background-position: center; background-size: cover; display: flex; align-items: center; justify-content: flex-start; padding: clamp(16px, 3vw, 40px); }

@media (max-width: 1400px) {
  .login-wrapper { grid-template-columns: 1fr; }
  .logo { margin: 0 auto; width: min(460px, 70vw); height: 96px; background-position: center; margin-top: -60%; margin-left: 30px; }
}
@media (max-width: 360px) {
  .login-title { font-size: 20px; }
  .login-card { border-radius: 18px; padding: 22px; }
  .code-inputs input { height: 50px; font-size: 20px; }
}

/* =====================================================================
   Pages légales
   ===================================================================== */
.legal { background: #f4f5fb; min-height: 100dvh; padding: 40px 16px 60px; }
.legal-card { max-width: 860px; margin: 0 auto; background: #fff; border-radius: 24px; padding: 40px 44px; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08); }
.legal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.legal-top img { height: 42px; }
.legal-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.legal-nav a { padding: 7px 14px; border-radius: 999px; font-size: 13px; text-decoration: none; color: #374151; background: #f4f5fb; }
.legal-nav a.is-on { background: var(--ink); color: #fff; }
.legal h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -0.02em; }
.legal .updated { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.legal h2 { font-size: 18px; margin: 32px 0 10px; padding-top: 4px; }
.legal h2 span { color: var(--accent); margin-right: 6px; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.7; color: #374151; }
.legal ul { padding-left: 20px; }
.legal table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13.5px; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eceef3; vertical-align: top; }
.legal th { background: #f8f9fc; font-weight: 600; color: #374151; }
.legal .todo { background: #fef3c7; color: #92400e; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.legal .box { background: #eef2ff; border-radius: 16px; padding: 16px 20px; margin: 16px 0; }
.legal a { color: var(--accent); }
@media (max-width: 640px) { .legal-card { padding: 26px 20px; } .legal table { font-size: 12.5px; } }

/* Code à 6 chiffres complet : le bouton Valider attire l'œil (verify_2fa.php) */
.btn-primary.is-ready { background: linear-gradient(135deg, #4f46e5, #7c3aed); animation: hd-ready-pulse 1.6s ease-out 2; }
@keyframes hd-ready-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45); }
  100% { box-shadow: 0 0 0 14px rgba(79, 70, 229, 0); }
}
