:root {
  --orange: #f56622;
  --orange-dark: #c9470d;
  --cream: #fff7ed;
  --ink: #25231f;
  --muted: #6f6b64;
  --line: #dfddd8;
  --soft: #f5f3ef;
  --green: #287a4d;
  --shadow: 0 18px 45px rgba(47, 38, 28, 0.11);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 102, 34, 0.09), transparent 30rem),
    #faf9f7;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a { color: var(--orange-dark); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 10px clamp(18px, 4vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img { width: 58px; height: 58px; object-fit: contain; }
.brand span { display: grid; }
.brand strong { font-size: 1rem; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 0.83rem; letter-spacing: 0.04em; }

.secure-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
}

.secure-note::before { content: "✓"; }

main { width: min(100% - 32px, 980px); margin: 0 auto; padding: 36px 0 64px; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 10px 4px 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.05; letter-spacing: -0.045em; }
.hero p:not(.eyebrow) { max-width: 650px; margin: 16px 0 0; color: var(--muted); font-size: 1.06rem; }
.hero-cat { display: grid; width: 112px; height: 112px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--cream); font-size: 3.5rem; }

.alerts { margin: 0 0 18px; }
.alert { margin: 0; padding: 14px 18px; border-radius: 12px; font-weight: 650; }
.alert-error { background: #fff0f0; border: 1px solid #e7b2b2; color: #8d2424; }

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.progress li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #8a8782;
  font-size: 0.82rem;
  font-weight: 750;
}

.progress li::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 16px;
  left: 38px;
  width: calc(100% - 28px);
  height: 2px;
  background: var(--line);
}

.progress li:last-child::after { display: none; }

