/* =========================================================
   Alexis & Apolline
   ========================================================= */

:root {
  --creme: #FBF3E7;
  --creme-fonce: #F2E2C9;
  --papier: #FFFDF8;
  --encre: #241C15;
  --terracotta: #D9643A;
  --terracotta-fonce: #B5481F;
  --rose: #E8A0AE;
  --rose-fonce: #D97C93;
  --sauge: #8A9A5B;
  --sauge-fonce: #66753F;
  --moutarde: #EFB13D;
  --moutarde-fonce: #CE8F1E;
  --bleu: #52738F;

  --font-display: "Fraunces", serif;
  --font-script: "Caveat", cursive;
  --font-body: "Karla", sans-serif;

  --shadow: 6px 6px 0 var(--encre);
  --shadow-sm: 4px 4px 0 var(--encre);
  --shadow-lg: 9px 9px 0 var(--encre);
  --blob: 63% 37% 37% 63% / 43% 47% 53% 57%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--creme);
  color: var(--encre);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  filter: url(#grain);
  opacity: .5;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 999;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 .5em; line-height: 1.1; }

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.script { font-family: var(--font-script); }

/* -------------------- Boutons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  padding: .85em 1.6em;
  border: 3px solid var(--encre);
  border-radius: 999px;
  background: var(--moutarde);
  color: var(--encre);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--encre); }
.btn:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--encre); }
.btn-rose { background: var(--rose); }
.btn-rose2 { background: var(--rose-fonce); color: var(--encre); }
.btn-outline { background: var(--creme); }
.btn-lg { padding: 1.1em 2.2em; font-size: 1.15rem; }
.btn-sm { padding: .45em 1.1em; font-size: .85rem; box-shadow: var(--shadow-sm); }
.btn-sm:hover { box-shadow: 6px 6px 0 var(--encre); }
.btn-xs { padding: .3em .85em; font-size: .78rem; border-width: 2px; box-shadow: 2px 2px 0 var(--encre); white-space: nowrap; }
.btn-xs:hover { box-shadow: 3px 3px 0 var(--encre); }

/* -------------------- Header / Nav -------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background .25s ease, box-shadow .25s ease, padding .25s ease;
}
.site-header.scrolled {
  background: var(--creme);
  box-shadow: 0 3px 0 var(--encre);
  padding: 10px 0;
  border-bottom: 3px solid var(--encre);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.logo {
  grid-column: 1;
  justify-self: start;
  font-family: var(--font-script);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--encre);
  white-space: nowrap;
}
.logo .amp { color: var(--terracotta); }

.site-nav {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}
.site-nav a {
  font-weight: 700;
  font-size: .95rem;
  position: relative;
  padding: 4px 2px;
}
.site-nav a:not(.btn-nav):not(.nav-muted)::after {
  content: "";
  position: absolute;
  left: -6px; right: -6px; bottom: -4px;
  height: 10px;
  background: var(--moutarde);
  border-radius: 40% 60% 60% 40%/50%;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .15s ease, transform .15s ease;
  z-index: -1;
}
.site-nav a:hover::after { opacity: .55; transform: scale(1); }

.btn-nav {
  background: var(--terracotta);
  color: var(--papier) !important;
  padding: .5em 1.1em;
  border: 3px solid var(--encre);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}
.btn-nav:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--encre); }
.nav-muted { font-size: .85rem; opacity: .65; font-weight: 500; }

.nav-toggle {
  grid-column: 3;
  justify-self: end;
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 3px solid var(--encre);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span { width: 22px; height: 3px; background: var(--encre); border-radius: 3px; }

/* -------------------- Doodles décoratifs -------------------- */
.doodle { position: absolute; z-index: 0; pointer-events: none; opacity: .9; }
.doodle.float { animation: float 6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-14px) rotate(var(--r, 0deg)); }
}

