:root {
  --pine-950: #0b2b20;
  --pine-900: #123d2b;
  --pine-800: #1b523b;
  --pine-100: #e5eee8;
  --berry-700: #9d243b;
  --berry-600: #b52b45;
  --berry-100: #f8e8eb;
  --gold-500: #c89939;
  --gold-300: #e4c781;
  --cream-50: #fffdf7;
  --cream-100: #f9f4e8;
  --ink: #202a24;
  --muted: #68736c;
  --border: #ded9cb;
  --white: #ffffff;
  --shadow: 0 24px 70px rgb(28 55 40 / 12%);
  --radius-lg: 28px;
  --radius-md: 16px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgb(200 153 57 / 12%) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 17%, rgb(181 43 69 / 10%) 0 3px, transparent 4px),
    linear-gradient(145deg, #f7f1e3 0%, var(--cream-50) 48%, #edf4ef 100%);
  background-size: 44px 44px, 64px 64px, auto;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  color: white;
  background: var(--pine-900);
  border-radius: 10px;
}
.skip-link:focus { top: 1rem; }

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--pine-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--cream-50);
  background: var(--berry-700);
  border: 2px solid var(--gold-300);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(157 36 59 / 8%);
}

.text-link {
  color: var(--pine-800);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
}
.text-link:hover { color: var(--berry-700); }

.form-layout {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
  padding: 36px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(480px, 1.1fr);
  gap: clamp(52px, 8vw, 110px);
  align-items: center;
}

.intro { padding-bottom: 50px; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--berry-700);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, legend {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--pine-950);
  letter-spacing: -.035em;
}

.intro h1 {
  max-width: 600px;
  margin: 0;
  font-size: clamp(3.1rem, 6vw, 5.8rem);
  line-height: .98;
  font-weight: 600;
}

.intro h1 em { color: var(--berry-700); font-weight: 500; }

.intro-copy {
  max-width: 540px;
  margin: 28px 0 0;
  color: #4f5d55;
  font-size: 1.08rem;
  line-height: 1.7;
}

.ornament-row {
  margin: 32px 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold-500);
  font-size: .7rem;
}
.ornament-row span:nth-child(odd) { color: var(--berry-600); font-size: .4rem; }

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--pine-800);
  font-size: .88rem;
  font-weight: 650;
}

.nowrap { white-space: nowrap; }

.family-rule {
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 11px 14px;
  color: #496457;
  background: rgb(228 199 129 / 10%);
  border: 1px solid rgb(200 153 57 / 24%);
  border-radius: 12px;
  font-size: .84rem;
  line-height: 1.4;
}

.rule-label { color: var(--pine-800); font-weight: 650; }

.form-card, .login-card {
  position: relative;
  overflow: hidden;
  background: rgb(255 255 255 / 91%);
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.form-card::before, .login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--pine-800), var(--gold-500), var(--berry-600));
}

#form-view { padding: clamp(26px, 5vw, 46px); }

.progress-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.step-label {
  margin: 0 0 4px;
  color: var(--berry-700);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.step-name { margin: 0; color: var(--pine-950); font-weight: 750; }
.progress-percent { color: var(--muted); font-size: .8rem; font-weight: 700; }
.progress-track { height: 5px; margin: 16px 0 38px; overflow: hidden; background: var(--pine-100); border-radius: 999px; }
.progress-track span { display: block; width: 25%; height: 100%; background: var(--berry-600); border-radius: inherit; transition: width 250ms ease; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; font-size: clamp(1.8rem, 4vw, 2.35rem); line-height: 1.1; font-weight: 600; }
.step-hint { margin: 8px 0 28px; color: var(--muted); line-height: 1.5; }
.form-step.is-active { animation: step-in 220ms ease both; }
@keyframes step-in { from { opacity: 0; transform: translateY(7px); } }

.field { margin-bottom: 22px; }
.field-grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.compact-field { max-width: 220px; }

label {
  display: block;
  margin-bottom: 8px;
  color: var(--pine-950);
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.35;
}

.hint { display: block; margin: -3px 0 9px; color: var(--muted); font-size: .78rem; line-height: 1.4; }

input, textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--cream-50);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9a9e99; }
input:focus, textarea:focus { background: white; border-color: var(--pine-800); box-shadow: 0 0 0 4px rgb(27 82 59 / 12%); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--berry-600); box-shadow: 0 0 0 3px rgb(181 43 69 / 10%); }
.field-error { min-height: 0; margin: 6px 0 0; color: var(--berry-700); font-size: .78rem; line-height: 1.4; }
.field-error:empty { display: none; }

