/*
 * vTransit — pages d'authentification (connexion, mot de passe, double authentification).
 * Charte vtransit.ma : échelle "ink" (marine), "brand" (bleu), logo marine + cyan.
 */
:root {
  --vt-logo-navy: #0E1A33;
  --vt-logo-cyan: #16C7DE;
  --vt-ink-900: #0a1330;
  --vt-ink-800: #141c30;
  --vt-ink-700: #232d44;
  --vt-ink-600: #36425c;
  --vt-ink-500: #4a5774;
  --vt-ink-400: #6d7ea6;
  --vt-ink-200: #cdd5e6;
  --vt-ink-100: #e7ebf4;
  --vt-brand-600: #2348c4;
  --vt-brand-700: #1d3aa0;
  --vt-brand-50: #eef3ff;
  --vt-line: #e4e9f2;
  --vt-surface: #eef2f8;
  --vt-success-bg: #ecfdf5;
  --vt-success: #007a55;
  --vt-warning-bg: #fffbeb;
  --vt-warning: #bb4d00;
  --vt-danger-bg: #fef2f2;
  --vt-danger: #c10007;
  --vt-font: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  /* Titres : police du texte (2026-10-12, demande utilisateur : Space Grotesk trop serrée, « texte collé »).
     Space Grotesk reste seulement pour le mot « VTransit » du logo (--vt-font-logo). */
  --vt-font-display: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --vt-font-logo: 'Space Grotesk', 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.vt-auth {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  background: var(--vt-surface);
  color: var(--vt-ink-900);
  font-family: var(--vt-font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.vt-auth a { color: var(--vt-brand-600); }
.vt-auth a:hover { color: var(--vt-brand-700); }
.vt-auth :focus-visible { outline: 2px solid var(--vt-brand-600); outline-offset: 2px; }

/* ---------- Panneau de marque ---------- */
.vt-auth-brand {
  flex: 1 1 420px;
  position: relative;
  overflow: hidden;
  background: var(--vt-logo-navy);
  color: #FFFFFF;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
.vt-auth-brand-watermark {
  position: absolute;
  right: -180px;
  bottom: -160px;
  width: 640px;
  height: 640px;
  opacity: 0.09;
  pointer-events: none;
}
.vt-auth-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  text-decoration: none;
}
.vt-auth-logo svg { display: block; }
.vt-auth-logo span {
  font-family: var(--vt-font-logo);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-left: -4px;
}
.vt-auth-pitch {
  position: relative;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.vt-auth-pitch h2 {
  margin: 0;
  font-family: var(--vt-font-display);
  font-size: 36px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}
.vt-auth-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.vt-auth-features li { display: flex; gap: 14px; align-items: flex-start; }
.vt-auth-features .vt-feature-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(22, 199, 222, 0.14);
  color: var(--vt-logo-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vt-auth-features strong { display: block; font-weight: 600; }
.vt-auth-features small { display: block; font-size: 13px; color: #b8c4dc; }
.vt-auth-copyright { position: relative; font-size: 12px; color: #b8c4dc; }

/* ---------- Zone formulaire ---------- */
.vt-auth-main {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
}
.vt-auth-card {
  width: 100%;
  max-width: 420px;
  background: #FFFFFF;
  border: 1px solid var(--vt-line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(10, 19, 48, 0.06), 0 12px 32px rgba(10, 19, 48, 0.06);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.vt-auth-card h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: 0; color: var(--vt-ink-900); }
.vt-auth-card h1 small { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--vt-ink-500); letter-spacing: 0; }
.vt-auth-subtitle { margin: 4px 0 0; color: var(--vt-ink-500); }
.vt-auth-card form { display: flex; flex-direction: column; gap: 18px; margin: 0; }

/* Champs : nos vues et render_input() de Perfex (.form-group / .control-label / .form-control) */
.vt-auth-card .form-group,
.vt-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.vt-auth-card label,
.vt-auth-card .control-label { font-size: 13px; font-weight: 600; color: var(--vt-ink-700); margin: 0; }
.vt-field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vt-field-head a { font-size: 13px; font-weight: 500; }
.vt-auth-card input[type="email"],
.vt-auth-card input[type="password"],
.vt-auth-card input[type="text"],
.vt-auth-card .form-control {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--vt-ink-400);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--vt-ink-900);
  font: inherit;
  font-size: 14px;
  box-shadow: none;
}
.vt-auth-card input::placeholder { color: var(--vt-ink-500); opacity: 1; }
.vt-auth-card input:focus { border-color: var(--vt-brand-600); outline: 2px solid var(--vt-brand-600); outline-offset: 0; }
.vt-password { position: relative; }
.vt-password input { padding-right: 48px; }
.vt-password-toggle {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--vt-ink-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.vt-password-toggle .vt-icon-hide { display: none; }
.vt-password-toggle[aria-pressed="true"] .vt-icon-show { display: none; }
.vt-password-toggle[aria-pressed="true"] .vt-icon-hide { display: block; }

.vt-checkbox { display: flex; align-items: center; gap: 10px; min-height: 28px; color: var(--vt-ink-700); font-weight: 400 !important; cursor: pointer; }
.vt-checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--vt-brand-600); cursor: pointer; }

.vt-btn-primary {
  height: 44px;
  border: 1px solid var(--vt-ink-900);
  border-radius: 6px;
  background: var(--vt-ink-900);
  color: #FFFFFF;
  font: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  text-decoration: none;
}
.vt-btn-primary:hover { background: var(--vt-ink-800); color: #FFFFFF; }
.vt-auth-back { text-align: center; font-size: 13px; }

/* Messages : alerts.php (flashdata) et validation_errors() */
.vt-auth-card .row { margin: 0; }
.vt-auth-card > .row:not(:has(.alert)) { display: none; } /* alerts.php sans message : pas d'espace vide */
.vt-auth-card .col-lg-12 { padding: 0; }
.vt-auth-card .alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  text-align: left !important;
}
.vt-auth-card .alert p { margin: 0; }
.vt-auth-card .alert-danger { background: var(--vt-danger-bg); color: var(--vt-danger); border-color: #ffc9c9; }
.vt-auth-card .alert-success { background: var(--vt-success-bg); color: var(--vt-success); border-color: #a7f3d0; }
.vt-auth-card .alert-warning { background: var(--vt-warning-bg); color: var(--vt-warning); border-color: #fee685; }
.vt-auth-card .alert-info { background: var(--vt-brand-50); color: var(--vt-brand-700); border-color: #bcd0ff; }

.vt-auth-card .g-recaptcha { align-self: center; }

/* ---------- Petits écrans : le panneau de marque devient un bandeau ---------- */
@media (max-width: 900px) {
  body.vt-auth { align-content: flex-start; } /* les lignes ne s'étirent pas : bandeau à la hauteur du logo */
  .vt-auth-brand { flex-basis: 100%; padding: 20px 24px; gap: 0; }
  .vt-auth-pitch, .vt-auth-copyright, .vt-auth-brand-watermark { display: none; }
  .vt-auth-logo span { font-size: 24px; }
  .vt-auth-logo svg { width: 32px; height: 32px; }
  .vt-auth-main { padding: 32px 16px; align-items: flex-start; }
  .vt-auth-card { padding: 28px 20px; }
}

/* Arabe : miroir de la mise en page */
[dir="rtl"] .vt-auth-logo span { margin-left: 0; margin-right: -4px; }
[dir="rtl"] .vt-password input { padding-right: 12px; padding-left: 48px; }
[dir="rtl"] .vt-password-toggle { right: auto; left: 2px; }
[dir="rtl"] .vt-auth-card .alert { text-align: right !important; }
