.auth-shell {
  --ink-950: #ffffff;
  --ink-900: #f3f4f6;
  --ink-800: #e5e7eb;
  --ink-700: #24365c;
  --paper-0: #ffffff;
  --paper-50: #f5f6f9;
  --line-200: #e3e6ee;
  --line-300: #d3d7e3;
  --text-900: #10152a;
  --text-600: #545b73;
  --text-400: #8790a8;
  --brass-500: #3b82f6;
  --brass-600: #2563eb;
  --brass-050: #eff6ff;
  --success-600: #157a53;
  --success-050: #e7f5ee;
  --danger-600: #b3372a;
  --danger-050: #fbebe9;
  --warning-600: #9a6b0f;
  --warning-050: #fbf1de;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 30px 60px -20px rgba(10, 17, 32, 0.28), 0 4px 14px rgba(10, 17, 32, 0.06);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-900);
  background: var(--paper-50);
  padding: 72px 20px;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.auth-shell * { box-sizing: border-box; }

.auth-shell h1,
.auth-shell h2,
.auth-shell h3 {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.01em;
}

/* ---------- Card shell ---------- */

.auth-card {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background: var(--paper-0);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line-200);
}

/* ---------- Brand / trust panel (left) ---------- */

.auth-brand {
  flex: 0 0 40%;
  position: relative;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--ink-800) 0%, var(--ink-950) 60%);
  color: var(--text-900);
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth-brand__pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}

/* Le canvas d'étoiles gère déjà sa propre intensité (alpha par étoile) ;
   on ne double pas l'atténuation avec l'opacité CSS utilisée pour l'ancien SVG. */
.auth-brand__pattern--stars {
  opacity: 1;
  pointer-events: auto; /* léger effet de répulsion des étoiles au survol de la souris */
}

.auth-brand__top,
.auth-brand__mid,
.auth-brand__bottom {
  position: relative;
  z-index: 1;
}

.auth-brand__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 10px;
  margin-bottom: 44px;
}

.auth-brand__logo img {
  height: 46px;
  width: auto;
  max-width: 240px;
  display: block;
  object-fit: contain;
}

.auth-brand__logo a {
  display: inline-flex;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.auth-brand__logo a:hover {
  opacity: 0.85;
}

.auth-brand__logo-text {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-900);
}

.auth-brand__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-500);
  margin-bottom: 18px;
}

.auth-brand__title {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-900);
  margin: 0 0 16px;
}

@media (min-width: 901px) {
  .auth-brand__title--compact {
    font-size: 25px;
    letter-spacing: -0.02em;
  }
}

.auth-brand__subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-600);
  margin: 0 0 36px;
  max-width: 34ch;
}

.auth-trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-900);
}

.auth-trust-list .icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-trust-list .icon svg {
  width: 17px;
  height: 17px;
  stroke: var(--brass-500);
}

.auth-trust-list strong {
  display: block;
  color: var(--text-900);
  font-weight: 600;
  margin-bottom: 2px;
}

.auth-brand__bottom {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: var(--text-400);
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-brand__bottom svg {
  width: 14px;
  height: 14px;
  stroke: rgba(255, 255, 255, 0.5);
  flex: 0 0 auto;
}

/* ---------- Form panel (right) ---------- */

.auth-form-panel {
  position: relative;
  flex: 1 1 auto;
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* Bouton clair / sombre : mappé sur la palette locale de .auth-shell pour
   s'afficher correctement même sans admin-design.css (pages hors dashboard). */
.auth-shell .theme-toggle-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  border: 1px solid var(--line-200);
  background: var(--paper-0);
  color: var(--text-900);
}
.auth-shell .theme-toggle-btn:hover { border-color: var(--brass-500); color: var(--brass-600); }

/* Séparateur entre le panneau de marque et le formulaire : une ligne fine
   qui s'estompe en haut et en bas, ponctuée d'un point d'accent bleu au
   centre — plus soigné qu'un simple trait plein. */
.auth-form-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--line-300) 14%,
    var(--line-300) 86%,
    transparent 100%
  );
}

