/* Page de connexion (décision 44, variante A « Carte » ; DESIGN.md, Page de connexion). Feuille autonome : la page
   ne charge plus app.css. */
@font-face {
  font-family: 'Inter Connexion';
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --marine: #1d2b4f;
  --marine-survol: #2c4066;
  --bleu-clair: #a8d0e6;
  --texte-secondaire: #4f5a70;   /* 7,0:1 sur blanc */
  --bord-champ: #8a94a8;         /* 3,0:1 sur blanc : bord d'un champ visible */
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter Connexion', system-ui, sans-serif;
  color: var(--marine);
  background: #0e1730;
  -webkit-font-smoothing: antialiased;
}
.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at 50% 32%, #2c4066 0%, #1d2b4f 55%, #0e1730 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 44px 40px 40px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(4, 10, 30, 0.45);
}

/* Logo de l'agence tel quel (le même que l'en-tête de /app/) ; sans logo, son nom en texte */
.login-marque { display: flex; justify-content: center; margin-bottom: 36px; }
.login-marque img { display: block; max-width: 240px; max-height: 44px; width: auto; height: auto; }
.login-marque-nom { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; }

.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-champ { display: flex; flex-direction: column; gap: 8px; }
.login-champ label { font-size: 0.8125rem; font-weight: 550; }
.login-champ input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--bord-champ); border-radius: 10px; background: #fff;
  font: inherit; font-size: 0.9375rem; color: var(--marine);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-champ input:focus { outline: none; border-color: var(--marine); box-shadow: 0 0 0 3px var(--bleu-clair); }

/* Bouton œil dans le champ du mot de passe */
.mdp-zone { position: relative; }
.mdp-zone input { padding-right: 3rem; }
.mdp-oeil {
  position: absolute; top: 50%; right: 0.3rem; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; padding: 0; border: none; border-radius: 8px;
  background: transparent; color: var(--texte-secondaire); cursor: pointer;
}
.mdp-oeil:hover { color: var(--marine); background: #f1f5f9; }
.mdp-oeil:focus-visible { outline: 2px solid var(--marine); outline-offset: 1px; color: var(--marine); }
.mdp-oeil svg { width: 1.15rem; height: 1.15rem; }
.mdp-oeil [hidden] { display: none; }

.login-bouton {
  margin-top: 8px; height: 48px; border: 0; border-radius: 10px;
  background: var(--marine); color: #fff; font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  transition: background-color 0.15s;
}
.login-bouton:hover { background: var(--marine-survol); }
.login-bouton:focus-visible { outline: 2px solid var(--marine); outline-offset: 3px; }

.login-erreur {
  padding: 12px 14px; border-left: 3px solid #b42318; border-radius: 0 8px 8px 0;
  background: #fdf0ef; color: #8c1d18; font-size: 0.875rem; line-height: 1.45;
}
.login-erreur ul { margin: 0; padding: 0; list-style: none; }

/* Symbole de l'agence (décision 43) : en bas à gauche, coupé par le bord gauche (30 %) et le bas (20 %) ; partie
   visible jamais plus large que la colonne laissée par la carte (moins 16 px) ; masqué si elle est trop étroite. */
.symbole-agence {
  --taille: min(((100vw - 400px) / 2 - 16px) / .7, 60vh, 640px);
  position: fixed; left: calc(var(--taille) * -.3); bottom: calc(var(--taille) * -.2);
  width: var(--taille); height: var(--taille); object-fit: contain; opacity: .5; pointer-events: none;
}
@media (max-width: 639px) { .symbole-agence { display: none; } }

@media (max-width: 480px) {
  .login-page { padding: 16px; }
  .login-card { padding: 36px 24px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-champ input, .login-bouton { transition: none; }
}

/* Double authentification (décision 73) : pages de vérification, d'activation et des codes de secours */
.dfa-carte-large { max-width: 460px; }
.dfa-titre { margin: 0 0 12px; font-size: 1.25rem; font-weight: 650; text-align: center; }
.dfa-aide, .dfa-etapes { margin: 0 0 20px; font-size: 0.9375rem; line-height: 1.5; color: var(--texte-secondaire); }
.dfa-etapes { padding-left: 1.25rem; }
.dfa-etapes li + li { margin-top: 6px; }
.dfa-qr { display: block; width: 240px; height: 240px; margin: 0 auto 16px; }
.dfa-secret { font-family: ui-monospace, monospace; font-size: 1rem; letter-spacing: 0.05em; word-spacing: 0.3em;
  text-align: center; user-select: all; }
.dfa-secours { margin: 0 0 20px; font-size: 0.875rem; line-height: 1.5; color: var(--texte-secondaire); }
.dfa-secours summary { cursor: pointer; color: var(--marine); font-weight: 600; }
.dfa-secours summary:focus-visible, .dfa-lien:focus-visible { outline: 2px solid var(--marine); outline-offset: 3px; }
.dfa-alerte { margin-bottom: 16px; padding: 12px 14px; border-left: 3px solid var(--marine); border-radius: 0 8px 8px 0;
  background: #eef3f9; font-size: 0.875rem; line-height: 1.5; }
.dfa-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0 0 20px; padding: 0;
  list-style: none; font-family: ui-monospace, monospace; font-size: 1rem; text-align: center; }
.dfa-codes li { padding: 8px; border: 1px solid #d5dae3; border-radius: 8px; }
.dfa-continuer { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.dfa-sortie { margin-top: 20px; text-align: center; }
.dfa-lien { border: 0; background: none; padding: 4px; color: var(--marine); font: inherit; font-size: 0.875rem;
  text-decoration: underline; cursor: pointer; }