/* -------------------- Hero -------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 100px;
  overflow: hidden;
}
.hero-blob {
  position: absolute;
  width: 620px; height: 620px;
  max-width: 90vw; max-height: 90vw;
  background: var(--rose);
  border-radius: var(--blob);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: .55;
}
.hero-content { position: relative; z-index: 2; max-width: 780px; }
.hero-eyebrow {
  display: inline-block;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .8rem;
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 999px;
  padding: .5em 1.2em;
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
  margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(3.2rem, 10vw, 6.4rem);
  font-weight: 600;
  font-style: italic;
}
.hero h1 .amp {
  display: block;
  font-family: var(--font-script);
  font-style: normal;
  font-weight: 700;
  color: var(--terracotta);
  font-size: .55em;
  transform: rotate(-4deg);
  margin: -6px 0;
}
.hero-sub {
  font-family: var(--font-script);
  font-size: 1.9rem;
  color: var(--sauge-fonce);
  margin-bottom: 10px;
}
.hero-tagline { font-size: 1.1rem; max-width: 46ch; margin-left: auto; margin-right: auto; }

.date-stamp {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  background: var(--encre);
  color: var(--papier);
  font-weight: 800;
  letter-spacing: .06em;
  padding: .7em 1.4em;
  border-radius: 999px;
  margin: 26px 0 34px;
  transform: rotate(1.5deg);
  box-shadow: var(--shadow-sm);
}

.countdown { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.countdown .unit {
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 16px;
  padding: 14px 10px;
  width: 84px;
  box-shadow: var(--shadow-sm);
}
.countdown .unit:nth-child(1) { transform: rotate(-3deg); }
.countdown .unit:nth-child(2) { transform: rotate(2deg); background: var(--moutarde); }
.countdown .unit:nth-child(3) { transform: rotate(-2deg); background: var(--rose); }
.countdown .unit:nth-child(4) { transform: rotate(3deg); background: var(--sauge); color: var(--papier); }
.countdown .num { display: block; font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; }
.countdown .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  bottom: 30px; left: 50%; transform: translateX(-50%);
  font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 2;
}
.scroll-cue span { animation: bob 1.6s ease-in-out infinite; font-size: 1.3rem; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* -------------------- Section générique -------------------- */
.section { position: relative; padding: 110px 0; }
.section-tinted { background: var(--creme-fonce); }
.section-ink { background: var(--encre); color: var(--papier); }
.section-header { text-align: center; max-width: 620px; margin: 0 auto 64px; position: relative; z-index: 1; }
.kicker {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--terracotta);
}
.section-header h2 { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 900; }

