:root {
  color-scheme: light;
  --green: #173e36;
  --green-2: #22584c;
  --mint: #eaf3ef;
  --gold: #c49337;
  --ink: #17231f;
  --muted: #60716b;
  --line: #d2ddd8;
  --paper: #fffdf9;
  --danger: #a53f35;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 85% 0, #d9e9e2 0, transparent 34rem), #f3f0e9; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.page { width: min(1040px, calc(100% - 28px)); margin: 24px auto 60px; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.brand img { width: 190px; max-height: 70px; object-fit: contain; background: #050505; border-radius: 6px; }
.brand span { color: var(--green); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .74rem; }
.hero { overflow: hidden; position: relative; padding: clamp(26px, 5vw, 54px); border-radius: 28px 28px 0 0; color: white; background: linear-gradient(135deg, var(--green), #0e2923); }
.hero::after { content: ""; position: absolute; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; right: -80px; top: -160px; box-shadow: 0 0 0 40px rgba(255,255,255,.04), 0 0 0 85px rgba(255,255,255,.03); }
.eyebrow { margin: 0 0 8px; color: #e5c888; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; font-size: .74rem; }
.hero h1 { position: relative; z-index: 1; max-width: 760px; margin: 0; font-family: Georgia, serif; font-size: clamp(2.2rem, 6vw, 4.3rem); line-height: .98; letter-spacing: -.035em; }
.hero p:last-child { max-width: 720px; margin: 18px 0 0; color: #d7e5df; font-size: 1.06rem; line-height: 1.65; }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-inline: 1px solid var(--line); }
.progress span { padding: 14px 8px; color: var(--muted); text-align: center; border-bottom: 3px solid transparent; font-size: .8rem; font-weight: 800; }
.progress span.active { color: var(--green); border-color: var(--gold); background: #fbfaf7; }
.form-shell { padding: clamp(22px, 4vw, 46px); background: var(--paper); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 28px 28px; box-shadow: 0 24px 70px rgba(24, 46, 39, .12); }
.step[hidden], .hidden { display: none !important; }
.step-heading { margin-bottom: 26px; }
.step-heading h2 { margin: 2px 0 7px; color: var(--green); font-family: Georgia, serif; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.step-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid .wide { grid-column: 1 / -1; }
label, fieldset { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; color: var(--green); font-weight: 800; }
input, select, textarea { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid #bdcbc5; border-radius: 10px; background: white; color: var(--ink); outline: none; }
textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(34,88,76,.14); }
small, .hint { color: var(--muted); font-size: .8rem; font-weight: 500; line-height: 1.45; }
.radio-row { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-row label { display: flex; flex: 1 1 110px; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.radio-row input, .check input { width: 19px; min-height: 19px; flex: 0 0 auto; }
.notice { padding: 16px 18px; border-left: 4px solid var(--gold); border-radius: 10px; background: #fbf3df; line-height: 1.55; }
.terms { display: grid; gap: 12px; max-height: 54vh; overflow: auto; padding-right: 8px; }
.term { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.term h3 { margin: 0 0 8px; color: var(--green); font-size: 1rem; }
.term p { margin: 0; color: #3b4a45; line-height: 1.62; }
.check { display: flex; align-items: flex-start; gap: 11px; margin-top: 20px; padding: 16px; border: 1px solid var(--green); border-radius: 12px; background: var(--mint); color: var(--ink); line-height: 1.5; }
.signature-wrap { padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: white; }
#signature-pad { width: 100%; height: 190px; display: block; touch-action: none; border: 1px dashed #9eafa8; border-radius: 8px; background: #fff; }
.signature-tools { display: flex; justify-content: flex-end; margin-top: 7px; }
.text-button { border: 0; background: transparent; color: var(--green); font-weight: 800; cursor: pointer; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.button { min-height: 48px; padding: 12px 20px; border: 1px solid transparent; border-radius: 11px; font-weight: 900; cursor: pointer; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--green-2); }
.button.quiet { color: var(--green); background: white; border-color: var(--line); }
.button:disabled { opacity: .58; cursor: wait; }
.error { min-height: 1.2em; margin: 14px 0 0; color: var(--danger); font-weight: 800; }
.success { padding: 50px 20px; text-align: center; }
.success .mark { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: white; background: var(--green); font-size: 2rem; }
.success h2 { margin: 0; color: var(--green); font-family: Georgia, serif; font-size: 2.2rem; }
.success p { max-width: 600px; margin: 12px auto; color: var(--muted); line-height: 1.6; }
.reference { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--mint); color: var(--green) !important; font-weight: 900; }
.file-list { display: grid; gap: 5px; margin-top: 7px; }
.file-list small { padding: 6px 9px; border-radius: 7px; background: var(--mint); }

@media (max-width: 700px) {
  .page { width: min(100% - 16px, 1040px); margin-top: 8px; }
  .brand { padding: 5px 6px; }
  .brand img { width: 145px; }
  .brand span { display: none; }
  .hero { border-radius: 20px 20px 0 0; }
  .progress span { font-size: 0; }
  .progress span::before { content: attr(data-number); font-size: .82rem; }
  .form-shell { padding: 22px 16px; border-radius: 0 0 20px 20px; }
  .grid { grid-template-columns: 1fr; }
  .grid .wide { grid-column: auto; }
  .actions { position: sticky; bottom: 0; margin-inline: -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: rgba(255,253,249,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
  .button { flex: 1; }
}
