/* =============================================================================
   Morgan Wealth — lot Comptes (inscription, connexion, mot de passe oublié,
   vérification d'e-mail, Mon compte). Tokens du socle uniquement.
   Mobile d'abord (360 px) ; ruptures 48rem, 64rem, 80rem.

   Sommaire
   1. Pages d'authentification : section, grille, carte
   2. Champs : poignée mot de passe, piège à robots, mesure de robustesse, règles
   3. Cases, lignes, boutons, textes annexes
   4. Panneau de marque
   5. Messages globaux (flash), rappel de vérification, encart « Mode local »
   6. Mon compte : résumé, onglets, blocs, sessions, zone de suppression
   7. Mouvement réduit
   ========================================================================== */

/* =============================================================================
   1. Pages d'authentification
   ========================================================================== */
.mw-auth {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: var(--mw-s-5) var(--mw-s-7);
}
.mw-auth > .mw-grid-paper { z-index: -1; }
.mw-auth__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--mw-s-6);
  align-items: start;
}
.mw-auth__main { min-width: 0; }
.mw-auth__card {
  display: flex;
  flex-direction: column;
  gap: var(--mw-s-4);
  padding: var(--mw-s-5) var(--mw-s-4);
  border-radius: var(--mw-r-lg);
  border: 1px solid var(--mw-line);
  background: var(--mw-surface);
  box-shadow: var(--mw-highlight), var(--mw-shadow-1);
}
.mw-auth__title { max-width: none; font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem); }
.mw-auth__lead { color: var(--mw-text-2); line-height: 1.55; max-width: 52ch; }
.mw-auth__card .mw-eyebrow { align-self: flex-start; }
.mw-auth__card .mw-form { gap: var(--mw-s-4); }
.mw-auth__alt { display: grid; gap: var(--mw-s-3); }
.mw-auth__alt-line { text-align: center; color: var(--mw-text-2); font-size: var(--mw-fs-sm); line-height: 1.6; }
.mw-auth__alt-line .mw-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; font-weight: 600; }
.mw-auth__legal { color: var(--mw-text-3); font-size: var(--mw-fs-xs); line-height: 1.5; text-align: center; }
.mw-theme-light .mw-auth__legal { color: var(--mw-text-2); }
.mw-auth__risk { margin-top: var(--mw-s-1); }

@media (min-width: 48rem) {
  .mw-auth { padding-block: var(--mw-s-7) var(--mw-s-8); }
  .mw-auth__card { padding: var(--mw-s-6); gap: var(--mw-s-5); }
}
@media (min-width: 48rem) and (max-width: 63.99rem) {
  /* Tablette : une colonne de lecture confortable, centrée */
  .mw-auth__grid { max-width: 640px; margin-inline: auto; }
}
@media (min-width: 64rem) {
  .mw-auth { padding-block: var(--mw-s-8) var(--mw-s-9); }
  .mw-auth__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--mw-s-8); align-items: stretch; }
  .mw-auth__main { display: flex; align-items: flex-start; }
  .mw-auth__card { width: 100%; max-width: 560px; margin-inline: auto; padding: var(--mw-s-7) var(--mw-s-6); }
}
@media (min-width: 80rem) {
  .mw-auth__card { padding: var(--mw-s-7); }
}

/* Mode « formulaire seul » : les fonds décoratifs ne passent jamais derrière du texte long */
.mw-auth__card > * { min-width: 0; }

/* =============================================================================
   2. Champs
   ========================================================================== */
.mw-comptes .mw-input,
.mw-comptes .mw-select,
.mw-comptes .mw-textarea { min-height: 52px; }
.mw-comptes .mw-textarea { min-height: 120px; }
.mw-comptes .mw-input[disabled] { opacity: .75; cursor: not-allowed; }

