/* Adapted from mason584/vsl-funnel-template, commit ca4a673343eb0d6ba92552c93716cf06b15f06a1. */
#ecc-tf.mf-shell {
  /* ── Fonds et surfaces ── */
  --bg: #FEFAEB;           /* fond général de l'app */
  --bg-deep: #E9E4D8;      /* fond hors app, pieds de page */
  --panel: #FFFFFF;        /* cartes, panneaux surélevés */
  --panel-accent: #F7F0DC; /* panneaux d'accent, survols */

  /* ── Texte ── */
  --text: #221F1B;         /* texte principal */
  --text-strong: #221F1B;  /* titres */
  --text-secondary: #5A5248;
  --text-muted: #8A7E6E;
  --text-on-accent: #FEFAEB; /* texte posé sur --accent */
  --text-on-inverse: #FEFAEB; /* texte posé sur --inverse */

  /* ── Action ── */
  --accent: #E35A2E;
  --accent-deep: #C24820;  /* survol, erreurs */
  --accent-soft: rgba(227, 90, 46, 0.14);
  --inverse: #221F1B;      /* boutons sombres, barre latérale admin */
  --inverse-soft: #3A352F;

  /* ── Sémantique ── */
  --ok: #3E7A52;
  --ok-soft: rgba(62, 122, 82, 0.12);
  --warn-bg: #E8D4B8;
  --warn-text: #6F4E3C;
  --link: #926850;
  --tan: #DBC3A6;          /* traits décoratifs, numéros */

  /* ── Traits et ombres ── */
  --border-soft: rgba(34, 31, 27, 0.08);
  --border-strong: rgba(34, 31, 27, 0.14);
  --border-input: rgba(34, 31, 27, 0.28);
  /* Les ombres sont teintées de l'encre, jamais d'un noir pur : sur une
     charte sombre, un noir pur disparaît ou salit. */
  --shadow-soft: 0 2px 8px rgba(34, 31, 27, 0.06);
  --shadow-strong: 0 8px 24px rgba(34, 31, 27, 0.08);

  /* ── Formes ── */
  --radius: 0.375rem;
  --radius-lg: 0.625rem;

  /* ── Typographie ── */
  --font-display: 'Cormorant Garamond', Georgia, serif;   /* titres */
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Graisse et interlettrage des titres — une marque à la display
     géométrique voudra 600 et 0 ; Cormorant Garamond se lit bien à 500 et -0.01em. */
  --display-weight: 500;
  --display-tracking: -0.01em;

  /* ── Rôles facultatifs, lus avec repli par le moteur ──
     Une charte sombre ou en capitales les définit ; les omettre garde le
     comportement par défaut. Exemple (charte sombre, titres en capitales) :
       --display-transform: uppercase;  titres en capitales
       --eyebrow: var(--accent);        sur-titres colorés
       --sidebar: #000000;              barre latérale de l'administration
       --text-on-sidebar: #F4F4F4;      (sinon : --inverse / --text-on-inverse) */
}


/*
 * Le questionnaire — une question par écran.
 *
 * Aucune couleur en dur : tout vient des variables de `brand/tokens.mf-css`,
 * pour qu'un changement de marque n'oblige à rien toucher ici.
 */

