/* ============================================================================
   FILE: /css/tiimbo-aerien.css
   Style "Aérien" (maquette : Design/04-aerien.html)
   Migration progressive : ce fichier n'est chargé que par les pages déjà
   migrées. Tous les styles de page sont limités à une classe sur <body>
   (ex. .ae-auth) pour ne jamais affecter les écrans non migrés.
   Étape 1 : pages de connexion (login.php, register.php,
   mot_de_passe_oublie.php).
   (L'accueil utilise désormais css/tiimbo-mixte.css.)
   ============================================================================ */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --ae-blue: #3F6FE4;
  --ae-blue-deep: #4A4FE0;
  --ae-blue-light: #5A8CFF;
  --ae-blue-50: #E6ECFB;
  --ae-blue-100: #D5DFFA;
  --ae-magenta: #B23BE0;
  --ae-ink: #3A3F52;
  --ae-ink-2: #5B6175;
  --ae-muted: #8E94A6;
  --ae-line: #EDEFF5;
  --ae-red: #E5484D;
  --ae-red-50: #FDECEC;
  --ae-green: #2FA34D;
  --ae-green-50: #DDF4E1;
  --ae-radius: 10px;
  --ae-shadow: 0 8px 24px -8px rgba(63, 111, 228, .22), 0 2px 6px rgba(63, 111, 228, .06);
  --ae-font: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── Pages d'authentification ───────────────────────────────────────────── */
body.ae-auth {
  font-family: var(--ae-font);
  background: #ECEEF3;
  color: var(--ae-ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.ae-auth .ae-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* En-tête coloré décoré (cercles, anneaux, hachures) */
.ae-auth .ae-hero {
  position: relative;
  overflow: hidden;
  background: var(--ae-blue);
  color: #fff;
  padding: 28px 28px 70px;
  min-height: 270px;
  flex: none;
}

.ae-auth .ae-hero > * { position: relative; z-index: 2; }
.ae-auth .ae-hero .ae-deco { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.ae-auth .ae-deco.c1 { width: 150px; height: 150px; left: 90px; top: -80px; background: var(--ae-blue-light); }
.ae-auth .ae-deco.c2 { width: 270px; height: 270px; right: -120px; top: -70px; background: var(--ae-blue-deep); }
.ae-auth .ae-deco.c3 { width: 110px; height: 110px; left: -50px; bottom: -10px; background: var(--ae-blue-deep); }
.ae-auth .ae-deco.r1 { width: 340px; height: 340px; left: -130px; top: -220px; border: 1.5px solid rgba(255, 255, 255, .3); }
.ae-auth .ae-deco.r2 { width: 240px; height: 240px; right: -130px; top: 30px; border: 1.5px solid rgba(255, 255, 255, .3); }
.ae-auth .ae-deco.h1 {
  width: 120px; height: 120px; right: 36px; bottom: 30px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 2px, transparent 2px 9px);
}

.ae-auth .ae-hero-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.ae-auth .ae-back {
  width: 40px; height: 40px;
  margin-left: -10px;
  display: grid; place-items: center;
  color: #fff; font-size: 24px;
  border-radius: 50%;
  text-decoration: none;
}
.ae-auth .ae-back:hover, .ae-auth .ae-back:focus { color: #fff; background: rgba(255, 255, 255, .12); }

.ae-auth .ae-hero h1 {
  font-family: var(--ae-font);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
  margin: 40px 0 6px;
}

.ae-auth .ae-hero p {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255, 255, 255, .92);
  margin: 0;
  max-width: 210px;
}

/* Feuille blanche qui recouvre l'en-tête */
.ae-auth .ae-sheet {
  position: relative;
  z-index: 3;
  flex: 1;
  margin-top: -40px;
  background: #fff;
  border-radius: 34px 34px 0 0;
  padding: 36px 24px 32px;
}

/* Vignette logo à cheval entre l'en-tête et la feuille */
.ae-auth .ae-badge {
  position: absolute;
  right: 26px;
  top: -54px;
  width: 106px;
  height: 106px;
  background: #fff;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px -6px rgba(63, 111, 228, .45), inset 0 0 0 1px var(--ae-blue-50);
  display: grid;
  place-items: center;
  padding: 18px 9px;
}
.ae-auth .ae-badge img { max-width: 100%; max-height: 100%; display: block; }

.ae-auth .ae-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--ae-ink);
  margin: 0 0 20px;
}