/* Bouton afficher / masquer : inutile sans JavaScript */
.mw-comptes .mw-input-group--pw .mw-input { padding-right: 60px; }
.mw-comptes .mw-input-group__btn {
  display: none;
  width: 44px; height: 44px;
  right: 4px;
  border-radius: var(--mw-r-sm);
  color: var(--mw-text-2);
}
.mw-js .mw-comptes .mw-input-group__btn { display: grid; }
.mw-comptes .mw-input-group__btn .mw-icon { width: 22px; height: 22px; }
.mw-comptes .mw-input-group__btn:focus-visible { outline: 2px solid var(--mw-focus); outline-offset: 0; }
.mw-pw-eye-off { display: none; }
.mw-input-group__btn[aria-pressed="true"] .mw-pw-eye { display: none; }
.mw-input-group__btn[aria-pressed="true"] .mw-pw-eye-off { display: inline-flex; }

/* Piège à robots : hors écran, jamais display:none (certains robots l'ignorent alors) */
.mw-acc-hp {
  position: absolute !important;
  left: -10000px; top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Mesure de robustesse (ajoutée par JavaScript) */
.mw-pw-meter { display: grid; gap: var(--mw-s-2); margin-top: var(--mw-s-1); }
.mw-pw-meter__bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.mw-pw-meter__bars span {
  height: 6px;
  border-radius: var(--mw-r-pill);
  background: var(--mw-line-strong);
  transition: background-color var(--mw-dur) var(--mw-ease);
}
.mw-pw-meter[data-score="1"] .mw-pw-meter__bars span:nth-child(-n+1) { background: var(--mw-down); }
.mw-pw-meter[data-score="2"] .mw-pw-meter__bars span:nth-child(-n+2) { background: var(--mw-warn); }
.mw-pw-meter[data-score="3"] .mw-pw-meter__bars span:nth-child(-n+3) { background: var(--mw-accent-2); }
.mw-pw-meter[data-score="4"] .mw-pw-meter__bars span:nth-child(-n+4) { background: var(--mw-up); }
.mw-pw-meter__label { font-size: var(--mw-fs-sm); color: var(--mw-text-2); min-height: 1.4em; }
.mw-pw-meter__label strong { color: var(--mw-text); font-weight: 650; }

/* Règles affichées (visibles sans JavaScript, cochées en direct avec) */
.mw-pw-rules { display: grid; gap: 6px; margin-top: var(--mw-s-1); }
.mw-pw-rules li {
  display: flex; align-items: center; gap: var(--mw-s-2);
  font-size: var(--mw-fs-sm); color: var(--mw-text-2); line-height: 1.4;
}
.mw-pw-rules__dot {
  flex: none;
  display: grid; place-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--mw-line-strong);
  transition: background-color var(--mw-dur), border-color var(--mw-dur);
}
.mw-pw-rules__dot::after {
  content: "";
  width: 10px; height: 10px;
  background: var(--mw-accent-ink);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform 120ms var(--mw-ease);
}
.mw-pw-rules li.is-ok { color: var(--mw-text); }
.mw-pw-rules li.is-ok .mw-pw-rules__dot { background: var(--mw-up); border-color: var(--mw-up); }
.mw-pw-rules li.is-ok .mw-pw-rules__dot::after { transform: scale(1); }
.mw-pw-rules li.is-bad { color: var(--mw-down); }
.mw-pw-rules li.is-bad .mw-pw-rules__dot { border-color: var(--mw-down); }
.mw-pw-tip { margin-top: var(--mw-s-1); }

.mw-acc-count { text-align: right; }
.mw-acc-count.is-over { color: var(--mw-down); }

/* Résumé d'erreurs */
.mw-acc-errlist { display: grid; gap: 0; margin-top: 6px; padding-left: 1.1em; list-style: disc; }
.mw-acc-errlist li { padding-left: 2px; }
.mw-acc-errlist a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.mw-alert:focus-visible { outline: 2px solid var(--mw-focus); outline-offset: 3px; }

/* =============================================================================
   3. Cases, lignes, boutons
   ========================================================================== */
