/*
 * Socle commun : structure du formulaire, du programme et du compte à rebours.
 * Chaque site redéfinit les variables --mw-* et ajoute sa propre mise en forme.
 */
:root {
  --mw-bg: #fbf9f4;            /* fond de page */
  --mw-surface: #ffffff;       /* fond des champs et cartes */
  --mw-ink: #2f3a4a;           /* texte principal */
  --mw-muted: #6b7686;         /* texte secondaire */
  --mw-accent: #9a7b2f;        /* couleur forte (or, bleu...) */
  --mw-accent-ink: #ffffff;    /* texte sur fond accent */
  --mw-line: rgba(47, 58, 74, .22);
  --mw-focus: #9a7b2f;
  --mw-error: #a23b3b;
  --mw-radius: 2px;
  --mw-font-display: 'Cormorant Garamond', Georgia, serif;
  --mw-font-body: 'Cormorant Garamond', Georgia, serif;
  --mw-font-ui: 'Cormorant Garamond', Georgia, serif;
  --mw-font-script: 'Pinyon Script', cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--mw-bg); color: var(--mw-ink); font-family: var(--mw-font-body); line-height: 1.5; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
[data-vide] { display: none; }

/* ---------- apparition au défilement ---------- */
.mw-js .mw-reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.mw-js .mw-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mw-js .mw-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- programme ---------- */
.mw-programme { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.mw-etape { display: grid; gap: 2px; text-align: center; }
.mw-etape__heure { font-family: var(--mw-font-display); color: var(--mw-accent); font-size: 1.35rem; letter-spacing: .08em; }
.mw-etape__titre { font-family: var(--mw-font-display); font-size: 1.45rem; text-transform: uppercase; letter-spacing: .14em; }
.mw-etape__lieu { font-size: 1.1rem; }
.mw-etape__adresse { color: var(--mw-muted); font-size: .98rem; }
.mw-etape__lien { justify-self: center; margin-top: 6px; color: var(--mw-accent); font-family: var(--mw-font-ui); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.mw-etape__lien:hover { opacity: .75; }

/* ---------- infos pratiques ---------- */
.mw-infos { display: grid; gap: 28px; }
@media (min-width: 640px) {
  .mw-infos { grid-template-columns: repeat(2, 1fr); gap: 36px 48px; }
  /* nombre impair de blocs : le dernier se centre sous les deux colonnes */
  .mw-info:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; max-width: 26em; }
}
.mw-info { text-align: center; }
.mw-info__titre { margin: 0 0 8px; font-family: var(--mw-font-display); font-weight: 400; color: var(--mw-accent); font-size: 1.25rem; letter-spacing: .12em; text-transform: uppercase; }
.mw-info__texte { margin: 0; color: var(--mw-ink); font-size: 1.05rem; }

/* ---------- compte à rebours ---------- */
.mw-compte { display: flex; justify-content: center; gap: clamp(18px, 6vw, 48px); }
.mw-compte__unite { display: grid; justify-items: center; }
.mw-compte__valeur { font-family: var(--mw-font-display); font-size: clamp(2.2rem, 8vw, 3.4rem); line-height: 1; color: var(--mw-accent); font-variant-numeric: lining-nums; }
.mw-compte__label { margin-top: 6px; font-family: var(--mw-font-ui); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mw-muted); }
.mw-compte__fin { font-family: var(--mw-font-display); font-size: 1.6rem; margin: 0; }