.progress span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.progress li.active, .progress li.complete { color: var(--ink); }
.progress li.active span { color: #fff; border-color: var(--orange); background: var(--orange); }
.progress li.complete span { color: var(--green); border-color: #7ab795; background: #eef8f2; }
.progress li.complete::after { background: #7ab795; }

.step {
  overflow: hidden;
  padding: clamp(22px, 5vw, 46px);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.step[hidden] { display: none; }
.card-heading { margin-bottom: 28px; }
.step-label { margin: 0 0 3px; color: var(--orange-dark); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.card-heading h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.15; letter-spacing: -0.03em; }
.card-heading > p:last-child { margin: 8px 0 0; color: var(--muted); }

.form-grid { display: grid; gap: 19px; }
.form-grid.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span, .signature-field strong { font-size: 0.9rem; font-weight: 750; }
.field em { color: var(--muted); font-size: 0.78rem; font-style: normal; font-weight: 500; }
.field small, .signature-field small { color: var(--muted); font-size: 0.76rem; }

input, textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1.5px solid #cac7c1;
  border-radius: 11px;
  background: #fff;
  font: inherit;
}

input:focus, textarea:focus, select:focus, canvas:focus {
  outline: 3px solid rgba(245, 102, 34, 0.17);
  border-color: var(--orange);
}

.guardian-panel {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid #f0c9ae;
  border-radius: 15px;
  background: var(--cream);
}

.guardian-panel h3 { margin: 0; }
.guardian-panel > p { margin: 4px 0 18px; color: var(--muted); }

.notice-box, .final-notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  background: var(--cream);
}

.paper-waiver-link { margin: -8px 0 16px; font-size: 0.86rem; font-weight: 700; }

.legal-copy {
  max-height: 480px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfa;
  scrollbar-color: var(--orange) #eee;
}

.legal-copy section + section { margin-top: 22px; }
.legal-copy h3 { margin: 0 0 6px; color: var(--orange-dark); font-size: 1rem; }
.legal-copy p { margin: 0; color: #47443f; font-family: Georgia, "Times New Roman", serif; }
.legal-copy .version { margin-top: 24px; color: var(--muted); font-family: inherit; font-size: 0.76rem; }

.choice-card, .required-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 15px;
  padding: 18px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
}

.choice-card:hover { border-color: #e1a27a; }
.choice-card:has(input:checked) { border-color: var(--orange); background: var(--cream); box-shadow: 0 0 0 3px rgba(245, 102, 34, 0.08); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box { display: grid; width: 24px; height: 24px; place-items: center; flex: 0 0 auto; border: 2px solid #aaa69f; border-radius: 6px; background: #fff; }
.choice-card input:checked + .choice-box { border-color: var(--orange); background: var(--orange); }
.choice-card input:checked + .choice-box::after { content: "✓"; color: #fff; font-weight: 900; }
.choice-card strong, .required-check strong { display: block; }
.choice-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 0.79rem; line-height: 1.5; }
.marketing-choice { border-color: #e9c9b4; }
.compact-choice { padding-block: 14px; }
.policy-links { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0 0; font-size: 0.83rem; }

.required-check { cursor: pointer; }
.required-check input { width: 21px; min-height: 21px; margin: 2px 0 0; accent-color: var(--orange); flex: 0 0 auto; }
.required-check span { color: #4d4943; font-size: 0.88rem; }
.signer-field { margin: 25px 0 20px; }

.signature-field { margin-top: 18px; }
.signature-label { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.signature-label > div { display: grid; }
.text-button { padding: 4px; color: var(--orange-dark); border: 0; background: none; font: inherit; font-size: 0.82rem; font-weight: 750; cursor: pointer; }
#signature-canvas { display: block; width: 100%; height: 190px; border: 2px dashed #aaa69f; border-radius: 14px; background: #fff; touch-action: none; }
.field-error { margin: 7px 0 0; color: #a22626; font-size: 0.82rem; font-weight: 700; }
.final-notice { margin-top: 22px; color: var(--muted); font-size: 0.82rem; }

.step-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; }
.step-actions.end { justify-content: flex-end; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 19px;
  border: 1.5px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { color: #fff; background: var(--orange); box-shadow: 0 8px 18px rgba(201, 71, 13, 0.2); }
.button.primary:hover { background: var(--orange-dark); }
.button.secondary { color: var(--ink); border-color: #c7c3bc; background: #fff; }
.button:disabled { opacity: 0.62; cursor: wait; }

.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 20px 40px;
  color: var(--muted);
  text-align: left;
}
footer img { width: 45px; height: 45px; }
footer p { margin: 1px 0 0; font-size: 0.78rem; }

.receipt-page main { width: min(100% - 32px, 760px); }
.receipt-hero { padding: 24px 4px 28px; text-align: center; }
.success-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 18px; place-items: center; color: #fff; border-radius: 50%; background: var(--green); font-size: 2rem; font-weight: 900; }
.receipt-hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
.receipt-hero > p:last-child { color: var(--muted); }
.receipt-card { padding: clamp(22px, 5vw, 42px); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.receipt-id { display: grid; gap: 3px; padding: 15px 18px; border-radius: 12px; background: var(--cream); }
.receipt-id span { color: var(--muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; }
.receipt-id strong { word-break: break-all; color: var(--orange-dark); }
.receipt-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 24px 0; border-block: 1px solid var(--line); }
.receipt-details div { padding: 15px 6px; border-bottom: 1px solid #eee; }
.receipt-details dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }
.receipt-details dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.receipt-message { padding: 13px 15px; border-radius: 10px; background: #eef8f2; color: #215c3d; font-weight: 650; }
.receipt-message.warning { background: #fff7e7; color: #765014; }
.signature-receipt { display: grid; gap: 8px; margin-top: 24px; }
.signature-receipt span { color: var(--muted); font-size: 0.78rem; }
.signature-receipt img { width: 100%; max-width: 420px; max-height: 135px; object-fit: contain; object-position: left center; border-bottom: 1px solid #777; }
.consent-receipt { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfa; }
.consent-receipt h2 { margin: 0 0 12px; font-size: 1.05rem; }
.consent-receipt p { margin: 8px 0; }
.consent-receipt .consent-text { color: var(--muted); font-size: 0.78rem; }
.consent-receipt .consent-version { color: var(--muted); font-size: 0.72rem; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.signed-terms { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.signed-terms summary { cursor: pointer; font-weight: 750; }
.signed-terms .legal-copy { margin-top: 16px; max-height: none; }

.qr-page { background: #fff7ed; }
.qr-page main { width: min(100% - 28px, 780px); padding-block: 28px; }
.qr-card { display: grid; justify-items: center; padding: clamp(28px, 6vw, 58px); border: 3px solid var(--orange); border-radius: 30px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.qr-logo { width: 100px; height: 100px; margin-bottom: 12px; }
.qr-card h1 { max-width: 650px; font-size: clamp(2.2rem, 7vw, 4.4rem); }
.qr-intro { max-width: 600px; color: var(--muted); font-size: 1.08rem; }
.qr-code { width: min(72vw, 400px); height: auto; margin: 8px auto 10px; image-rendering: pixelated; }
.qr-url { padding: 8px 14px; border-radius: 8px; background: var(--cream); color: var(--orange-dark); font-size: clamp(1rem, 4vw, 1.35rem); overflow-wrap: anywhere; }
.qr-note { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 720px) {
  .site-header { min-height: 72px; padding-inline: 16px; }
  .brand img { width: 49px; height: 49px; }
  .brand strong { font-size: 0.9rem; }
  .secure-note { font-size: 0; }
  .secure-note::before { font-size: 1rem; }
  main { width: min(100% - 22px, 980px); padding-top: 24px; }
  .hero { align-items: flex-start; padding-bottom: 22px; }
  .hero-cat { display: none; }
  .hero p:not(.eyebrow) { font-size: 0.96rem; }
  .progress { gap: 4px; }
  .progress li { display: grid; justify-items: center; gap: 3px; font-size: 0.66rem; }
  .progress li::after { top: 16px; left: 56%; width: 92%; }
  .step { padding: 22px 17px; border-radius: 17px; }
  .form-grid.two-column { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .legal-copy { max-height: 430px; padding: 17px; }
  .choice-card { padding: 15px; }
  .step-actions { align-items: stretch; flex-direction: column-reverse; }
  .step-actions.end { align-items: stretch; }
  .button { width: 100%; }
  #signature-canvas { height: 160px; }
  .receipt-details { grid-template-columns: 1fr; }
  .receipt-actions { flex-direction: column; }
}

@media print {
  body { background: #fff; font-size: 10pt; }
  .site-header, .no-print, footer { display: none !important; }
  main { width: 100%; padding: 0; }
  .receipt-hero { padding-top: 0; }
  .receipt-card, .signed-terms { padding: 14px; border: 1px solid #bbb; box-shadow: none; break-inside: avoid; }
  .signed-terms { display: block; }
  .signed-terms .legal-copy { border: 0; }
  .legal-copy { max-height: none; overflow: visible; }
  .qr-page main { width: 100%; padding: 0; }
  .qr-card { min-height: 96vh; justify-content: center; padding: 0.45in; border-width: 4px; box-shadow: none; }
  .qr-logo { width: 1.05in; height: 1.05in; }
  .qr-code { width: 4.25in; }
}