.mw-acc-consents { display: grid; gap: var(--mw-s-1); border: 0; padding: 0; margin: 0; min-width: 0; }
.mw-acc-checkfield { gap: 0; }
.mw-acc-checkfield .mw-check { padding-block: 8px; }
.mw-acc-checkfield .mw-check span { line-height: 1.45; }
.mw-acc-checkfield .mw-check a { color: var(--mw-accent); text-decoration: underline; text-underline-offset: .18em; }
.mw-acc-checkfield .mw-check small { margin-top: 2px; }
.mw-acc-checkfield.is-error .mw-check input { border-color: var(--mw-down); }
.mw-acc-checkfield .mw-field__msg { margin: 0 0 var(--mw-s-2) calc(20px + var(--mw-s-3)); }
.mw-acc-switch { width: 100%; align-items: flex-start; padding-block: 8px; }
.mw-acc-switch input { margin-top: 1px; }
.mw-acc-switch span { display: block; line-height: 1.45; }
.mw-acc-switch small { display: block; color: var(--mw-text-2); font-size: var(--mw-fs-sm); margin-top: 2px; }

.mw-acc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--mw-s-2) var(--mw-s-4); }
.mw-acc-row .mw-acc-checkfield { flex: 1 1 auto; }
.mw-acc-row__link { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--mw-fs-sm); font-weight: 600; }

.mw-acc-submit { width: 100%; }
.mw-acc-form .mw-acc-submit { margin-top: var(--mw-s-1); }
@media (min-width: 48rem) {
  .mw-acc .mw-acc-submit:not(.mw-btn--block) { width: auto; }
}
.mw-acc-submit[disabled], .mw-acc-submit[aria-disabled="true"] { cursor: not-allowed; }
.mw-acc-resend { display: grid; gap: var(--mw-s-2); }
.mw-acc-steps { margin-block: var(--mw-s-1); }

/* =============================================================================
   4. Panneau de marque (colonne droite sur bureau, sous le formulaire sur mobile)
   ========================================================================== */
.mw-auth__brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--mw-s-4);
  padding: var(--mw-s-5);
  border-radius: var(--mw-r-lg);
  border: 1px solid var(--mw-line);
  background: linear-gradient(165deg, color-mix(in srgb, var(--mw-accent) 14%, var(--mw-surface)), var(--mw-surface) 62%);
}
.mw-auth__brand > .mw-grid-paper { z-index: -1; }
.mw-auth__brand > .mw-halo { z-index: -1; }
.mw-auth__brand .mw-eyebrow { align-self: flex-start; }
.mw-auth__brand-title { max-width: 18ch; }
.mw-auth__candles { display: none; }
.mw-auth__facts { display: grid; gap: var(--mw-s-4); }
.mw-auth__facts li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--mw-s-3); align-items: start; }
.mw-auth__fact-icon {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  color: var(--mw-accent-2);
  background: var(--mw-accent-soft);
  border: 1px solid var(--mw-line);
}
.mw-auth__fact-icon .mw-icon { width: 20px; height: 20px; }
.mw-auth__facts li > span:last-child { color: var(--mw-text-2); font-size: var(--mw-fs-sm); line-height: 1.5; }
.mw-auth__facts strong { display: block; color: var(--mw-text); font-family: var(--mw-font-display); font-size: var(--mw-fs-md); font-weight: 700; margin-bottom: 2px; }

@media (min-width: 48rem) {
  .mw-auth__brand { padding: var(--mw-s-6); }
}
@media (min-width: 64rem) {
  .mw-auth__brand { padding: var(--mw-s-7) var(--mw-s-6); gap: var(--mw-s-5); justify-content: center; }
  .mw-auth__candles { display: block; position: absolute; right: -8%; bottom: -4%; width: 78%; opacity: .5; pointer-events: none; z-index: -1; }
  .mw-auth__candles svg { width: 100%; height: auto; }
  .mw-auth__brand-title { font-size: clamp(1.75rem, 1.2rem + 1.2vw, 2.25rem); }
  .mw-auth__facts { gap: var(--mw-s-5); }
}

/* =============================================================================
   5. Messages globaux, rappel de vérification, encart « Mode local »
   ========================================================================== */