.mf-shell {
  /*
   * `dvh` et non `vh` : sur iOS, `100vh` compte la barre d'adresse qui se
   * rétracte, et le bas de l'écran passe sous le pli.
   */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Barre de progression ── */

.mf-progressTrack {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 3px;
  width: 100%;
  background: var(--border-soft);
}

.mf-progressBar {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

@media (min-width: 640px) {
  .mf-head {
    padding: 22px 40px;
  }
}

/* ── Scène ── */

.mf-stage {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 8px 20px 40px;
  /* Le contenu d'un écran chargé (choix nombreux + précision) doit pouvoir
     défiler au lieu d'être coupé. */
  overflow-y: auto;
}

@media (min-width: 640px) {
  .mf-stage {
    padding: 8px 40px 64px;
  }
}

.mf-screen {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.mf-counter {
  margin: 0 0 14px;
}

.mf-label {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  /* Jamais de capitales ici, même pour une marque qui les impose à ses titres :
     quatorze écrans de question en majuscules fatiguent, et une question n'est
     pas un titre. */
  text-transform: none;
  font-size: clamp(25px, 4.4vw, 40px);
  line-height: 1.14;
  margin: 0;
  text-wrap: pretty;
}

.mf-help {
  margin: 14px 0 0;
  max-width: 52ch;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.mf-fields {
  margin-top: 30px;
}

/* ── Champs ── */

.mf-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/*
 * Deux champs empilés respirent ; deux champs côte à côte dans une rangée
 * doivent rester alignés — sans cette exception, « Nom » descendait de 16 px
 * sous « Prénom ».
 */
.mf-field + .mf-field {
  margin-top: 16px;
}

.mf-row .mf-field + .mf-field {
  margin-top: 0;
}

@media (max-width: 520px) {
  /* La rangée s'empile : la respiration redevient nécessaire. */
  .mf-row .mf-field + .mf-field {
    margin-top: 16px;
  }
}

/* Un champ qui apparaît après coup (le nom, une fois le prénom tapé). */
.mf-appear {
  animation: mf-appear 0.22s ease-out;
}

@keyframes mf-appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mf-appear {
    animation: none;
  }
}

.mf-fieldLabel {
  font-size: 13.5px;
  color: var(--text-muted);
}

.mf-input,
.mf-textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  /* 16 px : en dessous, iOS zoome au focus et casse la mise en page. */
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 0.14s;
}

.mf-input:focus,
.mf-textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.mf-textarea {
  min-height: 132px;
  resize: vertical;
}

.mf-row {
  display: flex;
  gap: 12px;
}

.mf-row > * {
  flex: 1;
  min-width: 0;
}

@media (max-width: 520px) {
  .mf-row {
    flex-direction: column;
  }
}

.mf-phoneRow {
  display: flex;
  gap: 10px;
}

.mf-phoneRow .mf-input {
  flex: 1;
  min-width: 0;
}

.mf-dial {
  flex: none;
  padding: 13px 10px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}

/* ── Choix ── */

.mf-choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.mf-choice {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.4;
  text-align: left;
  transition:
    border-color 0.12s,
    background-color 0.12s,
    transform 0.08s;
}

.mf-choice:hover {
  border-color: var(--accent);
  background: var(--panel-accent);
}

.mf-choice:active {
  transform: scale(0.995);
}

.mf-choiceSelected {
  border-color: var(--accent);
  background: var(--panel-accent);
}

/* La lettre de raccourci clavier — « A », « B »… */
.mf-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  transition:
    background-color 0.12s,
    color 0.12s,
    border-color 0.12s;
}

.mf-choiceSelected .mf-key {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}

.mf-choiceText {
  flex: 1;
}

.mf-followUp {
  margin-top: 9px;
  padding-left: 39px;
}

@media (max-width: 520px) {
  .mf-followUp {
    padding-left: 0;
  }
}

/* ── Actions ── */

.mf-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.mf-hint {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .mf-hint {
    display: none;
  }
}

.mf-error {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--accent-deep);
}

.mf-inputError {
  border-color: var(--accent-deep);
}

/* ── Navigation haut/bas ── */

.mf-nav {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.mf-navButton {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--inverse);
  color: var(--text-on-inverse);
  transition: opacity 0.12s;
}

