/* ==========================================================================
   Pages d'authentification Transport Flexible (connexion, inscription,
   mot de passe, vérification) et pages légales. Dépend de tf-palette.css
   et tf-buttons.css. Aucune image lourde : fond en dégradés CSS.
   ========================================================================== */

.tf-auth {
  min-height: 100vh;
  margin: 0;
  font-family: var(--tf-font);
  color: var(--tf-text);
  background:
    radial-gradient(circle at 12% 8%, var(--tf-green-soft) 0, transparent 38%),
    radial-gradient(circle at 88% 92%, var(--tf-blue-soft) 0, transparent 45%),
    var(--tf-page);
}

.tf-auth a { color: var(--tf-blue); }
.tf-auth a:hover { color: var(--tf-blue-dark); }

/* Focus clavier toujours visible (contraste ≥ 3:1 sur blanc et sur bleu). */
.tf-auth :focus-visible {
  outline: 3px solid var(--tf-blue);
  outline-offset: 2px;
  box-shadow: none;
}
.tf-auth__aside :focus-visible { outline-color: #ffffff; }

.tf-auth__skip {
  position: absolute; left: -9999px; top: 0.5rem; z-index: 10;
  padding: 0.5rem 1rem; background: var(--tf-surface); border-radius: var(--tf-radius-sm);
}
.tf-auth__skip:focus { left: 0.5rem; }

.tf-auth__shell {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
  align-items: stretch;
}
.tf-auth__shell > * { min-width: 0; }
.tf-auth__shell--single { max-width: 480px; }
.tf-auth__shell--doc { max-width: 820px; }

@media (min-width: 992px) {
  .tf-auth__shell:not(.tf-auth__shell--single):not(.tf-auth__shell--doc) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    min-height: calc(100vh - 4rem);
    align-items: center;
  }
}

.tf-auth__card {
  background: var(--tf-surface);
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  box-shadow: var(--tf-shadow);
  padding: 1.75rem 1rem;
  min-width: 0;
}
@media (min-width: 576px) { .tf-auth__card { padding: 2.25rem 2.5rem; } }

.tf-auth__brand { margin-bottom: 1.5rem; }

.tf-auth h1 { font-family: var(--tf-font-title); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 700; color: var(--tf-navy); margin: 0 0 0.35rem; }
.tf-auth__lead { color: var(--tf-muted); margin-bottom: 1.5rem; }

/* Champs */
.tf-field { margin-bottom: 1rem; }
.tf-field label, .tf-field .tf-field__label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--tf-ink); margin-bottom: 0.35rem; }
.tf-field .form-control {
  min-height: 46px; font-size: 1rem; color: var(--tf-ink);
  border: 1px solid #b9c3d1; border-radius: var(--tf-radius-sm);
}
.tf-field .form-control:focus { border-color: var(--tf-blue); box-shadow: 0 0 0 3px var(--tf-blue-soft); }
.tf-field .form-control.is-invalid { border-color: var(--tf-danger); }
.tf-field__help { font-size: 0.82rem; color: var(--tf-muted); margin-top: 0.3rem; }
.tf-field .invalid-feedback { display: block; color: var(--tf-danger); font-size: 0.85rem; }
.tf-field__control { position: relative; }
.tf-field__control .form-control { padding-right: 3rem; }
.tf-field__toggle {
  position: absolute; top: 0; right: 0; height: 100%; width: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--tf-muted); border-radius: 0 var(--tf-radius-sm) var(--tf-radius-sm) 0;
}
.tf-field__toggle:hover { color: var(--tf-blue); }

.tf-auth .form-check { margin-bottom: 0.6rem; }
.tf-auth .form-check-input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; border-color: #8a96a8; }
.tf-auth .form-check-input:checked { background-color: var(--tf-blue); border-color: var(--tf-blue); }
.tf-auth .form-check-label { font-size: 0.92rem; }

.tf-auth__row { display: grid; gap: 0 1rem; }
@media (min-width: 576px) { .tf-auth__row--2 { grid-template-columns: 1fr 1fr; } }

.tf-auth__inline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.25rem; }

.tf-auth__submit { width: 100%; --tf-btn-h: 48px; font-size: 1rem; font-weight: 600; }
.tf-auth__submit[aria-busy="true"] { cursor: progress; }
.tf-auth__spinner {
  width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: tf-spin 0.7s linear infinite; display: none;
}
.tf-auth__submit[aria-busy="true"] .tf-auth__spinner { display: inline-block; }
@keyframes tf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tf-auth__spinner { animation: none; } }

.tf-auth__links { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--tf-line); display: grid; gap: 0.6rem; font-size: 0.93rem; text-align: center; }