.mw-flash, .mw-vbanner {
  border-bottom: 1px solid var(--mw-line);
  background: var(--mw-surface-2);
  color: var(--mw-text);
  font-size: var(--mw-fs-sm);
  line-height: 1.5;
}
.mw-flash__inner, .mw-vbanner__inner {
  display: flex; align-items: center; gap: var(--mw-s-3);
  padding-block: var(--mw-s-2);
  min-height: 48px;
}
.mw-flash__inner > .mw-icon, .mw-vbanner__inner > .mw-icon { flex: none; width: 20px; height: 20px; }
.mw-flash__inner > p, .mw-vbanner__inner > p { flex: 1 1 auto; min-width: 0; }
.mw-flash--success { border-bottom-color: color-mix(in srgb, var(--mw-up) 40%, var(--mw-line)); background: linear-gradient(90deg, var(--mw-up-soft), transparent 70%), var(--mw-surface-2); }
.mw-flash--success .mw-flash__inner > .mw-icon { color: var(--mw-up); }
.mw-flash--info .mw-flash__inner > .mw-icon { color: var(--mw-accent); }
.mw-flash--warn { background: linear-gradient(90deg, var(--mw-warn-soft), transparent 70%), var(--mw-surface-2); }
.mw-flash--warn .mw-flash__inner > .mw-icon { color: var(--mw-warn); }
.mw-flash--error { background: linear-gradient(90deg, var(--mw-down-soft), transparent 70%), var(--mw-surface-2); }
.mw-flash--error .mw-flash__inner > .mw-icon { color: var(--mw-down); }
.mw-vbanner { background: linear-gradient(90deg, var(--mw-warn-soft), transparent 70%), var(--mw-surface-2); }
.mw-vbanner__inner > .mw-icon { color: var(--mw-warn); }
.mw-vbanner a { color: var(--mw-text); font-weight: 650; text-decoration: underline; text-underline-offset: .18em; white-space: nowrap; }

.mw-flash__close, .mw-vbanner__close {
  display: none;
  flex: none;
  place-items: center;
  width: 44px; height: 44px;
  margin-right: -10px;
  border-radius: var(--mw-r-sm);
  color: var(--mw-text-2);
}
.mw-js .mw-flash__close, .mw-js .mw-vbanner__close { display: grid; }
.mw-flash__close:hover, .mw-vbanner__close:hover { color: var(--mw-text); background: var(--mw-accent-soft); }
.mw-flash__close .mw-icon, .mw-vbanner__close .mw-icon { width: 18px; height: 18px; }

.mw-localbox {
  display: grid; gap: var(--mw-s-2);
  padding: var(--mw-s-4);
  border-radius: var(--mw-r-md);
  border: 1px dashed color-mix(in srgb, var(--mw-warn) 60%, var(--mw-line));
  background: var(--mw-warn-soft);
  color: var(--mw-text-2);
  font-size: var(--mw-fs-sm);
  line-height: 1.5;
}
.mw-localbox__title { display: flex; align-items: flex-start; gap: var(--mw-s-2); color: var(--mw-warn); font-weight: 700; }
.mw-localbox__title .mw-icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.mw-theme-light .mw-localbox__title { color: var(--mw-text); }
.mw-localbox__link {
  display: block;
  padding: var(--mw-s-3);
  border-radius: var(--mw-r-sm);
  background: var(--mw-anthracite);
  color: var(--mw-accent-2);
  font-family: var(--mw-font-mono);
  font-size: var(--mw-fs-xs);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: .18em;
}

/* =============================================================================
   6. Mon compte
   ========================================================================== */
