/* ============================================================
 * Modale connexion / inscription — parcours « email d'abord »
 * Charte : bleu #1B77B5, orange #f5a623 (cohérent formulaires livre blanc).
 * ============================================================ */

.mcm-acct-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 32, 0.55); /* voile sombre neutre */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mcm-acct-overlay[hidden] { display: none; }

.mcm-acct-modal {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  padding: 38px 30px 30px;
  box-sizing: border-box;
  /* Décale la modale au-dessus du centre vertical (le centrage reste adaptatif). */
  margin-bottom: 20vh;
  animation: mcm-acct-pop 0.18s ease-out;
}
@keyframes mcm-acct-pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.mcm-acct-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #9aa3ad;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}
.mcm-acct-close:hover { color: #5b6570; }

/* --- Étapes --- */
.mcm-acct-step[hidden] { display: none; }

.mcm-acct-title {
  margin: 0 0 8px !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  color: #1f2937 !important;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.mcm-acct-sub {
  margin: 0 auto 22px;
  max-width: 320px;
  font-size: 17px;
  line-height: 1.2em;
  color: #6b7280;
  text-align: center;
}

/* --- Formulaire / champs --- */
.mcm-acct-form { margin: 0; }

.mcm-acct-field {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #cfd6dd;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.mcm-acct-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 13px 18px !important;
  font-size: 15px;
  color: #333;
  height: auto !important;
}
.mcm-acct-field input::placeholder { color: #9aa3ad; opacity: 1; }
.mcm-acct-field input:focus { outline: none; box-shadow: none !important; }
.mcm-acct-field:focus-within { border-color: #6cb8d2; box-shadow: 0 0 0 3px rgba(108, 184, 210, 0.18); }

/* Œil « afficher / masquer le mot de passe » (injecté en JS dans les champs mot de passe). */
.mcm-acct-eye {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: #9aa3ad;
  transition: color 0.15s;
}
.mcm-acct-eye:hover { color: #5b6570; }
.mcm-acct-eye svg { width: 20px; height: 20px; display: block; }
.mcm-acct-eye .mcm-acct-eye-off { display: none; }
.mcm-acct-eye.is-visible .mcm-acct-eye-on { display: none; }
.mcm-acct-eye.is-visible .mcm-acct-eye-off { display: block; }

/* Champ avec bouton flèche (email / mot de passe) */
.mcm-acct-field--btn { padding-right: 0; }
.mcm-acct-arrow {
  flex: 0 0 auto;
  align-self: stretch;   /* remplit toute la hauteur du champ (colle en haut ET en bas) */
  aspect-ratio: 1 / 1;   /* reste un cercle -> remplit le « cap » arrondi droit de la pilule */
  width: auto;
  height: auto;
  min-width: 40px;       /* repli si aspect-ratio non supporté */
  border: 0;
  border-radius: 50%;
  background: #f5a623;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}
.mcm-acct-arrow:hover { background: #e0991c; }
.mcm-acct-arrow span {
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: translateX(-1px) rotate(45deg);
}
.mcm-acct-arrow.is-loading { pointer-events: none; }
.mcm-acct-arrow.is-loading span {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  transform: none;
  animation: mcm-acct-spin 0.7s linear infinite;
}
@keyframes mcm-acct-spin { to { transform: rotate(360deg); } }

/* Bouton plein « SUIVANT » */
.mcm-acct-next {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: #f5a623;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s;
}
.mcm-acct-next:hover { background: #e0991c; }
.mcm-acct-next.is-loading { opacity: 0.7; pointer-events: none; }

/* --- Messages --- */
.mcm-acct-msg {
  margin: 2px 0 12px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.35;
}
.mcm-acct-msg[hidden] { display: none; }
.mcm-acct-msg.is-error { background: #fdeeee; color: #d0453b; }
.mcm-acct-msg.is-info  { background: #eef5fb; color: #1B77B5; }

/* --- Liens (oublié / changer d'email / retour) --- */
.mcm-acct-links {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.mcm-acct-links a {
  font-size: 13px;
  color: #1B77B5;
  text-decoration: none;
}
.mcm-acct-links a:hover { text-decoration: underline; }

/* Séparateur « ou » + connexion sociale (Google) */
.mcm-acct-or {
  display: flex;
  align-items: center;
  margin: 16px 0 14px;
  color: #9aa3ad;
  font-size: 12px;
}
.mcm-acct-or::before,
.mcm-acct-or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: #e5e7eb;
}
.mcm-acct-or span { padding: 0 12px; }
.mcm-acct-social { display: flex; justify-content: center; overflow: visible; padding: 0 2px; }
.mcm-acct-social > div { margin: 0 auto !important; max-width: 100%; overflow: visible; }
#mcm-acct-google-btn { display: inline-flex; justify-content: center; overflow: visible; }
/* Le thème applique un margin négatif global aux iframe (margin:-2px -10px) → le -10px
   à droite rogne le bouton Google. On le neutralise pour cet iframe précis. */
#mcm-acct-google-btn iframe { margin: 0 !important; }
.mcm-acct-social-msg { margin-top: 10px; text-align: center; }

/* Empêche le scroll du fond quand la modale est ouverte */
body.mcm-acct-open { overflow: hidden; }

/* ============================================================
 * Onboarding (profil / newsletters / niveau)
 * ============================================================ */
.mcm-acct-checks { margin: 4px 0 18px; text-align: left; }
.mcm-acct-check {
  display: flex !important;
  align-items: center;           /* centre la case + le label dans la hauteur de l'encadré */
  margin: 0 0 10px !important;
  padding: 11px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14.5px;
  line-height: 1.3 !important;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mcm-acct-check:hover { border-color: #cfd6dd; }
/* Case personnalisée (rendu identique tous navigateurs, alignée au centre). */
.mcm-acct-check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block !important;
  flex: 0 0 auto;
  width: 20px !important;
  height: 20px !important;
  margin: 0 8px 0 0 !important;
  padding: 0;
  border: 2px solid #cfd6dd;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.mcm-acct-check input[type="checkbox"]:checked {
  border-color: #1B77B5;
  background: #1B77B5;
}
.mcm-acct-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.mcm-acct-check span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
  margin: 0;
  padding: 0;
  /* Le thème positionne les <span> avec un top → décale le texte / la case. On l'annule. */
  position: relative;
  top: 0 !important;
}
.mcm-acct-check:has(input:checked) { border-color: #6cb8d2; background: #f2f9fc; }

/* Cases newsletter « Je m'abonne… » : plus grosses, seul « Je m'abonne » en gras. */
.mcm-acct-check--nl { font-size: 16px; font-weight: 400; margin-bottom: 2px !important; }
.mcm-acct-check--nl strong { font-weight: 700; }
.mcm-acct-check--nl:has(input:checked) { border-color: #6cb8d2; }

/* Cases d'opt-out (« Je ne veux pas… » / « Ne plus me demander ») : sans encadré. */
.mcm-acct-check.mcm-acct-dismiss {
  border: 0 !important;
  background: none !important;
  padding: 6px 2px;
  font-size: 13.5px;
  color: #6b7280;
}

/* Crédit sous le sous-titre newsletter. */
.mcm-acct-credit {
  margin: -14px auto 18px;
  max-width: 340px;
  font-size: 13px;
  font-style: italic;
  color: #f5a623;
  text-align: center;
}

/* Grille des niveaux (enseignants / pros) */
.mcm-acct-checks--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mcm-acct-checks--grid .mcm-acct-check {
  margin: 0; padding: 8px 10px; font-size: 13px; gap: 7px;
}

/* Enfants (parents) */
.mcm-acct-enfants { margin: 4px 0 8px; }
.mcm-acct-enfant {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mcm-acct-enfant .mcm-acct-dob { flex: 1.3 1 0 !important; } /* la date a besoin d'un peu plus de place */
.mcm-acct-enfant input,
.mcm-acct-enfant select {
  flex: 1 1 0;
  min-width: 0;
  height: 40px !important;
  min-height: 0 !important;
  padding: 0 10px !important;
  border: 1px solid #cfd6dd !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  line-height: normal !important;
  color: #333 !important;
  background-color: #fff !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  vertical-align: middle;
}
.mcm-acct-del-enfant {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border: 0; border-radius: 50%;
  background: #f3f4f6; color: #9aa3ad;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.mcm-acct-del-enfant:hover { background: #fde8e8; color: #c0392b; }
.mcm-acct-add-enfant {
  display: inline-block;
  margin: 2px 0 16px;
  border: 0; background: none;
  color: #1B77B5; font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 0;
}
.mcm-acct-add-enfant:hover { text-decoration: underline; }

.mcm-acct-fine {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #f5a623; /* orange (comme la maquette) */
  text-align: center;
}

/* Étape newsletters : cases simples (sans encadré ni surlignage), comme la maquette. */
form[data-form="newsletters"] .mcm-acct-check {
  border: 0 !important;
  background: none !important;
  padding: 5px 2px;
  margin: 0 0 6px;
}

@media (max-width: 480px) {
  .mcm-acct-modal { padding: 34px 20px 24px; border-radius: 14px; }
  .mcm-acct-title { font-size: 19px !important; }
  .mcm-acct-checks--grid { grid-template-columns: repeat(2, 1fr); }
}
