:root {
  --cream: #F5EDE0;
  --ink: #2A190E;
  --brown: #3B2416;
  --ochre: #A8641E;
  --ochre-dark: #7A440F;
  --indigo: #1F2A4A;
  --muted: #5E4A3A;
  --line: #D8C7AE;
  --ok: #2F6B3A;
  --danger: #9A2A1A;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--brown);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-text-size-adjust: 100%;
}
body.danfani { background: var(--indigo); }
.sans { font-family: Montserrat, system-ui, sans-serif; }
.wrap { max-width: 540px; margin: 0 auto; padding: 16px 12px 40px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Carte faire-part ---------- */
.card {
  position: relative;
  background: var(--cream);
  overflow: hidden;
  display: flex; flex-direction: column;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: filter .2s;
}
body.veiled .card, body.veiled .qr-box { filter: blur(18px); }
.band { display: block; width: 100%; height: auto; }
.band.bottom { transform: scaleY(-1); }
.card-inner {
  margin: 12px 16px; border: 2px solid var(--ochre);
  padding: 22px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.families { margin: 0; font-family: Montserrat, sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 2.4px; text-transform: uppercase; line-height: 1.6; }
.intro { margin: 6px 0 0; font-size: 19px; font-weight: 600; font-style: italic; line-height: 1.3; }
.names { display: flex; flex-direction: column; align-items: center; }
.script { margin: 0; font-family: 'Great Vibes', cursive; font-size: clamp(52px, 15vw, 72px); line-height: 1.05; color: var(--ochre); }
.amp { margin: 0; font-size: 26px; font-style: italic; font-weight: 600; line-height: 1; }
.ornament { width: 180px; height: 14px; }
.date-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.date-side { width: 100px; padding: 6px 0; border-top: 2px solid var(--ochre-dark); border-bottom: 2px solid var(--ochre-dark); font-family: Montserrat, sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 2px; }
.date-day { font-size: 60px; font-weight: 700; line-height: 1; }
.hour { margin: 6px 0 0; font-size: 22px; font-weight: 600; font-style: italic; }
.hour small { display: block; font-family: Montserrat, sans-serif; font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--ochre-dark); margin-top: 2px; }
.label { margin: 0; font-family: Montserrat, sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 2.4px; color: var(--ochre-dark); }
.place { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.15; }
.place-detail { margin: 0; font-size: 18px; font-weight: 600; font-style: italic; }
.closing { margin: 0; font-size: 19px; font-weight: 600; font-style: italic; }
.watermark {
  position: absolute; inset: 0; pointer-events: none;
  background-repeat: repeat; opacity: .5; mix-blend-mode: multiply;
}

/* ---------- Panneaux ---------- */
.panel { background: var(--cream); border-radius: 14px; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin: 0; font-size: 26px; font-weight: 700; }
.panel p { margin: 0; font-family: Montserrat, sans-serif; font-size: 15px; line-height: 1.5; color: var(--ink); }
.announce { background: #FFF6D8; border: 2px solid #D9A23A; border-radius: 14px; padding: 14px 16px; font-family: Montserrat, sans-serif; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.announce strong { display: block; margin-bottom: 4px; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.countdown div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px; }
.countdown b { display: block; font-size: 32px; line-height: 1; }
.countdown span { font-family: Montserrat, sans-serif; font-size: 12px; color: var(--muted); }
.actions { display: grid; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 16px; border-radius: 10px; border: 2px solid var(--ochre-dark);
  background: #fff; color: var(--ochre-dark); text-decoration: none; cursor: pointer;
  font-family: Montserrat, sans-serif; font-weight: 700; font-size: 15px;
}
.btn.primary { background: var(--ochre-dark); color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.choice label { display: flex; align-items: center; justify-content: center; min-height: 52px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-family: Montserrat, sans-serif; font-weight: 700; font-size: 15px; cursor: pointer; text-align: center; padding: 6px; }
.choice input:checked + label { border-color: var(--ochre-dark); background: #F3E2C8; }
.choice input:focus-visible + label { outline: 3px solid var(--indigo); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; font-family: Montserrat, sans-serif; font-size: 14px; font-weight: 600; }
.field select, .field textarea, .field input {
  font: inherit; font-weight: 500; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--ink);
}
.status { font-family: Montserrat, sans-serif; font-size: 15px; font-weight: 600; padding: 12px 14px; border-radius: 10px; background: #E6F0E3; color: var(--ok); }
.status.no { background: #F4E4E0; color: var(--danger); }
.qr-box { align-self: center; background: #fff; padding: 14px; border-radius: 12px; border: 1px solid var(--line); }
.qr-box svg, .qr-box img { display: block; width: 220px; height: 220px; }
.foot { text-align: center; color: #EADCC6; font-family: Montserrat, sans-serif; font-size: 13px; line-height: 1.5; }
.center-msg { min-height: 80vh; padding: 16px; display: flex; align-items: center; justify-content: center; }
.center-msg .panel { text-align: center; max-width: 440px; }
.spinner { width: 36px; height: 36px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
@media print { body { display: none; } }