.mw-acc-summary {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--mw-s-3) var(--mw-s-4);
  margin-bottom: var(--mw-s-5);
}
.mw-acc-summary__text { min-width: 0; flex: 1 1 140px; }
.mw-acc-summary__name { font-family: var(--mw-font-display); font-size: var(--mw-fs-xl); font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.mw-acc-summary__meta { color: var(--mw-text-2); font-size: var(--mw-fs-sm); overflow-wrap: anywhere; }

.mw-acc-tabs { gap: var(--mw-s-5); }
/* Sans JavaScript : pas de barre d'onglets inerte, toutes les sections s'empilent avec leur titre */
.mw-acc-tabs > .mw-tabs__list { display: none; }
.mw-js .mw-acc-tabs > .mw-tabs__list { display: flex; }
.mw-acc-tabs .mw-tabs__tab { min-height: 44px; padding-inline: 16px; }
.mw-acc-tabs .mw-tabs__list { max-width: 100%; align-self: stretch; }
.mw-acc-tabs > .mw-tabs__panel + .mw-tabs__panel { margin-top: var(--mw-s-2); }
.mw-acc-tabs .mw-tabs__panel {
  display: flex; flex-direction: column; gap: var(--mw-s-5);
  padding: var(--mw-s-4);
  border-radius: var(--mw-r-lg);
  border: 1px solid var(--mw-line);
  background: var(--mw-surface);
  box-shadow: var(--mw-highlight);
  min-width: 0;
}
.mw-acc-tabs .mw-tabs__panel[hidden] { display: none; }
.mw-acc-panel__title { margin: 0; }
.mw-acc-tabs .mw-acc-form { max-width: 640px; }
.mw-acc-block { display: flex; flex-direction: column; gap: var(--mw-s-4); min-width: 0; }
.mw-acc-block + .mw-acc-block { padding-top: var(--mw-s-5); border-top: 1px solid var(--mw-line); }
.mw-acc-block .mw-hint { max-width: 62ch; }
.mw-acc-stamp { margin-top: var(--mw-s-1); }
.mw-acc-tzdetect { align-self: flex-start; min-height: 44px; }

.mw-acc-sessions { display: grid; gap: var(--mw-s-2); }
.mw-acc-session {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center;
  gap: var(--mw-s-3);
  padding: var(--mw-s-3) var(--mw-s-4);
  border-radius: var(--mw-r-md);
  border: 1px solid var(--mw-line);
  background: var(--mw-surface-2);
}
.mw-acc-session.is-current { border-color: color-mix(in srgb, var(--mw-accent) 40%, var(--mw-line)); }
.mw-acc-session__icon { color: var(--mw-text-3); display: grid; }
.mw-acc-session.is-current .mw-acc-session__icon { color: var(--mw-up); }
.mw-acc-session__icon .mw-icon { width: 22px; height: 22px; }
.mw-acc-session__text { min-width: 0; display: grid; gap: 2px; }
.mw-acc-session__text strong { font-weight: 650; overflow-wrap: anywhere; }
.mw-acc-session__text small { color: var(--mw-text-2); font-size: var(--mw-fs-xs); line-height: 1.4; }
@media (max-width: 29.99rem) {
  .mw-acc-session { grid-template-columns: 24px minmax(0, 1fr); }
  .mw-acc-session > .mw-badge { grid-column: 2; justify-self: start; }
}

.mw-acc-danger {
  padding: var(--mw-s-4);
  border-radius: var(--mw-r-md);
  border: 1px solid color-mix(in srgb, var(--mw-down) 35%, var(--mw-line));
  background: color-mix(in srgb, var(--mw-down-soft) 55%, transparent);
}
.mw-acc-block.mw-acc-danger + .mw-acc-block, .mw-acc-block + .mw-acc-block.mw-acc-danger { border-top: 0; }
.mw-acc-block + .mw-acc-block.mw-acc-danger { padding-top: var(--mw-s-4); }
.mw-btn--secondary.mw-acc-submit--danger { color: var(--mw-down); border-color: color-mix(in srgb, var(--mw-down) 55%, var(--mw-line-strong)); }
.mw-btn--secondary.mw-acc-submit--danger:hover { background: var(--mw-down-soft); border-color: var(--mw-down); }

@media (min-width: 48rem) {
  .mw-acc-tabs .mw-tabs__panel { padding: var(--mw-s-6); }
  .mw-acc-tabs .mw-tabs__list { align-self: flex-start; }
  .mw-acc-danger { padding: var(--mw-s-5); }
}

/* =============================================================================
   7. Mouvement réduit
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .mw-pw-meter__bars span, .mw-pw-rules__dot, .mw-pw-rules__dot::after { transition: none; }
}