.tf-auth__alert { border-radius: var(--tf-radius-sm); padding: 0.75rem 0.9rem; margin-bottom: 1.25rem; font-size: 0.92rem; display: flex; gap: 0.6rem; }
.tf-auth__alert--error { background: var(--tf-danger-soft); color: #8f241c; border: 1px solid #f1c3bf; }
.tf-auth__alert--success { background: var(--tf-green-soft); color: var(--tf-green-dark); border: 1px solid #c6e9b6; }
.tf-auth__alert--info { background: var(--tf-info-soft); color: #075485; border: 1px solid #b9dcf0; }
.tf-auth__alert ul { margin: 0; padding-left: 1.1rem; }

/* Champ piège : invisible, hors de la navigation clavier et des lecteurs d'écran. */
.tf-auth__hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.tf-auth__turnstile { margin: 0.25rem 0 1rem; min-height: 65px; }

/* Panneau visuel (maquette) : bleu nuit du site, carte du monde, illustration, avantages, vague.
   Sur ordinateur il occupe la moitié gauche de l'écran ; le formulaire reste premier dans le DOM. */
.tf-icon { flex: none; display: inline-block; vertical-align: middle; }
.tf-auth__aside { position: relative; overflow: hidden; isolation: isolate; color: #ffffff; background: var(--tf-navy); border-radius: 16px; padding: 2rem 1.5rem 4.5rem; }
/* Carte des routes (x-public.route-map, tf-map.css) derrière l’illustration, comme dans les en-têtes du site. */
.tf-auth-panel__visual { position: relative; }
.tf-auth-panel__map { position: absolute; z-index: -1; left: -15%; width: 130%; top: -10%; }
.tf-auth__aside::after { content: ""; position: absolute; z-index: -1; left: -5%; right: -5%; bottom: -1px; height: 64px; background: var(--tf-page); clip-path: ellipse(60% 100% at 50% 100%); box-shadow: 0 -10px 0 color-mix(in srgb, var(--tf-blue) 70%, #ffffff); }
.tf-auth-panel { position: relative; max-width: 560px; }
.tf-auth-panel__brand { margin-bottom: 2rem; }
.tf-auth-panel__kicker { display: flex; align-items: center; gap: 0.85rem; margin: 0 0 1rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: #ffffff; }
.tf-auth-panel__kicker::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--tf-green); }
.tf-auth .tf-auth-panel__title { font-family: var(--tf-font); font-size: clamp(1.8rem, 1rem + 2.6vw, 3rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.015em; color: #ffffff; margin: 0 0 1rem; }
.tf-auth-panel__title span { display: block; color: var(--tf-blue-on-dark); }
.tf-auth-panel__lead { color: rgba(255, 255, 255, 0.85); font-size: 1.02rem; max-width: 460px; margin: 0 0 1.25rem; }
.tf-auth-panel__visual img { display: block; width: 100%; max-width: 520px; height: auto; animation: tf-auth-float 6s ease-in-out infinite alternate; }
@keyframes tf-auth-float { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.tf-auth-panel__benefits { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 1rem; }
@media (min-width: 576px) { .tf-auth-panel__benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; } .tf-auth-panel__benefits li + li { border-left: 1px solid rgba(255, 255, 255, 0.18); padding-left: 0.9rem; } .tf-auth-panel__benefits li { padding-right: 0.6rem; } }
.tf-auth-panel__benefits li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.82rem; line-height: 1.35; color: rgba(255, 255, 255, 0.78); }
.tf-auth-panel__benefits li > span { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--tf-blue-on-dark); color: var(--tf-blue-on-dark); }
.tf-auth-panel__benefits strong { display: block; color: #ffffff; font-size: 0.92rem; }
.tf-auth .tf-auth-panel__track { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; color: #ffffff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tf-auth .tf-auth-panel__track:hover { color: var(--tf-blue-on-dark); }
@media (prefers-reduced-motion: reduce) { .tf-auth-panel__visual img { animation: none; } }

@media (min-width: 992px) {
  .tf-auth__shell:not(.tf-auth__shell--single):not(.tf-auth__shell--doc) {
    max-width: none; min-height: 100vh; padding: 0; gap: 0; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: stretch;
  }
  .tf-auth__shell:not(.tf-auth__shell--single):not(.tf-auth__shell--doc) .tf-auth__aside { order: -1; border-radius: 0; padding: 3rem clamp(2rem, 4vw, 5rem) 6rem; display: flex; align-items: center; }
  .tf-auth__shell:not(.tf-auth__shell--single):not(.tf-auth__shell--doc) .tf-auth__card { align-self: center; justify-self: center; width: min(100% - 4rem, 520px); margin: 2.5rem 0; padding: 2.5rem; box-shadow: 0 18px 50px rgba(14, 29, 52, 0.1); }
  .tf-auth__shell:not(.tf-auth__shell--single):not(.tf-auth__shell--doc) .tf-auth__card > .tf-auth__brand { display: none; }
}
@media (max-width: 991.98px) {
  .tf-auth__aside { order: 2; }
  .tf-auth__shell:not(.tf-auth__shell--doc) { max-width: 560px; }
}
.tf-auth__footer { text-align: center; font-size: 0.85rem; color: var(--tf-muted); padding: 1rem 1rem 2rem; }
.tf-auth__footer a { color: var(--tf-muted); margin: 0 0.5rem; }

/* Pages légales */
.tf-doc h2 { font-family: var(--tf-font-title); font-size: 1.1rem; color: var(--tf-ink); margin-top: 1.5rem; }
.tf-doc p, .tf-doc li { line-height: 1.6; }
.tf-doc__meta { color: var(--tf-muted); font-size: 0.88rem; }
