:root {
  --bg: #faf5ec;
  --card: #fffdf9;
  --ink: #2a241d;
  --muted: #6d6256;
  --line: #e7dccb;
  --gold: #e8a317;
  --gold-soft: #fdf1d6;
  --gold-ink: #8a5a00;
  --dark: #1f1a14;
  --error: #b3261e;
  --error-soft: #fdecea;
  --ok: #2e7d4f;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}

[hidden] { display: none !important; }

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 10px;
}
.logo { width: 64px; height: auto; flex: none; }
.kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-ink);
  font-weight: 700;
}
.top h1 { margin: 2px 0 0; font-size: 21px; line-height: 1.2; }
.date { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.progress {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 10px;
}
.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
#progress-title { text-align: right; font-weight: 600; color: var(--ink); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
#bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  border-radius: 99px;
  transition: width .25s ease;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: 0 1px 2px rgba(60, 40, 10, .05);
}
.notice { margin-top: 12px; }

.step { display: none; }
.step.active { display: block; }
.step h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.25; outline: none; }

p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 15px; }

.facts { margin: 16px 0; padding: 0; border-top: 1px solid var(--line); }
.facts div { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { flex: 0 0 92px; font-weight: 700; color: var(--gold-ink); font-size: 14px; padding-top: 1px; }
.facts dd { margin: 0; }

.resume {
  background: var(--gold-soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}

/* ---- Questions ---- */
.q { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.q:last-child { margin-bottom: 4px; }
.q > label, .q > legend {
  display: block;
  font-weight: 650;
  margin-bottom: 6px;
  padding: 0;
}
.req { color: var(--error); font-weight: 700; }
.help { font-size: 14px; color: var(--muted); margin: -2px 0 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #d6c8b2;
  border-radius: 10px;
  padding: 12px 12px;
  min-height: 48px;
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
input.short { max-width: 120px; }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 163, 23, .25);
}
input[type=file] {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px;
  border: 1.5px dashed #cdb894;
  border-radius: 10px;
  background: #fff;
}
.sub { margin-top: 8px; }

.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts .sub { grid-column: 1 / -1; margin-top: 0; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  min-height: 48px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 400;
  line-height: 1.35;
}
.opt input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--gold-ink);
}
.opt:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.opt:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(232, 163, 23, .3); }
.opt.check { font-size: 15px; }

.pay-info {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  font-size: 15px;
}
.pay-info p { margin: 4px 0 0; white-space: pre-line; }

.file-note { font-size: 14px; color: var(--ok); margin: 6px 0 0; }

.privacy {
  background: #f6efe3;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 18px;
  color: #4a4036;
}
.privacy p { margin: 4px 0 0; }

/* ---- Errors ---- */
.err {
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0 0;
}
.q.invalid input[type=text], .q.invalid input[type=email], .q.invalid input[type=tel],
.q.invalid input[type=number], .q.invalid select, .q.invalid textarea, .q.invalid input[type=file],
.q.invalid .opt { border-color: var(--error); }
.submit-error {
  background: var(--error-soft);
  color: var(--error);
  border-radius: 10px;
  padding: 12px;
  font-weight: 600;
  font-size: 15px;
}

/* ---- Navigation ---- */
.nav {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  position: sticky;
  bottom: 0;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, rgba(250, 245, 236, 0));
}
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn.primary { flex: 2; background: var(--dark); color: #fff; }
.btn.primary:active { background: #000; }
.btn.ghost { background: transparent; border-color: #cdbfa8; color: var(--ink); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn[disabled] { opacity: .65; cursor: progress; }
.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--gold-ink);
  text-decoration: underline;
  cursor: pointer;
}
a { color: var(--gold-ink); }

/* ---- Done ---- */
.done { text-align: center; }
.done .next { text-align: left; padding-left: 20px; margin: 0 0 14px; }
.done .next li { margin-bottom: 6px; }
.check-badge {
  width: 64px;
  height: 64px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--dark);
  font-size: 34px;
  font-weight: 800;
  line-height: 64px;
}
.see-you { font-weight: 700; font-size: 18px; }
.verse { font-style: italic; color: var(--muted); font-size: 14px; }
.verse span { display: block; font-style: normal; margin-top: 2px; }
.done .btn { display: flex; max-width: 300px; margin: 10px auto 0; }

.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 16px 28px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 360px) {
  .opts.two { grid-template-columns: 1fr; }
  .facts dt { flex-basis: 80px; }
}

@media (min-width: 600px) {
  .top { padding-top: 28px; }
  .logo { width: 80px; }
  .top h1 { font-size: 26px; }
  .card { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  #bar-fill { transition: none; }
}