.form-actions { margin-top: 30px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.form-actions .button-secondary { margin-right: auto; }

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 19px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: .7; transform: none; }
.button-primary { color: white; background: var(--pine-900); box-shadow: 0 9px 20px rgb(18 61 43 / 18%); }
.button-primary:hover { background: var(--pine-800); }
.button-secondary { color: var(--pine-900); background: var(--cream-50); border-color: var(--border); }
.button-secondary:hover { background: white; border-color: #c8c1af; }
.button-quiet { color: var(--berry-700); background: transparent; }
.full-width { width: 100%; }

.form-alert { margin: 16px 0 0; padding: 12px 14px; color: #78172a; background: var(--berry-100); border: 1px solid #ecc1ca; border-radius: 10px; font-size: .84rem; line-height: 1.45; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

.success-view { min-height: 620px; padding: 70px 42px; text-align: center; align-content: center; }
.success-mark, .lock-mark { width: 66px; height: 66px; margin: 0 auto 26px; display: grid; place-items: center; color: white; background: var(--berry-600); border: 4px solid var(--berry-100); border-radius: 50%; font-size: 1.7rem; font-weight: 800; box-shadow: 0 0 0 2px var(--gold-300); }
.success-view h2 { margin: 0; font-size: 2.6rem; }
.success-view p:not(.eyebrow) { max-width: 390px; margin: 15px auto 28px; color: var(--muted); line-height: 1.6; }

footer { margin-top: auto; padding: 28px 20px; color: var(--pine-800); font-family: Georgia, "Times New Roman", serif; font-size: .82rem; text-align: center; }
footer span { margin: 0 7px; color: var(--gold-500); }

.admin-main { width: min(1040px, calc(100% - 40px)); margin: auto; padding: 54px 0 80px; }
.login-card { width: min(480px, 100%); margin: 0 auto; padding: clamp(32px, 6vw, 52px); text-align: center; }
.login-card h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.2rem); }
.login-card > p:not(.eyebrow) { margin: 14px auto 28px; color: var(--muted); line-height: 1.6; }
.login-card form { text-align: left; }
.login-card .lock-mark { background: var(--pine-900); }

.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.dashboard-heading h1 { margin: 0 0 8px; font-size: clamp(2.5rem, 6vw, 4.4rem); line-height: 1; }
.dashboard-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.dashboard-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.search-wrap { position: relative; max-width: 440px; margin-bottom: 24px; }
.search-wrap span { position: absolute; left: 16px; top: 50%; color: var(--muted); font-size: 1.2rem; transform: translateY(-52%); }
.search-wrap input { padding-left: 44px; background: rgb(255 255 255 / 84%); }
.dashboard-rule { margin: -4px 0 24px; }

.response-list { display: grid; gap: 13px; }
.response-card { overflow: hidden; background: rgb(255 255 255 / 88%); border: 1px solid rgb(220 216 205 / 85%); border-radius: var(--radius-md); box-shadow: 0 10px 35px rgb(28 55 40 / 6%); }
.response-card summary { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; cursor: pointer; list-style: none; }
.response-card summary::-webkit-details-marker { display: none; }
.response-card summary:hover { background: rgb(249 244 232 / 55%); }
.response-summary-main { min-width: 0; display: flex; align-items: center; gap: 14px; }
.response-initial { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--berry-600); border-radius: 50%; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; font-weight: 700; }
.response-name-wrap { min-width: 0; display: grid; gap: 3px; }
.response-name { color: var(--pine-950); font-size: 1rem; }
.response-preview { overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.response-chevron { color: var(--berry-700); font-size: 1.25rem; transition: transform 180ms ease; }
details[open] .response-chevron { transform: rotate(180deg); }
.response-content { padding: 0 22px 24px 82px; border-top: 1px solid var(--cream-100); }
.preference-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; margin: 24px 0; }
.preference-item dt { margin-bottom: 5px; color: var(--berry-700); font-size: .7rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.preference-item dd { margin: 0; color: #35443b; line-height: 1.55; white-space: pre-wrap; }
.response-card-actions { display: flex; justify-content: flex-end; margin: 0 0 18px; }
.save-image-button::before { content: "↓"; font-size: 1rem; }
.submitted-date { margin: 0; padding-top: 18px; color: var(--muted); border-top: 1px solid var(--cream-100); font-size: .75rem; }
.empty-state, .no-match { padding: 70px 24px; text-align: center; background: rgb(255 255 255 / 70%); border: 1px dashed #cec8b9; border-radius: var(--radius-md); }
.empty-state > div { color: var(--gold-500); font-size: 2.2rem; }
.empty-state h2 { margin: 16px 0 8px; font-size: 1.8rem; }
.empty-state p { margin: 0 0 24px; color: var(--muted); }
.no-match { color: var(--muted); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 820px) {
  .form-layout { max-width: 640px; grid-template-columns: 1fr; gap: 34px; padding-top: 20px; }
  .intro { padding: 10px 0 0; text-align: center; }
  .intro h1, .intro-copy { margin-left: auto; margin-right: auto; }
  .ornament-row { justify-content: center; }
  .intro h1 { font-size: clamp(3.4rem, 12vw, 5.2rem); }
  .dashboard-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 560px) {
  .site-header, .form-layout, .admin-main { width: min(100% - 28px, 100%); }
  .site-header { padding: 18px 0; }
  .brand { font-size: 1.08rem; }
  .brand-mark { width: 32px; height: 32px; }
  .text-link { font-size: .78rem; }
  .form-layout { padding: 18px 0 46px; }
  .intro h1 { font-size: clamp(3.05rem, 15vw, 4.5rem); }
  .intro-copy { font-size: .98rem; }
  .privacy-note { align-items: start; text-align: left; }
  .family-rule { align-items: flex-start; text-align: left; }
  #form-view { padding: 28px 20px 22px; }
  .two-columns, .preference-grid { grid-template-columns: 1fr; }
  .field-grid { gap: 0; }
  .compact-field { max-width: none; }
  .form-actions { align-items: stretch; flex-wrap: wrap; }
  .form-actions .button-primary { flex: 1; }
  .success-view { min-height: 520px; padding: 54px 22px; }
  .admin-main { padding-top: 28px; }
  .login-card { padding: 36px 22px; }
  .dashboard-actions { width: 100%; }
  .dashboard-actions .button-secondary { flex: 1; }
  .response-card summary { padding: 14px; }
  .response-initial { width: 42px; height: 42px; }
  .response-content { padding: 0 18px 22px; }
  .preference-grid { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