/* ---------- ajout à l'agenda (menu sous le bouton data-mariage-agenda) ---------- */
.mw-agenda { list-style: none; margin: 16px auto 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 420px; }
.mw-agenda:not([hidden]) { animation: mw-agenda-in .25s ease; }
@keyframes mw-agenda-in { from { opacity: 0; transform: translateY(-6px); } }
.mw-agenda__lien {
  display: grid; align-content: center; gap: 2px; min-height: 62px; padding: 10px 12px; text-align: center; text-decoration: none;
  color: var(--mw-ink); background: var(--mw-surface); border: 1px solid var(--mw-line); border-radius: var(--mw-radius);
  transition: border-color .2s, background .2s;
}
.mw-agenda__lien:hover { border-color: var(--mw-accent); }
.mw-agenda__lien:focus-visible { outline: 2px solid var(--mw-focus); outline-offset: 2px; }
.mw-agenda__nom { font-family: var(--mw-font-ui); font-size: .95rem; }
.mw-agenda__detail { font-size: .85rem; color: var(--mw-muted); }
@media (prefers-reduced-motion: reduce) { .mw-agenda:not([hidden]) { animation: none; } }

/* ---------- formulaire ---------- */
.mw-form, .mw-merci { display: grid; gap: 22px; text-align: left; }
.mw-form__intro { margin: 0; text-align: center; color: var(--mw-muted); font-size: 1.05rem; }
.mw-form__intro strong { color: var(--mw-ink); font-weight: 600; }
.mw-field { display: grid; gap: 8px; min-width: 0; border: 0; margin: 0; padding: 0; }
.mw-row { display: flex; flex-wrap: wrap; gap: 16px; }
.mw-row > .mw-field { flex: 1 1 150px; }
.mw-row > .mw-field--grow { flex: 3 1 220px; }
.mw-label { font-family: var(--mw-font-ui); font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mw-ink); padding: 0; }
.mw-label--petit { font-size: .74rem; color: var(--mw-muted); }
.mw-facultatif { text-transform: none; letter-spacing: 0; color: var(--mw-muted); font-style: italic; }
legend.mw-label { margin-bottom: 8px; }

.mw-input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  font: inherit; font-size: 1.05rem; color: var(--mw-ink);
  background: var(--mw-surface); border: 1px solid var(--mw-line); border-radius: var(--mw-radius);
  transition: border-color .2s, box-shadow .2s;
}
.mw-input::placeholder { color: var(--mw-muted); opacity: .75; }
.mw-input:focus { outline: none; border-color: var(--mw-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mw-focus) 22%, transparent); }
.mw-input[aria-invalid="true"] { border-color: var(--mw-error); }
.mw-input--court { max-width: 110px; }
.mw-select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.mw-textarea { min-height: 96px; resize: vertical; }
.mw-precision { margin-top: 4px; }

/* choix Oui / Non */
.mw-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mw-choice { position: relative; display: block; cursor: pointer; }
.mw-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mw-choice span {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 12px; text-align: center;
  font-family: var(--mw-font-display); font-size: 1.15rem;
  border: 1px solid var(--mw-line); border-radius: var(--mw-radius); background: var(--mw-surface); color: var(--mw-ink);
  transition: background .2s, color .2s, border-color .2s;
}
.mw-choice:hover span { border-color: var(--mw-accent); }
.mw-choice input:checked + span { background: var(--mw-accent); border-color: var(--mw-accent); color: var(--mw-accent-ink); }
.mw-choice input:focus-visible + span { outline: 2px solid var(--mw-focus); outline-offset: 3px; }
.mw-choice input[aria-invalid="true"] + span { border-color: var(--mw-error); }

/* pastilles (régimes, nuits) */
.mw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mw-chips--colonne { flex-direction: column; align-items: stretch; }
.mw-chip { position: relative; cursor: pointer; }
.mw-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mw-chip span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px;
  font-family: var(--mw-font-ui); font-size: .92rem; color: var(--mw-ink);
  border: 1px solid var(--mw-line); border-radius: 999px; background: var(--mw-surface);
  transition: background .2s, color .2s, border-color .2s;
}
.mw-chips--colonne .mw-chip span { display: flex; border-radius: var(--mw-radius); }
.mw-chip span::before { content: ''; flex: none; width: 0; transition: width .2s; overflow: hidden; }
.mw-chip input:checked + span { background: var(--mw-accent); border-color: var(--mw-accent); color: var(--mw-accent-ink); }
.mw-chip input:checked + span::before { content: '✓'; width: 1.1em; }
.mw-chip input:focus-visible + span { outline: 2px solid var(--mw-focus); outline-offset: 2px; }
.mw-chip input[aria-invalid="true"] + span { border-color: var(--mw-error); }

