/* =============================================================================
 * moncompte.css — module plein écran « Mon compte » (MONCOMPTE2 2026-06-15)
 * -----------------------------------------------------------------------------
 * Reconstruction FONCTIONNELLE. L'ancien build (moncompte_20260614) était FIGÉ
 * (« comme une image », ni scroll ni clic accessible plus bas).
 *
 * CAUSE EXACTE DU GEL (prouvée en repro CDP sur le live) :
 *   `.opmc-body` était `display:flex; flex-direction:column` ET `overflow-y:auto`.
 *   Dans un conteneur flex-column scrollable, les enfants gardent leur
 *   `flex-shrink:1` par défaut → les 5 cartes étaient COMPRESSÉES pour tenir dans
 *   la hauteur (clientHeight === scrollHeight === 772) au lieu de DÉBORDER.
 *   Résultat : `scrollTop` ne pouvait pas bouger (rien à scroller) ET chaque
 *   carte (`overflow:hidden`) ROGNAIT son contenu compressé (inputs coupés en
 *   plein milieu, visible sur la capture). L'écran paraissait « gelé ».
 *
 * CORRECTION : le corps scrollable est un BLOC normal (PAS display:flex), comme
 *   `.oprch-body` du module Recherche (référence qui fonctionne en prod). Les
 *   cartes s'empilent en flux bloc, gardent leur hauteur naturelle, le contenu
 *   DÉBORDE → `overflow-y:auto` peut réellement scroller. Ceinture + bretelles :
 *   `.opmc-card { flex: 0 0 auto }` au cas où un flux flex serait réintroduit.
 *
 * Module à part entière (pas un sous-panneau du drawer). Gabarit : position:fixed;
 * inset:0 ; en-tête + corps scrollable + retour ‹ (OPNav). Charte slate neutre
 * (le compte n'est pas une mission → pas de couleur de mission). ⓘ pour le
 * « pourquoi », zéro phrase posée. z-index AU-DESSUS du drawer (9999) → jamais
 * d'overlay résiduel qui capte les clics.
 * =========================================================================== */
#opmc {
  position: fixed; inset: 0; z-index: 10000;   /* > #drawer-navigation (9999) : aucun overlay résiduel ne capte les events */
  background: #f1f5f9;
  font-family: inherit;
}
#opmc[hidden] { display: none; }

.opmc-wrap {
  display: flex; flex-direction: column;
  height: 100%; height: 100dvh;               /* 100dvh : barre URL mobile -> hauteur réelle */
  min-height: 0;
}