.mf-navButton:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .mf-nav {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Écrans d'ouverture et d'attente ── */

.mf-intro {
  text-align: left;
}

.mf-introBody {
  margin: 16px 0 0;
  max-width: 48ch;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.mf-sending {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.mf-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--tan);
  border-top-color: var(--accent);
  animation: mf-spin 900ms linear infinite;
  flex: none;
}

@keyframes mf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Créneaux ── */

.mf-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.mf-day {
  padding: 10px 14px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition:
    border-color 0.12s,
    background-color 0.12s;
}

.mf-day:hover,
.mf-slot:hover {
  border-color: var(--accent);
}

.mf-daySelected {
  border-color: var(--accent);
  background: var(--panel-accent);
}

.mf-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.mf-slot {
  padding: 12px 8px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.12s,
    background-color 0.12s;
}

.mf-slotSelected {
  border-color: var(--accent);
  background: var(--panel-accent);
}

.mf-day:disabled,
.mf-slot:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mf-notice {
  margin: 0;
  padding: 22px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

/* ── Intégré sous la vidéo de la landing ── */

.mf-shellEmbedded {
  position: relative;
  min-height: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.mf-shellEmbedded .mf-progressTrack {
  position: absolute;
  top: 0;
  z-index: 1;
}

.mf-shellEmbedded .mf-head {
  justify-content: flex-end;
  padding: 18px 24px 0;
}

.mf-shellEmbedded .mf-stage {
  align-items: flex-start;
  padding: 8px 24px 32px;
  overflow: visible;
}

.mf-shellEmbedded .mf-label {
  font-size: clamp(22px, 3vw, 30px);
}

.mf-shellEmbedded .mf-fields {
  margin-top: 22px;
}

/* La navigation flotte dans la carte, pas dans la page. */
.mf-navEmbedded {
  position: absolute;
  right: 16px;
  bottom: 16px;
}

@media (max-width: 640px) {
  .mf-shellEmbedded .mf-head {
    padding: 16px 18px 0;
  }

  .mf-shellEmbedded .mf-stage {
    padding: 8px 18px 64px;
  }

  .mf-navEmbedded {
    right: 12px;
    bottom: 12px;
  }
}



/* DOM adapter for Mason's React form, retaining the original module styles. */
#ecc-tf.mf-shell { width:100%; min-width:0; font-family:var(--font-body); color:var(--text); text-align:left; }
#ecc-tf.mf-shell * { box-sizing:border-box; }
#ecc-tf.mf-shell button, #ecc-tf.mf-shell select { cursor:pointer; }
#ecc-tf.mf-shell button:disabled { cursor:not-allowed; opacity:.55; }
#ecc-tf.mf-shell [hidden] { display:none !important; }
#ecc-tf .mf-head { min-height:50px; }
#ecc-tf .mf-counter { font-family:var(--font-mono); text-transform:uppercase; font-size:11px; letter-spacing:.09em; color:var(--text-muted); }
#ecc-tf .mf-stage { min-height:420px; }
#ecc-tf .mf-screen { padding-bottom:24px; animation:mf-enter .3s cubic-bezier(.22,1,.36,1) both; }
#ecc-tf .mf-screen.mf-backwards { animation-name:mf-back; }
#ecc-tf .mf-screen.mf-out { animation:mf-exit .16s ease-in both; }
#ecc-tf .mf-label { color:var(--text); margin:0; }
#ecc-tf .mf-choices > * { animation:mf-choice .22s ease-out both; }
#ecc-tf .mf-cta { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:44px; padding:11px 24px; border:0; border-radius:var(--radius); background:var(--accent); color:var(--text-on-accent); font:500 15px/1.4 var(--font-body); transition:background .12s; text-decoration:none; }
#ecc-tf .mf-cta:hover { background:var(--accent-deep); }
#ecc-tf .mf-cta:focus-visible, #ecc-tf button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
#ecc-tf .mf-sync { min-height:20px; margin-top:14px; font-size:12px; color:var(--text-muted); }
#ecc-tf .mf-tz { margin:18px 0 0; font-size:12px; color:var(--text-muted); }
#ecc-tf .mf-failure { margin-top:16px; }
#ecc-tf .mf-hp { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
@keyframes mf-enter { from {opacity:0; transform:translateY(32px)} to {opacity:1; transform:none} }
@keyframes mf-back { from {opacity:0; transform:translateY(-32px)} to {opacity:1; transform:none} }
@keyframes mf-exit { to {opacity:0; transform:translateY(-24px)} }
@keyframes mf-choice { from {opacity:0; transform:translateY(8px)} to {opacity:1; transform:none} }
@media(max-width:640px) { #ecc-tf .mf-stage { min-height:440px; } #ecc-tf .mf-actions { flex-wrap:wrap; } }
@media(prefers-reduced-motion:reduce) { #ecc-tf *, #ecc-tf *::before, #ecc-tf *::after { animation:none !important; transition:none !important; } }