.auth-form-panel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass-500);
  box-shadow: 0 0 0 5px var(--paper-0), 0 0 14px rgba(59, 130, 246, 0.45);
  transform: translate(-50%, -50%);
}

.auth-form-head {
  margin-bottom: 30px;
}

.auth-form-head__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass-600);
  margin-bottom: 10px;
  display: block;
}

.auth-form-head h1 {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-900);
  margin: 0 0 8px;
}

.auth-form-head p {
  font-size: 14px;
  color: var(--text-600);
  margin: 0;
}

.auth-form-head p a {
  color: var(--brass-600);
  font-weight: 600;
  text-decoration: none;
}

.auth-form-head p a:hover { text-decoration: underline; }

/* ---------- Fields ---------- */

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-900);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap .field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: var(--text-400);
  pointer-events: none;
  z-index: 1;
}

.auth-shell input.auth-input,
.auth-shell select.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-900);
  background: var(--paper-0);
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.auth-shell select.auth-input {
  padding-right: 38px;
  cursor: pointer;
}

/* ---------- Téléphone avec indicatif automatique ---------- */

.auth-input-wrap--phone .auth-input--phone {
  padding-left: 96px;
}

.auth-input-wrap--phone .auth-input--phone:disabled {
  background: var(--paper-50, #f7f6f3);
  cursor: not-allowed;
}

.auth-phone-dialcode {
  position: absolute;
  left: 38px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 10px 0 8px;
  border-right: 1px solid var(--line-300);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-900);
  z-index: 1;
  pointer-events: none;
  white-space: nowrap;
}

.auth-phone-dialcode.is-empty {
  color: var(--text-400);
  font-weight: 500;
}

.auth-select-wrap .chevron-icon {
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  stroke: var(--text-400);
  pointer-events: none;
}

.auth-shell input.auth-input::placeholder { color: var(--text-400); }

.auth-shell input.auth-input:focus,
.auth-shell select.auth-input:focus {
  border-color: var(--brass-500);
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.16);
}

.auth-password-toggle {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  z-index: 1;
}

.auth-password-toggle:hover { background: var(--paper-50); }

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-400);
}

.auth-password-toggle .icon-eye-off { display: none; }

.auth-password-toggle.is-visible .icon-eye { display: none; }
.auth-password-toggle.is-visible .icon-eye-off { display: block; }
.auth-password-toggle.is-visible svg { stroke: var(--brass-500); }

.auth-field-hint {
  font-size: 12px;
  color: var(--text-400);
  margin-top: 6px;
}

/* ---------- Field-level errors ---------- */

.auth-field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--danger-600);
  margin-top: 7px;
  font-weight: 500;
}

.auth-field-error svg {
  width: 14px;
  height: 14px;
  stroke: var(--danger-600);
  flex: 0 0 auto;
}

.auth-shell .has-error input.auth-input,
.auth-shell .has-error select.auth-input {
  border-color: var(--danger-600);
}

/* ---------- Row: remember / forgot ---------- */

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 26px;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-600);
  cursor: pointer;
  user-select: none;
}

.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ink-900);
  cursor: pointer;
  margin: 0;
}

.auth-link {
  font-size: 13.5px;
  color: var(--brass-600);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

/* ---------- Ligne "Mot de passe oublié" (alignée à droite, y compris mobile) ---------- */

.auth-row-end {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 26px;
}

/* ---------- Recaptcha spacing ---------- */

.auth-recaptcha { margin: 4px 0 22px; }

/* ---------- Bouton "Continuer avec Google" ---------- */

.auth-social-btn {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  background: var(--paper-0);
  color: var(--text-900);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.auth-social-btn:hover { background: var(--paper-50); border-color: var(--text-400); }
.auth-social-btn:active { transform: translateY(1px); }
.auth-social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Separateur "Ou" entre Google et le formulaire ---------- */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--text-400);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-200);
}

/* ---------- Submit button ---------- */

.auth-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background 0.15s ease, transform 0.05s ease;
}

.auth-submit svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
  transition: transform 0.15s ease;
}

.auth-submit:hover { background: #2563eb; }
.auth-submit:hover svg { transform: translateX(2px); }
.auth-submit:active { transform: translateY(1px); }

/* ---------- Footer note under the form ---------- */

.auth-form-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-600);
}