/* ── en-tête (collant, ne scrolle pas) ── */
.opmc-head {
  flex: 0 0 auto; position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: #0f172a; color: #fff;
}
.opmc-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: #334155;
}
.opmc-back {
  width: 44px; height: 44px; flex: 0 0 auto;
  border: 0; border-radius: 13px; background: rgba(255,255,255,.12); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.opmc-back:hover { background: rgba(255,255,255,.2); }
.opmc-back:active { transform: scale(.94); }
.opmc-ttl-zone { flex: 1 1 auto; min-width: 0; }
.opmc-ttl { font-size: 19px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; }
.opmc-sub { font-size: 12px; color: #cbd5e1; margin-top: 2px; }

/* ── corps SCROLLABLE — BLOC normal (PAS display:flex : c'était la cause du gel) ── */
.opmc-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;          /* inertie iOS */
  overscroll-behavior: contain;               /* le scroll ne fuit pas vers la carte derrière */
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

/* ── carte de section ── */
.opmc-card {
  flex: 0 0 auto;                             /* bretelles : ne JAMAIS compresser si un flux flex revenait */
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  overflow: hidden;
  margin-bottom: 14px;                        /* espacement en flux bloc (remplace gap du flex) */
}
.opmc-card:last-child { margin-bottom: 0; }
.opmc-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.opmc-card-ico {
  width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 10px; background: #f1f5f9; color: #334155;
  display: flex; align-items: center; justify-content: center;
}
.opmc-card-ico svg { width: 19px; height: 19px; }
.opmc-card-ttl { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.opmc-card-body { padding: 0 16px 16px; }

/* ── ⓘ (le « pourquoi ») ── */
.opmc-i {
  width: 20px; height: 20px; flex: 0 0 auto;
  border-radius: 50%; border: 1.5px solid #cbd5e1; background: #fff;
  color: #64748b; font-size: 12px; font-style: italic; font-weight: 700;
  line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.opmc-i:hover { border-color: #94a3b8; color: #334155; }

/* ── champs ── */
.opmc-field { margin-bottom: 12px; }
.opmc-field:last-child { margin-bottom: 0; }
.opmc-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px;
}
.opmc-input {
  width: 100%; box-sizing: border-box;
  padding: 11px 12px; border: 1.5px solid #e2e8f0; border-radius: 11px;
  font-size: 16px; color: #0f172a; background: #fff;   /* 16px : pas de zoom auto iOS au focus */
}
.opmc-input:focus { outline: none; border-color: #94a3b8; }

/* ── logo ── */
.opmc-logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.opmc-logo-preview {
  width: 64px; height: 64px; flex: 0 0 auto;
  border-radius: 13px; object-fit: contain; background: #f8fafc; border: 1px solid #e2e8f0;
}
.opmc-logo-empty {
  width: 64px; height: 64px; flex: 0 0 auto;
  border-radius: 13px; background: #f1f5f9; border: 1px dashed #cbd5e1;
  display: flex; align-items: center; justify-content: center; color: #94a3b8;
}
.opmc-logo-empty svg { width: 26px; height: 26px; }
.opmc-logo-actions { display: flex; flex-direction: column; gap: 6px; }

/* ── boutons ── */
.opmc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1.5px solid transparent;
  box-sizing: border-box; -webkit-tap-highlight-color: transparent;
}
.opmc-btn--pri { background: #0f172a; color: #fff; }
.opmc-btn--pri:hover { background: #1e293b; }
.opmc-btn--ghost { background: #fff; color: #334155; border-color: #e2e8f0; }
.opmc-btn--ghost:hover { border-color: #cbd5e1; }
.opmc-btn--full { width: 100%; }
.opmc-btn:active { transform: scale(.985); }
.opmc-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.opmc-btn svg { width: 16px; height: 16px; }

/* ── pastille état « à activer » ── */
.opmc-soon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
}
.opmc-soon .dot { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; }

/* ── secteur / communes (chips) ── */
.opmc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.opmc-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid #e2e8f0; background: #fff;
  font-size: 13px; font-weight: 600; color: #0f172a;
}
.opmc-chip .cdot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.opmc-chips-empty { font-size: 13px; color: #94a3b8; margin-bottom: 12px; }
.opmc-chips-empty[hidden] { display: none; }

/* ── formules d'abonnement ── */
.opmc-plans { display: flex; flex-direction: column; gap: 9px; }
.opmc-plan {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border: 1.5px solid #e2e8f0; border-radius: 13px;
  background: #fff; cursor: pointer; text-align: left; width: 100%;
  box-sizing: border-box; -webkit-tap-highlight-color: transparent;
}
.opmc-plan:hover { border-color: #cbd5e1; }
.opmc-plan:active { transform: scale(.995); }
.opmc-plan[aria-pressed="true"] { border-color: #0f172a; background: #f8fafc; }
.opmc-plan .radio {
  width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid #cbd5e1; position: relative;
}
.opmc-plan[aria-pressed="true"] .radio { border-color: #0f172a; }
.opmc-plan[aria-pressed="true"] .radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #0f172a;
}
.opmc-plan .ptx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.opmc-plan .pname { display: block; font-size: 14px; font-weight: 700; color: #0f172a; }
.opmc-plan .pmeta { display: block; font-size: 12px; color: #64748b; margin-top: 1px; }
.opmc-plan .pprice { font-size: 13px; font-weight: 700; color: #334155; white-space: nowrap; }

/* ── factures (vide honnête) ── */
.opmc-empty {
  text-align: center; padding: 22px 12px; color: #94a3b8;
}
.opmc-empty svg { width: 32px; height: 32px; margin-bottom: 8px; color: #cbd5e1; }
.opmc-empty .t { font-size: 13px; font-weight: 600; color: #64748b; }

/* ── popover ⓘ ── */
#opmc-info {
  position: fixed; z-index: 10100; max-width: 280px;
  background: #0f172a; color: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 8px 30px rgba(15,23,42,.3);
}
#opmc-info[hidden] { display: none; }
#opmc-info::after {
  content: ""; position: absolute; bottom: -6px; left: 16px;
  border: 6px solid transparent; border-top-color: #0f172a; border-bottom: 0;
}

/* ── toast ── */
#opmc-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 10200; background: #0f172a; color: #fff;
  padding: 11px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(15,23,42,.3);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#opmc-toast.show { opacity: 1; }

/* ── desktop : centrer le contenu, fond aéré ── */
@media (min-width: 720px) {
  .opmc-body { display: flex; flex-direction: column; align-items: center; }
  /* NB : en desktop le body PEUT être flex (centrage horizontal) SANS geler le
     scroll, car les cartes gardent flex:0 0 auto (pas de compression verticale)
     et le débordement vertical reste géré par overflow-y:auto. */
  .opmc-card { width: 100%; max-width: 640px; }
  .opmc-head { padding-left: 24px; padding-right: 24px; }
}