/* Champs */
.ae-auth .ae-field { margin-bottom: 16px; }

.ae-auth .ae-label {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--ae-blue);
  margin: 0 0 6px 2px;
}

.ae-auth .ae-input {
  position: relative;
  display: flex;
  align-items: center;
}

.ae-auth .ae-input > .ae-icon {
  position: absolute;
  left: 14px;
  font-size: 19px;
  color: var(--ae-blue);
  pointer-events: none;
  z-index: 2;
}

.ae-auth .ae-input .form-control {
  height: 50px;
  max-height: none; /* style.css impose max-height: 41px sur .form-control */
  width: 100%;
  border: 1.5px solid transparent;
  border-radius: var(--ae-radius);
  background: var(--ae-blue-50);
  padding: 0 46px 0 44px;
  font-family: var(--ae-font);
  font-size: 14px;
  font-weight: 400;
  color: var(--ae-ink);
  box-shadow: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.ae-auth .ae-input .form-control::placeholder { color: #8C9BC7; font-weight: 300; }

.ae-auth .ae-input .form-control:focus {
  background: #fff;
  border-color: var(--ae-blue);
  box-shadow: 0 0 0 4px rgba(63, 111, 228, .12);
  outline: none;
}

/* Bascule d'affichage du mot de passe (IDs conservés pour js/active.js) */
.ae-auth .ae-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  border-radius: 50%;
}
.ae-auth .ae-eye i { font-size: 19px; color: var(--ae-muted); }
.ae-auth .ae-eye:hover i { color: var(--ae-blue); }

.ae-auth .ae-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ae-auth .ae-row .form-control { padding-left: 16px; padding-right: 12px; }

/* Bouton principal */
.ae-auth .ae-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--ae-radius);
  background: var(--ae-blue);
  color: #fff;
  font-family: var(--ae-font);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 12px 24px -8px rgba(63, 111, 228, .6);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.ae-auth .ae-btn:hover { background: #3462D6; color: #fff; }
.ae-auth .ae-btn:active { transform: translateY(1px); box-shadow: 0 6px 14px -6px rgba(63, 111, 228, .6); }
.ae-auth .ae-btn i { font-size: 18px; }

/* Lien bas de page */
.ae-auth .ae-meta {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  font-weight: 300;
  color: var(--ae-muted);
}
.ae-auth .ae-meta a { color: var(--ae-blue); font-weight: 500; text-decoration: none; }
.ae-auth .ae-meta a:hover { text-decoration: underline; }

/* Lien "Mot de passe oublié ?" sous le champ */
.ae-auth .ae-forgot {
  display: block;
  text-align: right;
  margin: -6px 2px 18px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ae-blue);
  text-decoration: none;
}
.ae-auth .ae-forgot:hover { text-decoration: underline; color: var(--ae-blue); }

/* Texte d'aide */
.ae-auth .ae-hint {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ae-muted);
  margin: -10px 0 20px;
  max-width: 250px; /* laisse la place à la vignette logo */
}
.ae-auth .ae-hint b { font-weight: 500; color: var(--ae-ink); }