/* -------------------- Infos pratiques -------------------- */
.infos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}
.info-card {
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  position: relative;
}
.info-card:nth-child(1) { transform: rotate(-1.2deg); }
.info-card:nth-child(2) { transform: rotate(1deg); }
.info-card:nth-child(3) { transform: rotate(-.8deg); }
.info-card .tape {
  position: absolute; top: -14px; left: 30px;
  width: 70px; height: 26px;
  background: repeating-linear-gradient(45deg, var(--moutarde), var(--moutarde) 6px, #e0a02f 6px, #e0a02f 12px);
  opacity: .85;
  transform: rotate(-4deg);
  border: 1px solid rgba(36,28,21,.25);
}
.info-card .icon { font-size: 2.2rem; margin-bottom: 14px; display: block; }
.info-card h3 { font-size: 1.3rem; }
.info-card .when { font-weight: 800; color: var(--terracotta-fonce); margin-bottom: 4px; }
.info-card .where { font-size: .95rem; opacity: .85; }

/* -------------------- FAQ -------------------- */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.faq-list details {
  background: var(--sauge); color: var(--creme);
  border: 3px solid var(--encre);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.faq-list summary {
  cursor: pointer;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.4rem; color: var(--creme); }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { margin-top: 12px; opacity: .85; }

/* -------------------- CTA espace perso -------------------- */
.cta-espace {
  text-align: center;
  background: var(--rose);
  color: var(--encre);
  position: relative;
}
.cta-espace h2 { font-size: clamp(2rem, 5vw, 2.8rem); }
.cta-espace p { max-width: 50ch; margin: 0 auto 30px; opacity: .95; }

/* -------------------- Footer -------------------- */
.site-footer { position: relative; background: var(--encre); color: var(--creme); padding-top: 40px; }
.wave-divider { position: absolute; top: -59px; left: 0; width: 100%; line-height: 0; }
.wave-divider svg { width: 100%; height: 60px; display: block; }
.wave-divider path { fill: var(--encre); }
.footer-inner { text-align: center; padding: 20px 0 50px; }
.footer-stamp { font-size: 2.4rem; margin-bottom: 6px; }
.footer-names { font-family: var(--font-script); font-size: 2rem; margin-bottom: 2px; }
.footer-names .amp { color: var(--moutarde); }
.footer-date { letter-spacing: .2em; font-weight: 700; opacity: .8; margin-bottom: 14px; }
.footer-note { opacity: .7; font-size: .9rem; }
.footer-top { display: inline-block; margin-top: 10px; font-weight: 700; opacity: .8; }
.footer-top:hover { opacity: 1; }

/* -------------------- Auth (login / register) -------------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 20px 80px;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 26px;
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: rotate(-.4deg);
}
.auth-card::before {
  content: "";
  position: absolute; top: -16px; left: 44px;
  width: 80px; height: 28px;
  background: repeating-linear-gradient(45deg, var(--rose), var(--rose) 6px, var(--rose-fonce) 6px, var(--rose-fonce) 12px);
  transform: rotate(-3deg);
  opacity: .9;
}
.auth-card h1 { font-size: 1.9rem; text-align: center; }
.auth-card .sub { text-align: center; opacity: .75; margin-bottom: 28px; font-size: .95rem; }

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 800; margin-bottom: 6px; font-size: .92rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .8em .9em;
  border: 3px solid var(--encre);
  border-radius: 12px;
  background: var(--creme);
  color: var(--encre);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: var(--papier);
  box-shadow: 4px 4px 0 var(--moutarde);
}
.field textarea { resize: vertical; min-height: 90px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.field .field-hint { display: block; margin-top: 6px; font-size: .85rem; opacity: .75; }
.prenom-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.prenom-row[hidden], .prenom-row .prenom-remove[hidden] { display: none; }
.prenom-row .prenom-remove { flex-shrink: 0; }
.event-choices { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.field .event-choice { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 0; cursor: pointer; }
.field .event-choice input[type="checkbox"] { width: 36px; padding: 0; }
.field .event-choice input[type="checkbox"]:focus { background: var(--creme); box-shadow: none; }
.field .event-choice input[type="checkbox"]:checked:focus { background: var(--sauge); }
.admin-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 130px; }
.admin-actions .btn { justify-content: center; }
.admin-actions form { margin: 0; display: flex; }
.admin-actions form .btn { flex: 1; }
.admin-table td { vertical-align: middle; }
.admin-table td:nth-child(3) { overflow-wrap: anywhere; }
.admin-table tr[hidden], .admin-table tr.is-filtered-out { display: none !important; }

.search-bar { position: relative; display: flex; align-items: center; margin: 4px 0 18px; }
.search-bar__icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; color: var(--encre); pointer-events: none;
}
.search-bar__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  padding: .8em 3em .8em 3em;
  border: 3px solid var(--encre);
  border-radius: 999px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.search-bar__input::placeholder { color: var(--encre); opacity: .5; font-weight: 500; }
.search-bar__input::-webkit-search-cancel-button { display: none; }
.search-bar__input:focus { outline: none; background: var(--papier); box-shadow: var(--shadow-sm), 0 0 0 3px var(--rose); }
.search-bar__clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 800; line-height: 1;
  color: var(--encre);
  background: var(--rose);
  border: 2px solid var(--encre);
  border-radius: 50%;
  cursor: pointer;
}
.search-bar__clear[hidden] { display: none; }
.search-bar__clear:hover { background: var(--rose-fonce); }
.admin-table th:last-child, .admin-table td:last-child { padding-right: 20px; }

.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-pill {
  display: flex; align-items: center; gap: 10px;
  border: 3px solid var(--encre);
  border-radius: 999px;
  padding: .7em 1.2em;
  cursor: pointer;
  font-weight: 700;
  background: var(--creme);
  transition: background .15s ease, transform .1s ease;
}
.radio-pill:hover { transform: translate(-1px,-1px); }
.radio-pill input { accent-color: var(--terracotta); width: 18px; height: 18px; }
.radio-pill.checked-oui { background: var(--sauge); color: var(--papier); }
.radio-pill.checked-non { background: var(--rose); }
.radio-pill.checked-peut_etre { background: var(--moutarde); }

.form-actions { margin-top: 30px; text-align: center; }
.form-actions .btn { width: 100%; justify-content: center; }

.auth-switch { text-align: center; margin-top: 22px; font-size: .95rem; }
.auth-switch a { font-weight: 800; color: var(--terracotta-fonce); text-decoration: underline; }

.alert {
  border: 3px solid var(--encre);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  font-weight: 700;
  font-size: .92rem;
}
.alert-error { background: var(--rose); }
.alert-success { background: var(--sauge); color: var(--papier); }

/* -------------------- Dashboard -------------------- */
.dash-wrap { padding: 130px 0 100px; }
.dash-hero { text-align: center; margin-bottom: 50px; }
.dash-hero .kicker { display: block; }
.dash-hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); }

