/* Ambiance : faire-part crème, écriture manuscrite fine, serif espacé, traits encre. */

@font-face { font-family: "Sacramento"; src: url("fonts/sacramento.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("fonts/oldstandard-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("fonts/oldstandard-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("fonts/oldstandard-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #fcf5ec;
  --paper: #fffbf5;
  --ink: #34312f;
  --muted: #6c6560;
  --line: #e4d9cb;
  --field: #b9ada0;
  --accent-soft: #f2e9dd;
  --danger: #9c3b2e;
  --danger-soft: #f6e3de;
  --radius: 12px;
  --serif: "Old Standard", "CMU Serif", "Latin Modern Roman", Georgia, "Times New Roman", serif;
  --script: "Sacramento", "Segoe Script", cursive;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
}

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
strong { font-weight: 700; }
.defs { position: absolute; }

/* ---- En-tête : le faire-part ------------------------------------------ */
.hero {
  text-align: center;
  padding: clamp(56px, 12vw, 120px) 16px clamp(24px, 5vw, 40px);
}
.names {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.2rem, 12vw, 6.4rem);
  line-height: 1.1;
  white-space: nowrap;
}
.amp { padding: 0 .12em; }
.invite {
  margin: clamp(24px, 5vw, 44px) 0 0;
  font-size: clamp(1.15rem, 4.2vw, 1.6rem);
  letter-spacing: .22em;
  line-height: 1.75;
}
.date {
  margin: clamp(20px, 4vw, 36px) 0 0;
  font-size: clamp(1.45rem, 6vw, 2.5rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.3;
}
.greeting {
  margin: 28px 0 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
}

main { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ---- Programme : deux colonnes séparées par une vague ----------------- */
.programme {
  display: grid;
  grid-template-columns: 1fr 16px 1fr;
  gap: clamp(8px, 4vw, 40px);
  align-items: stretch;
  max-width: 600px;
  margin: clamp(24px, 6vw, 48px) auto 0;
}
.step { text-align: center; padding: 8px 0; }
.icon { display: block; width: clamp(84px, 22vw, 120px); height: auto; margin: 0 auto 12px; color: var(--ink); }
.script {
  margin: 0 0 clamp(16px, 4vw, 28px);
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 2.5rem);
  line-height: 1.15;
}
.step p { margin: 0; font-size: clamp(1.05rem, 4vw, 1.3rem); line-height: 1.95; }
/* Vagues : motif répété (jamais étiré), quelle que soit la hauteur */
.wave-v {
  width: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 40'%3E%3Cpath d='M8 0 q7 10 0 20 t0 20' fill='none' stroke='%2334312f' stroke-opacity='.8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center top / 16px 40px repeat-y;
}
.wave-h {
  width: min(300px, 70%);
  height: 16px;
  margin: clamp(40px, 9vw, 72px) auto clamp(28px, 6vw, 44px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 16'%3E%3Cpath d='M0 8 q7.5 -7 15 0 t15 0' fill='none' stroke='%2334312f' stroke-opacity='.8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") left center / 30px 16px repeat-x;
}

/* ---- Réponse ----------------------------------------------------------- */
.rsvp { max-width: 560px; margin: 0 auto; }
.title {
  margin: 0;
  text-align: center;
  font-weight: 400;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  letter-spacing: .12em;
}
.deadline { text-align: center; font-size: clamp(1.1rem, 4vw, 1.35rem); margin: 4px 0 28px; }
.notice {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}
.notice.error { background: var(--danger-soft); border-color: #ecc9c1; color: var(--danger); }
.notice.subtle { background: transparent; border: 0; color: var(--muted); padding: 8px 0; }

.field { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
label, legend { display: block; margin: 0 0 8px; padding: 0; letter-spacing: .02em; }
.optional, .hint { color: var(--muted); }
.hint { margin: 6px 0 0; font-size: .88rem; }

input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  padding: 11px 14px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--paper);
  min-height: 48px;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--paper);
  transition: background .15s, color .15s;
}
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 14px; border-radius: 10px; }

.button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  font: inherit;
  letter-spacing: .08em;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s;
}
.button:hover { background: #1f1d1c; }
.button:disabled { opacity: .6; cursor: progress; }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { background: var(--accent-soft); }

.recap-title { text-align: center; font-family: var(--script); font-size: clamp(1.9rem, 7vw, 2.4rem); line-height: 1.25; margin: 0 0 18px; }
.recap { margin: 0 0 24px; border-top: 1px solid var(--line); }
.recap div { display: grid; grid-template-columns: 11em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.recap dt { color: var(--muted); }
.recap dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Contacts ---------------------------------------------------------- */
.contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px clamp(32px, 12vw, 120px);
  max-width: 720px;
  margin: clamp(48px, 10vw, 80px) auto 0;
  padding: 0 16px 56px;
  text-align: center;
  font-size: clamp(1.05rem, 4vw, 1.3rem);
}
.contacts p { margin: 0; line-height: 1.8; }
.contacts .who { display: block; }
.contacts a { text-decoration: none; }
.contacts a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .invite { letter-spacing: .14em; }
  .date { letter-spacing: .06em; }
  .recap div { grid-template-columns: 1fr; gap: 2px; }
  .choices { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ======================================================================
   Administration
   ====================================================================== */
.admin { font-size: 16px; }
.admin main { max-width: 1100px; }
.admin-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 32px 0 20px; }
.admin-header h1 { margin: 0; font-family: var(--script); font-weight: 400; font-size: 2.6rem; line-height: 1.2; }
.admin-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin .button { width: auto; display: inline-flex; align-items: center; min-height: 40px; padding: 8px 18px; letter-spacing: .03em; }
.admin .button.small { min-height: 34px; padding: 4px 12px; font-size: .88rem; white-space: nowrap; }
.admin .button.danger { background: transparent; color: var(--danger); border-color: #d9b2aa; }
.admin .button.danger:hover { background: var(--danger-soft); }
.admin .card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 32px);
  margin: 0 0 24px;
}
.admin h2 { margin: 0 0 16px; font-weight: 400; font-size: 1.45rem; letter-spacing: .04em; }
.admin .deadline { text-align: left; font-size: 1rem; color: var(--muted); margin: -6px 0 16px; }
.login { max-width: 420px; margin: 12vh auto 0; }
.login .button { width: 100%; justify-content: center; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.stat-group h3 { margin: 0 0 10px; font-weight: 400; font-size: 1rem; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px 4px; text-align: center; }
.stat b { display: block; font-size: 1.9rem; font-weight: 400; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }
.stat.no b { color: var(--danger); }
.stat.pending b { color: #8a6a3a; }
.stats-note { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 400; color: var(--muted); }
td.text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 12em; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; white-space: nowrap; }
.badge.yes { background: #e5eadf; color: #3f5034; }
.badge.no { background: var(--danger-soft); color: var(--danger); }
.badge.pending { background: #f3ead9; color: #7d5f2f; }
.empty { color: var(--muted); font-style: italic; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .92rem;
  max-width: calc(100% - 32px);
}
.filter { max-width: 320px; margin: 0 0 12px; }
