/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Nunito Sans", system-ui, sans-serif;
  background: var(--bg, #f4ecdd);
  color: var(--text, #1f3a5f);
  line-height: 1.55;
}
h1, h2, .subtitle, legend { font-family: "Cormorant Garamond", Georgia, serif; }
.script {
  font-family: "Dancing Script", cursive;
  color: var(--script, var(--accent));
  font-size: 1.9rem;
  margin: 0;
}
.muted { color: var(--muted); }
a { color: var(--accent); }

/* ---------- RSVP page ---------- */
.page {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: color-mix(in srgb, var(--panel) 100%, transparent);
}
.hero { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 35%;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.bunting {
  position: absolute; top: 8px; left: -4%; right: -4%;
  display: flex; justify-content: space-between;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}
.bunting span {
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid currentColor;
}

.panel {
  background: var(--bg);
  padding: 0 28px 56px;
  margin-top: -1px;
}
.event-head { text-align: center; padding-top: 8px; }
.event-head h1 { font-size: 2.9rem; margin: 2px 0 0; font-weight: 700; letter-spacing: .5px; }
.subtitle { font-style: italic; font-size: 1.35rem; margin: 4px 0 0; color: var(--text); }
.rule { width: 56px; border: none; border-top: 1.5px solid var(--accent); margin: 18px auto; opacity: .8; }

.event-meta { display: grid; gap: 10px; margin: 0 0 6px; padding: 0; }
.event-meta div { margin: 0; }
.event-meta dt {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 0;
}
.event-meta dd { margin: 1px 0 0; font-size: 1.12rem; }
.event-meta .detail { color: var(--muted); }

.greeting { font-size: 1.2rem; margin: 26px 0 4px; font-weight: 600; }
.intro { margin: 0 0 22px; color: var(--text); }

/* ---------- form ---------- */
.rsvp { display: grid; gap: 22px; }
fieldset.attend { border: none; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font-size: 1.5rem; padding: 0; margin-bottom: 6px; }
.choice {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
.choice:hover { border-color: var(--accent); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.choice span { font-size: 1.05rem; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.details { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.lbl { font-size: .9rem; font-weight: 600; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; }

input[type="text"], textarea {
  font: inherit; color: var(--text);
  background: var(--panel);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 13px; width: 100%;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }

.btn {
  font: inherit; font-weight: 700; font-size: 1.05rem;
  background: var(--accent); color: var(--on-accent);
  border: none; border-radius: 12px; padding: 14px 18px; cursor: pointer;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn-ghost {
  display: inline-block; text-decoration: none; font-weight: 700;
  border: 1.5px solid var(--accent); color: var(--accent);
  border-radius: 12px; padding: 11px 18px;
}

/* ---------- thank-you ---------- */
.thanks { text-align: center; padding: 18px 0 6px; display: grid; gap: 16px; justify-items: center; }
.thanks .script { font-size: 2.4rem; }
.thanks-line { font-size: 1.2rem; margin: 0; max-width: 36ch; }

/* ---------- splash / not found ---------- */
.splash {
  min-height: 100vh; display: grid; place-items: center; text-align: center;
  background: #f4ecdd; color: #1f3a5f; padding: 24px;
}
.splash .script { color: #d2502a; font-size: 2.2rem; }
.splash h1 { font-size: 3rem; margin: 6px 0 10px; }

/* =================================================================
   ADMIN
   ================================================================= */
body.admin {
  background: #f3f4f6; color: #1f2937;
  font-family: "Nunito Sans", system-ui, sans-serif;
}
.adm-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }
.adm-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.adm-top h1 { font-family: "Cormorant Garamond", serif; font-size: 2rem; margin: 0; }
.adm-top nav { display: flex; gap: 8px; }
.btn-ghost.sm { padding: 7px 12px; font-size: .85rem; border-radius: 8px; border-color: #1f2937; color: #1f2937; }

.adm-event { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 18px; margin-top: 22px; }
.adm-event-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.adm-event-head h2 { font-size: 1.5rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.flag { width: 22px; height: 15px; border-radius: 2px; display: inline-block; }
.flag-ch { background: #d52b1e; position: relative; }
.flag-ch::after { content: "+"; color: #fff; position: absolute; inset: 0; text-align: center; font-weight: 800; line-height: 15px; }
.flag-nl { background: linear-gradient(#ae1c28 33%, #fff 33% 66%, #21468b 66%); }

.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { font-size: .8rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: #f3f4f6; color: #374151; }
.stat.yes { background: #dcfce7; color: #166534; }
.stat.no { background: #fee2e2; color: #991b1b; }
.stat.pending { background: #fef9c3; color: #854d0e; }
.stat.heads { background: #dbeafe; color: #1e40af; }

.adm-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.adm-add input[type="text"] { width: auto; flex: 1; min-width: 220px; }
.check.inline { white-space: nowrap; font-size: .9rem; }

.table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.adm-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; padding: 6px 7px; border-bottom: 2px solid #e5e7eb; white-space: nowrap; }
.adm-table td { padding: 5px 7px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.adm-table td.center { text-align: center; }
.adm-table td.wrap { max-width: 160px; white-space: pre-wrap; color: #374151; }
.adm-table input[type="text"] { padding: 5px 7px; border-radius: 7px; width: 100%; min-width: 80px; }
.adm-table .empty { color: #9ca3af; text-align: center; padding: 18px; }
.linkcell { white-space: nowrap; }
.linkcell .link { font-size: .82rem; font-weight: 600; color: #2563eb; text-decoration: none; }
.linkcell .link:hover { text-decoration: underline; }
.copy-link { margin-left: 6px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; cursor: pointer; font-size: .8rem; line-height: 1; padding: 3px 6px; color: #6b7280; }
.copy-link:hover { background: #f3f4f6; }
.qr-link { margin-left: 6px; font-weight: 700; font-size: .8rem; }
.actions { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.actions form { display: flex; margin: 0; }
.btn-icon { font: inherit; font-size: .9rem; line-height: 1; background: #fff; color: #374151; border: 1px solid #d1d5db; border-radius: 7px; padding: 6px 8px; cursor: pointer; }
.btn-icon:hover { background: #f3f4f6; }
.btn-icon.danger { color: #b91c1c; border-color: #fecaca; }
.btn-icon.danger:hover { background: #fef2f2; }

.badge { display: inline-block; white-space: nowrap; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.badge.yes { background: #dcfce7; color: #166534; }
.badge.no { background: #fee2e2; color: #991b1b; }
.badge.pending { background: #f3f4f6; color: #6b7280; }

.btn-sm { font: inherit; font-size: .82rem; font-weight: 700; background: #1f2937; color: #fff; border: none; border-radius: 7px; padding: 6px 11px; cursor: pointer; }
.btn-sm:hover { background: #374151; }
.btn-sm.danger { background: #fff; color: #b91c1c; border: 1px solid #fecaca; margin-left: 4px; }
.btn-sm.danger:hover { background: #fef2f2; }

/* ---------- print QR sheet ---------- */
body.print { background: #fff; color: #111; }
.print-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px; }
.qr-card { border: 1px solid #ddd; border-radius: 8px; padding: 12px; text-align: center; break-inside: avoid; }
.qr-card-head { display: flex; justify-content: space-between; font-size: .72rem; color: #555; margin-bottom: 6px; }
.qr-img svg { width: 100%; height: auto; max-width: 180px; }
.qr-name { font-weight: 700; margin-top: 6px; }
.qr-url { font-size: .66rem; color: #777; word-break: break-all; }
@media print {
  .print-wrap { grid-template-columns: repeat(3, 1fr); }
  @page { margin: 12mm; }
}

@media (max-width: 520px) {
  .panel { padding: 0 20px 48px; }
  .event-head h1 { font-size: 2.4rem; }
}