.auth-form-footer a {
  color: var(--brass-600);
  font-weight: 600;
  text-decoration: none;
}

.auth-form-footer a:hover { text-decoration: underline; }

.auth-legal-note {
  margin-top: 18px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-400);
}

.auth-legal-note a { color: var(--text-600); text-decoration: underline; }

/* ---------- Alerts ---------- */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1px solid transparent;
  position: relative;
}

.auth-alert svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.auth-alert strong { font-weight: 700; margin-right: 4px; }

.auth-alert--success {
  background: var(--success-050);
  border-color: rgba(21, 122, 83, 0.25);
  color: var(--success-600);
}
.auth-alert--success svg { stroke: var(--success-600); }

.auth-alert--danger {
  background: var(--danger-050);
  border-color: rgba(179, 55, 42, 0.25);
  color: var(--danger-600);
}
.auth-alert--danger svg { stroke: var(--danger-600); }

.auth-alert--warning {
  background: var(--warning-050);
  border-color: rgba(154, 107, 15, 0.25);
  color: var(--warning-600);
}
.auth-alert--warning svg { stroke: var(--warning-600); }

.auth-alert--info {
  background: var(--brass-050);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--brass-600);
}
.auth-alert--info svg { stroke: var(--brass-600); }

.auth-alert__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  opacity: 0.6;
}

.auth-alert__close:hover { opacity: 1; background: rgba(0,0,0,0.05); }

.auth-alert__close svg { width: 13px; height: 13px; margin: 0; stroke: currentColor; }

.auth-alert-list { margin-bottom: 4px; }

/* ==========================================================================
   Sélecteur de langue (FR/EN) — pages de connexion / inscription / mot de passe
   ========================================================================== */
.auth-lang-switch {
  --paper-0: #ffffff;
  --paper-50: #f5f6f9;
  --line-200: #e3e6ee;
  --text-900: #10152a;
  --text-600: #545b73;
  --brass-500: #3b82f6;
  --brass-600: #2563eb;
  --brass-050: #eff6ff;
  --radius-md: 12px;
  --shadow-card: 0 30px 60px -20px rgba(10, 17, 32, 0.28), 0 4px 14px rgba(10, 17, 32, 0.06);

  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 60;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-lang-switch .lang-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid var(--line-200);
  background: var(--paper-0);
  color: var(--text-900);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.auth-lang-switch .lang-switch-btn:hover { border-color: var(--brass-500); color: var(--brass-600); }
.auth-lang-switch .lang-switch-btn:active { transform: translateY(1px); }

.auth-lang-switch .lang-switch-globe { width: 15px; height: 15px; color: var(--text-600); flex-shrink: 0; }
.auth-lang-switch .lang-switch-code { min-width: 18px; text-align: center; }

.auth-lang-switch .lang-switch-chevron { color: var(--text-600); transition: transform 0.2s ease, color 0.2s ease; }
.auth-lang-switch.open .lang-switch-chevron { transform: rotate(180deg); color: var(--brass-600); }

.auth-lang-switch .lang-switch-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 170px;
  background: var(--paper-0);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 6px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.auth-lang-switch.open .lang-switch-menu { display: block; animation: authLangSwitchIn 0.18s ease; }

@keyframes authLangSwitchIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-lang-switch .lang-switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-900);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.auth-lang-switch .lang-switch-item:hover { background-color: var(--paper-50); }
.auth-lang-switch .lang-switch-item.is-active { color: var(--brass-600); background-color: var(--brass-050); }

.auth-lang-switch .lang-switch-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--brass-500), var(--brass-600));
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

html[data-theme="dark"] .auth-lang-switch {
  --paper-0: #182338;
  --paper-50: #141e33;
  --line-200: #232d42;
  --text-900: #e8ecf4;
  --text-600: #a9b2c6;
  --brass-050: rgba(79, 140, 255, 0.14);
}