.dash-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 26px;
  padding: 44px;
  box-shadow: var(--shadow-lg);
}
.dash-card--wide { max-width: 920px; }

.section-title-mini {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  margin: 34px 0 14px;
  padding-top: 20px;
  border-top: 3px dashed rgba(36,28,21,.2);
}
.section-title-mini:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
/* Variante avec la police des boutons (Karla) au lieu du Fraunces des titres de section. */
.section-title-mini--plain { font-family: var(--font-body); font-weight: 800; font-size: 1rem; }
/* Un peu plus d'air quand le titre suit directement un formulaire (ex: panel admin, comptes existants).
   Spécificité renforcée pour battre ":first-of-type" ci-dessus quand c'est le 1er titre de la carte. */
form + .section-title-mini,
form + .section-title-mini:first-of-type,
.section-title-mini.section-title-mini--spaced {
  margin-top: 54px;
}

.hint { font-size: .85rem; opacity: .65; margin-top: -12px; margin-bottom: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* -------------------- Dashboard : tableau des invités -------------------- */
.table-scroll {
  overflow-x: auto;
  margin-bottom: 10px;
  border: 3px solid var(--encre);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.rsvp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.rsvp-table th,
.rsvp-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 3px dashed rgba(36,28,21,.15);
}
/* Aligne les réponses en haut de cellule pour que le champ "Précisez..." d'un invité ne décale pas les boutons des autres. */
.rsvp-table td.align-top {
  vertical-align: top;
}
.rsvp-table thead th {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  background: var(--papier);
  border-bottom: 3px solid var(--encre);
}
.rsvp-table__corner { background: var(--creme-fonce); }
.rsvp-table tbody th {
  text-align: left;
  font-weight: 800;
  font-size: .95rem;
  white-space: nowrap;
  background: var(--papier);
  position: sticky;
  left: 0;
}
/* Sélecteurs qualifiés avec tbody/tr pour battre la spécificité de ".rsvp-table tbody th" (sinon fond/position ignorés). */
.rsvp-table tbody tr.rsvp-table__section th {
  background: var(--moutarde);
  font-family: var(--font-display);
  font-weight: 900;
  text-align: left;
  /* Bordure pleine des deux côtés (pas de pointillés) pour bien marquer le début/la fin d'une section. */
  border-top: 3px solid var(--encre);
  border-bottom: 3px solid var(--encre);
  position: static;
}
.rsvp-table tbody tr.rsvp-table__section--presence th { background: var(--rose); color: var(--encre); }
.rsvp-table tbody tr.rsvp-table__section--repas th { background: var(--rose); color: var(--encre); }
.rsvp-table tbody tr:last-child th,
.rsvp-table tbody tr:last-child td { border-bottom: none; }

.presence-toggle {
  display: inline-flex;
  cursor: pointer;
  /* vertical-align: baseline (par défaut) décale le rond hors du centre de la cellule. */
  vertical-align: middle;
  /* Empêche le ✓ transformé (pseudo-élément ::after) de faire varier la hauteur de la ligne du tableau. */
  contain: layout paint;
}
.presence-toggle input[type="checkbox"] {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 3px solid var(--encre);
  border-radius: 50%;
  background: var(--creme);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--papier);
}
.presence-toggle input[type="checkbox"]:checked {
  background: var(--sauge);
}
.presence-toggle input[type="checkbox"]:checked::after {
  content: "";
  width: 9px;
  height: 16px;
  border-right: 4px solid var(--papier);
  border-bottom: 4px solid var(--papier);
  /* Recentre le tracé du "V" (dont l'encre n'occupe que le coin bas-droit de sa boîte) sur le bouton. */
  transform: rotate(40deg) translate(-1.43px, -1.43px);
}
.presence-toggle input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
}

