/* Change --accent (and its dark-mode value) to match your event. */
:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --text: #1f1b16;
  --muted: #6b6258;
  --border: #e2d9cb;
  --accent: #7a5c2e;
  --accent-text: #ffffff;
  --notice-bg: #fff3d6;
  --notice-text: #5f4300;
  --error-bg: #fde7e4;
  --error-text: #8a1c12;
  --focus: #2f6fdf;
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130f;
    --surface: #221d17;
    --text: #f3ede4;
    --muted: #b3a898;
    --border: #3a3128;
    --accent: #d8b479;
    --accent-text: #1d160c;
    --notice-bg: #3a2e12;
    --notice-text: #f5dc9c;
    --error-bg: #3d1a16;
    --error-text: #ffb4a9;
    --focus: #8db4ff;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--sans);
}

.page {
  flex: 1;
  width: min(100% - 32px, 420px);
  margin: 0 auto;
  padding: max(48px, env(safe-area-inset-top)) 0 32px;
}

.intro { text-align: center; margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font: 600 clamp(1.75rem, 7.5vw, 2.4rem)/1.15 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede { margin: 0 0 20px; color: var(--muted); text-align: center; }

form { display: grid; gap: 10px; }

label { font-weight: 600; font-size: 0.95rem; }

input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 500 1.25rem var(--sans); /* 16px+ stops iOS zooming in on focus */
  letter-spacing: 0.02em;
}

input::placeholder { color: var(--muted); opacity: 0.6; }

button {
  cursor: pointer;
  font: inherit;
}

#submit {
  height: 58px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1.1rem;
  font-weight: 600;
}

#submit:disabled { opacity: 0.7; cursor: progress; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus-visible { outline-offset: 0; border-color: var(--focus); }

.message {
  margin: 6px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.98rem;
}

.message.notice { background: var(--notice-bg); color: var(--notice-text); }
.message.error { background: var(--error-bg); color: var(--error-text); }

.result { text-align: center; animation: rise 0.25s ease-out; }

.result-heading { margin: 0 0 14px; font-size: 1.1rem; font-weight: 600; }

.tables {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.table-card {
  display: grid;
  gap: 2px;
  padding: 22px 18px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-label {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.table-value {
  font: 600 clamp(3.5rem, 20vw, 5rem)/1.05 var(--serif);
  overflow-wrap: anywhere;
}

.table-value.long { font-size: clamp(2rem, 10vw, 2.6rem); line-height: 1.15; }

.table-guests { margin-top: 6px; color: var(--muted); }

.note { margin: 18px 0 0; color: var(--muted); font-size: 0.92rem; }

.link-button {
  margin-top: 20px;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer {
  padding: 16px 16px max(20px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .result { animation: none; }
}