/* Barre de progression dans l'en-tête */
.ae-auth .ae-progress { margin-top: 22px; margin-right: 118px; } /* s'arrête avant la vignette logo */
.ae-auth .ae-progress small {
  display: block;
  font-size: 12px;
  font-weight: 300;
  margin-bottom: 8px;
  color: #fff;
}
.ae-auth .ae-progress div { height: 6px; border-radius: 6px; background: rgba(40, 40, 160, .5); overflow: hidden; }
.ae-auth .ae-progress div i { display: block; height: 100%; background: #fff; border-radius: 6px; transition: width .35s ease; }

/* Étapes d'un parcours */
.ae-auth .ae-step { display: none; }
.ae-auth .ae-step.is-active { display: block; animation: ae-step-in .3s ease; }
@keyframes ae-step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Saisie du code (OTP) */
.ae-auth .ae-otp { display: flex; gap: 12px; justify-content: space-between; }
.ae-auth .ae-otp .form-control {
  flex: 1;
  height: 60px;
  max-height: none;
  max-width: 70px;
  padding: 0;
  text-align: center;
  font-family: var(--ae-font);
  font-size: 24px;
  font-weight: 500;
  color: var(--ae-ink);
  background: var(--ae-blue-50);
  border: 1.5px solid transparent;
  border-radius: 12px;
  box-shadow: none;
}
.ae-auth .ae-otp .form-control:focus {
  background: #fff;
  border-color: var(--ae-blue);
  box-shadow: 0 0 0 4px rgba(63, 111, 228, .12);
  outline: none;
}
.ae-auth .ae-resend {
  margin: 16px 0 12px;
  font-size: 13px;
  font-weight: 300;
  color: var(--ae-muted);
  text-align: center;
}
.ae-auth .ae-resend b { font-weight: 500; color: var(--ae-blue); }
.ae-auth .ae-resend a { color: var(--ae-blue); font-weight: 500; text-decoration: none; }

/* Écran de succès */
.ae-auth .ae-done { text-align: center; padding-top: 26px; }
.ae-auth .ae-done .ae-hint { margin: 0 auto 24px; max-width: 280px; }
.ae-auth .ae-done-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--ae-green-50);
  color: var(--ae-green);
  display: grid;
  place-items: center;
  font-size: 40px;
}
.ae-auth a.ae-btn { text-decoration: none; }

/* Alertes */
.ae-auth .ae-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 0;
  border-radius: var(--ae-radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}
.ae-auth .ae-alert i { font-size: 18px; flex: none; }
.ae-auth .ae-alert.is-error { background: var(--ae-red-50); color: #B4282D; }
.ae-auth .ae-alert.is-success { background: var(--ae-green-50); color: #1F7A38; }
.ae-auth .ae-alert .btn-close { margin-left: auto; padding: 2px; font-size: 10px; opacity: .5; }

/* Grand écran : l'app reste présentée comme un téléphone centré */
@media (min-width: 520px) {
  body.ae-auth { padding: 32px 0; }
  .ae-auth .ae-shell {
    min-height: calc(100vh - 64px);
    border-radius: 36px;
    box-shadow: 0 30px 60px -24px rgba(40, 50, 90, .3);
  }
}

/* Petits écrans (hauteur) : on réduit l'en-tête */
@media (max-height: 640px) {
  .ae-auth .ae-hero { min-height: 220px; }
  .ae-auth .ae-hero h1 { margin-top: 20px; font-size: 26px; }
}


/* ── Thème Mixte : ruban uni, couleurs du thème choisi ──────────────────────
   Les variables --t-* viennent du thème mis en cache sur l'appareil
   (localStorage "tiimbo_theme_css") ; à défaut, le bleu Tiimbo par défaut. */
body.ae-auth {
  --ae-blue: var(--t-primary, #3F6FE4);
  --ae-blue-50: color-mix(in srgb, var(--ae-blue) 12%, #fff);
  --ae-blue-100: color-mix(in srgb, var(--ae-blue) 22%, #fff);
}
.ae-auth .ae-hero { background: var(--t-fill, var(--ae-blue)); color: var(--t-on-primary, #fff); }
.ae-auth .ae-hero .ae-deco { display: none; }
.ae-auth .ae-btn { background: var(--t-fill, var(--ae-blue)); }
.ae-auth .ae-badge { box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--ae-blue) 45%, transparent), inset 0 0 0 1px var(--ae-blue-50); }
/* Code à 6 chiffres */
.ae-auth .ae-otp { gap: 8px; }
.ae-auth .ae-otp .form-control { min-width: 0; height: 54px; font-size: 22px; }
.ae-auth .ae-btn[disabled] { opacity: .65; pointer-events: none; }

.ae-auth .ae-meta-alt { margin-top: 10px; }
.ae-auth .ae-meta-alt a { display: inline-flex; align-items: center; gap: 6px; }