.toggle-single {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  padding: .55em 1.3em;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: .88rem;
  border: 3px solid var(--encre);
  border-radius: 999px;
  background: var(--rose);
  color: var(--encre);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.toggle-single:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--encre); }
.toggle-single:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--encre); }
.toggle-single.is-vegetarien { background: var(--sauge); color: var(--papier); }
.toggle-single.is-oui { background: var(--moutarde); }

.allergie-detail {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: .9rem;
  padding: .55em .8em;
  border: 3px solid var(--encre);
  border-radius: 10px;
  background: var(--creme);
  color: var(--encre);
}
.allergie-detail[hidden] { display: none; }

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px; height: 14px;
  z-index: 1000;
  pointer-events: none;
  border-radius: 2px;
}

/* -------------------- Panel admin -------------------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 30px;
}
.admin-table th,
.admin-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: .92rem;
  border-bottom: 3px dashed rgba(36,28,21,.15);
}
.admin-table th {
  font-family: var(--font-body);
  font-weight: 800;
  background: var(--rose);
}
.admin-table tr:last-child td { border-bottom: none; }

/* -------------------- Responsive -------------------- */
@media (max-width: 860px) {
  .site-nav {
    position: fixed;
    top: 68px; left: 16px; right: 16px;
    justify-self: stretch;
    background: var(--papier);
    border: 3px solid var(--encre);
    border-radius: 18px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 18px;
    gap: 14px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-toggle { display: flex; }
  .timeline::before { left: 20px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; left: 0; text-align: left; padding-left: 56px; padding-right: 10px; }
  .tl-item:nth-child(odd) .tl-year, .tl-item:nth-child(even) .tl-year { left: -8px; right: auto; }
  .field-row { flex-direction: column; gap: 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }

  .site-header { padding: 12px 0; }
  .logo { font-size: 1.5rem; }
  .nav-toggle { padding: 7px 9px; }
  .site-nav { top: 70px; left: 14px; right: 14px; max-height: calc(100vh - 90px); overflow-y: auto; }
  .site-nav a:not(.btn-nav) { padding: 8px 2px; }
  .btn-nav { text-align: center; padding: .7em 1.1em; }

  .hero { min-height: 100vh; min-height: 100svh; padding: 110px 18px 70px; }
  .hero-eyebrow { font-size: .7rem; padding: .45em 1em; margin-bottom: 20px; }
  .hero-sub { font-size: 1.6rem; line-height: 1.3; }
  .hero-tagline { font-size: 1rem; }
  .date-stamp { font-size: .88rem; padding: .6em 1.1em; margin: 20px 0 26px; text-align: center; }
  .countdown { flex-wrap: nowrap; gap: 8px; margin-bottom: 30px; }
  .countdown .unit { flex: 1 1 0; width: auto; min-width: 0; padding: 10px 2px; border-radius: 14px; }
  .countdown .num { font-size: 1.45rem; }
  .countdown .label { font-size: .56rem; letter-spacing: .02em; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; text-align: center; }
  .scroll-cue { display: none; }
  .doodle { opacity: .6; }

  .btn-lg { padding: .95em 1.5em; font-size: 1.05rem; }
  .section { padding: 70px 0; }
  .section-header { margin-bottom: 40px; }
  .kicker { font-size: 1.35rem; }
  .infos-grid { grid-template-columns: 1fr; gap: 28px; }
  .info-card { padding: 28px 22px; box-shadow: var(--shadow-sm); }
  .faq-list { gap: 12px; }
  .faq-list details { padding: 14px 16px; }
  .faq-list summary { font-size: 1rem; gap: 12px; }
  .cta-espace .btn { width: 100%; justify-content: center; }
  .footer-inner { padding: 14px 0 36px; }

  .auth-wrap { min-height: 100vh; padding: 105px 16px 50px; align-items: flex-start; }
  .auth-card { padding: 34px 22px; transform: none; box-shadow: var(--shadow); }
  .auth-card::before { left: 28px; }
  .auth-card h1 { font-size: 1.6rem; }

  .dash-wrap { padding: 100px 0 60px; }
  .dash-hero { margin-bottom: 30px; }
  .dash-card, .dash-card--wide { padding: 26px 16px; border-radius: 22px; box-shadow: var(--shadow); }
  form + .section-title-mini, form + .section-title-mini:first-of-type, .section-title-mini.section-title-mini--spaced { margin-top: 36px; }
  .allergie-detail { text-align: left; }

  /* Tableau des invités : une ligne par question, chaque invité sur sa propre ligne. */
  .table-scroll { overflow: hidden; }
  .rsvp-table,
  .rsvp-table tbody,
  .rsvp-table tr,
  .rsvp-table th,
  .rsvp-table td { display: block; width: auto; }
  .rsvp-table { min-width: 0; }
  .rsvp-table thead { display: none; }
  .rsvp-table tbody tr { padding: 4px 0 10px; border-bottom: 3px dashed rgba(36,28,21,.15); }
  .rsvp-table tbody tr:last-child { border-bottom: none; }
  .rsvp-table tbody tr.rsvp-table__section { padding: 0; border-bottom: none; }
  .rsvp-table tbody th { position: static; white-space: normal; padding: 12px 16px 4px; border-bottom: none; }
  .rsvp-table td {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 6px 16px;
    border-bottom: none;
    text-align: right;
  }
  .rsvp-table td::before {
    content: attr(data-label);
    font-weight: 700;
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .rsvp-table td .allergie-detail { flex: 1 1 100%; margin-top: 0; }
  .toggle-single { min-width: 120px; }

  /* Panel : la liste des comptes devient une pile de cartes. */
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; }
  .admin-table { margin: 10px 0 24px; }
  .admin-table thead { display: none; }
  .admin-table tr {
    background: var(--creme);
    border: 3px solid var(--encre);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 6px 0;
    margin-bottom: 16px;
  }
  .admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 14px;
    border-bottom: none;
    text-align: right;
  }
  .admin-table td::before { content: attr(data-label); font-weight: 800; text-align: left; flex-shrink: 0; }
  .admin-table td.admin-actions-cell, .admin-table td.admin-empty { display: block; text-align: center; padding: 10px 14px 6px; }
  .admin-table td.admin-actions-cell::before, .admin-table td.admin-empty::before { content: none; }
  .admin-actions { flex-direction: row; min-width: 0; }
  .admin-actions > a, .admin-actions > form { flex: 1; }
  .admin-actions > a { justify-content: center; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 14px; }
  .logo { font-size: 1.3rem; }
  .auth-card, .dash-card, .dash-card--wide { padding: 26px 14px; }
  .countdown { gap: 6px; }
  .countdown .num { font-size: 1.25rem; }
  .countdown .label { font-size: .5rem; }
  .date-stamp { font-size: .8rem; }
}