/* nombre de personnes */
.mw-stepper { display: inline-flex; align-items: center; justify-self: start; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); background: var(--mw-surface); }
.mw-stepper__btn { width: 48px; height: 46px; border: 0; background: transparent; color: var(--mw-accent); font-size: 1.4rem; cursor: pointer; font-family: inherit; }
.mw-stepper__btn:disabled { opacity: .3; cursor: default; }
.mw-stepper__btn:focus-visible { outline: 2px solid var(--mw-focus); outline-offset: -2px; }
.mw-stepper__valeur { min-width: 40px; text-align: center; font-family: var(--mw-font-display); font-size: 1.35rem; }

/* convives */
.mw-convives { display: grid; gap: 14px; }
.mw-convive { display: grid; gap: 14px; margin: 0; padding: 16px; border: 1px solid var(--mw-line); border-radius: var(--mw-radius); background: color-mix(in srgb, var(--mw-surface) 55%, transparent); min-width: 0; }
.mw-convive__titre { padding: 0 6px; font-family: var(--mw-font-display); font-size: 1.05rem; color: var(--mw-accent); letter-spacing: .06em; }

.mw-bloc { display: grid; gap: 22px; }

/* bouton */
.mw-bouton {
  justify-self: center; min-height: 52px; padding: 14px 38px; cursor: pointer;
  font-family: var(--mw-font-ui); font-size: .9rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--mw-accent-ink); background: var(--mw-accent); border: 1px solid var(--mw-accent); border-radius: var(--mw-radius);
  transition: opacity .2s, transform .2s;
}
.mw-bouton:hover { opacity: .88; }
.mw-bouton:active { transform: translateY(1px); }
.mw-bouton:disabled { opacity: .6; cursor: wait; }
.mw-bouton:focus-visible { outline: 2px solid var(--mw-focus); outline-offset: 3px; }
.mw-bouton--secondaire { background: transparent; color: var(--mw-accent); }

.mw-piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mw-erreur { margin: 0; min-height: 1.2em; text-align: center; color: var(--mw-error); font-size: 1rem; }
.mw-erreur:empty { min-height: 0; }
.mw-note { margin: -8px 0 0; text-align: center; font-size: .85rem; font-style: italic; color: var(--mw-muted); }

/* remerciement */
.mw-merci { text-align: center; outline: none; }
.mw-merci__titre { margin: 0; font-family: var(--mw-font-display); font-size: clamp(1.6rem, 5vw, 2.1rem); color: var(--mw-accent); }
.mw-merci__texte { margin: 0; color: var(--mw-muted); }
.mw-merci__resume { margin: 0; padding: 16px 18px; white-space: pre-wrap; text-align: left; font-family: var(--mw-font-body); font-size: .98rem; line-height: 1.6; color: var(--mw-ink); background: var(--mw-surface); border: 1px solid var(--mw-line); border-radius: var(--mw-radius); }

/* ---------- code couleur des invités ---------- */
.mw-couleurs { display: grid; gap: 22px; justify-items: center; text-align: center; }
.mw-couleurs__texte { margin: 0; max-width: 34em; font-size: 1.08rem; color: var(--mw-ink); }
.mw-couleurs__palette { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; }
.mw-couleur { display: grid; justify-items: center; gap: 8px; width: 84px; }
.mw-couleur__pastille { width: 58px; height: 58px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .06); }
.mw-couleur__nom { font-family: var(--mw-font-ui); font-size: .78rem; letter-spacing: .08em; line-height: 1.3; color: var(--mw-muted); }
.mw-couleurs__note { margin: 0; font-style: italic; font-size: .98rem; color: var(--mw-muted); }