@media (max-width: 640px) {
  .auth-lang-switch { top: 14px; right: 14px; }
  .auth-lang-switch .lang-switch-btn { padding: 0 10px; height: 34px; }
  .auth-lang-switch .lang-switch-code { display: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .auth-shell { padding: 36px 14px; }

  .auth-card { flex-direction: column; border-radius: 18px; }

  .auth-brand {
    flex: none;
    padding: 34px 28px;
  }

  .auth-brand__subtitle { max-width: none; }

  .auth-trust-list { display: none; }

  .auth-brand__bottom { margin-top: 24px; padding-top: 16px; }

  .auth-form-panel { padding: 34px 26px 40px; }

  .auth-form-panel::before {
    top: 0;
    left: 14%;
    right: 14%;
    bottom: auto;
    width: auto;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      var(--line-300) 14%,
      var(--line-300) 86%,
      transparent 100%
    );
  }

  .auth-form-panel::after {
    top: 0;
    left: 50%;
  }

  .auth-field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 480px) {
  .auth-brand__title { font-size: 24px; }
}

/* ---------- Téléphone : on allège le panneau de marque ----------
   On ne garde que le logo + le libellé (eyebrow), le reste (titre,
   texte descriptif, encadré "données chiffrées") est masqué pour
   ne pas surcharger l'écran. Le panneau blanc (formulaire) suit
   immédiatement. PC/tablette restent inchangés (règles ci-dessus). */
@media (max-width: 576px) {
  .auth-brand {
    padding: 26px 24px 22px;
  }

  .auth-brand__pattern { display: none; }

  .auth-brand__logo { margin-bottom: 16px; }

  .auth-brand__eyebrow { margin-bottom: 0; }

  .auth-brand__title,
  .auth-brand__subtitle,
  .auth-brand__mid,
  .auth-brand__bottom {
    display: none;
  }

  .auth-form-panel { padding: 30px 20px 34px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .auth-submit, .auth-submit svg { transition: none; }
}

/* ---------- Country select (custom, with flags) ---------- */

.auth-country-select {
  position: relative;
}

.auth-country-trigger {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 38px 0 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-900);
  background: var(--paper-0);
  border: 1px solid var(--line-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-country-trigger:hover { border-color: var(--line-300); }

.auth-country-select.is-open .auth-country-trigger,
.auth-country-trigger:focus-visible {
  border-color: var(--brass-500);
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.16);
  outline: none;
}

.auth-country-trigger .field-icon {
  position: static;
  width: 18px;
  height: 18px;
  stroke: var(--text-400);
  flex: 0 0 auto;
}

.auth-country-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(16, 21, 42, 0.08);
}

.auth-country-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-country-trigger.is-placeholder .auth-country-label { color: var(--text-400); }

.auth-country-trigger .chevron-icon {
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  stroke: var(--text-400);
  transition: transform 0.15s ease;
}

.auth-country-select.is-open .chevron-icon { transform: rotate(180deg); }

.auth-country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--paper-0);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 38px -12px rgba(10, 17, 32, 0.22), 0 4px 10px rgba(10, 17, 32, 0.06);
  overflow: hidden;
  max-height: min(340px, calc(100vh - 32px));
}

/* L'attribut [hidden] doit rester prioritaire sur le display:flex ci-dessus,
   sinon le menu reste visible en permanence (bug : le style du user-agent
   pour [hidden] a une priorité plus faible que n'importe quelle règle de
   nos propres feuilles de style, même à spécificité égale). */
.auth-country-dropdown[hidden] {
  display: none;
}

/* Basculé en position fixe + déplacé dans <body> en JS à l'ouverture, pour
   ne jamais être rogné par le "overflow: hidden" des cartes qui l'entourent
   (.auth-card, .admin-card...) : le menu reste donc toujours entièrement
   visible et se repositionne (haut/bas) selon la place disponible.
   Une fois déplacé dans <body>, l'élément sort de .auth-shell et ne peut
   plus hériter des variables CSS qui y sont définies (--paper-0, --line-200,
   etc.) : sans ce rappel local, elles tombent à "transparent/initial" et le
   menu devient invisible/transparent, laissant voir le contenu de la page
   par transparence. On les redéfinit donc ici pour ce cas précis. */
.auth-country-dropdown.is-portal {
  position: fixed;
  right: auto;
  z-index: 999999;
  --paper-0: #ffffff;
  --paper-50: #f5f6f9;
  --line-200: #e3e6ee;
  --line-300: #d3d7e3;
  --text-900: #10152a;
  --text-400: #8790a8;
  --brass-500: #3b82f6;
  --brass-050: #eff6ff;
  --radius-sm: 8px;
  --danger-600: #b3372a;
  background: #ffffff;
}

.auth-country-search {
  position: relative;
  flex: 0 0 auto;
  padding: 8px;
  border-bottom: 1px solid var(--line-200);
}

.auth-country-search svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--text-400);
  pointer-events: none;
}

.auth-country-search input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 32px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-900);
  background: var(--paper-50);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  outline: none;
}

.auth-country-search input:focus {
  border-color: var(--brass-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.auth-country-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.auth-country-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-900);
  cursor: pointer;
}

.auth-country-list li img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(16, 21, 42, 0.08);
}

.auth-country-list li:hover,
.auth-country-list li.is-active {
  background: var(--brass-050);
}

.auth-country-list li.is-active { font-weight: 600; }

.auth-country-list li.is-active::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--brass-500);
  flex: 0 0 auto;
}

.auth-country-empty {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--text-400);
  text-align: center;
}

.auth-country-list::-webkit-scrollbar { width: 8px; }
.auth-country-list::-webkit-scrollbar-thumb {
  background: var(--line-300);
  border-radius: 4px;
}

/* ---------- Mobile : anti-zoom automatique + cible tactile de l'œil ----------
   Safari iOS (et certains navigateurs Android) zooment automatiquement TOUTE
   la page quand un champ de saisie affiché avec un font-size inférieur à 16px
   reçoit le focus. C'est ce qui donnait l'impression que "la page s'agrandit"
   en cliquant sur le champ de recherche du menu déroulant Pays (register /
   admin/login) ou sur n'importe quel autre champ du formulaire de connexion /
   inscription : ces champs étaient tous en dessous de 16px. On les aligne donc
   sur 16px uniquement en dessous de 768px : l'apparence desktop (14.5px /
   13.5px déjà en place plus haut) ne change pas du tout. */
@media (max-width: 768px) {
  .auth-shell input.auth-input,
  .auth-shell select.auth-input,
  .auth-country-trigger,
  .auth-country-search input {
    font-size: 16px;
  }

  /* Le champ de recherche interne du menu Pays gagne un peu de hauteur pour
     rester confortable une fois son texte agrandi à 16px. */
  .auth-country-search input { height: 40px; }

  /* Icône "afficher / masquer le mot de passe" (register + login, même
     composant) : 34px/18px restait correct sur desktop mais trop petit pour
     être bien vu et touché du doigt sur téléphone. Agrandie uniquement ici. */
  .auth-password-toggle {
    width: 42px;
    height: 42px;
    right: 4px;
  }
  .auth-password-toggle svg {
    width: 22px;
    height: 22px;
  }
}

/* =========================================================================
   MODE SOMBRE — connexion / inscription / réinitialisation de mot de passe
   ========================================================================= */
html[data-theme="dark"] .auth-shell {
    --ink-950: #101a2e;
    --ink-900: #182338;
    --ink-800: #22314d;
    --ink-700: #2c3f66;

    --paper-0:  #182338;
    --paper-50: #141e33;

    --line-200: #232d42;
    --line-300: #2c3750;

    --text-900: #e8ecf4;
    --text-600: #a9b2c6;
    --text-400: #7c869c;

    --brass-050: rgba(79, 140, 255, 0.14);
    --success-600: #34d399;
    --success-050: rgba(52, 211, 153, 0.14);
    --danger-600: #f87171;
    --danger-050: rgba(248, 113, 113, 0.14);
    --warning-600: #fb923c;
    --warning-050: rgba(251, 146, 60, 0.14);

    background: var(--paper-50);
    color-scheme: dark;
}

/* Aucun cadre autour du logo : il reste transparent, posé directement
   sur le fond sombre du panneau. */
html[data-theme="dark"] .auth-brand__logo a {
    display: inline-flex;
    background: transparent;
}