:root {
  --ink: #142B22;
  --ink-soft: #435146;
  --ink-faint: #6B7A6E;
  --ground: #F4F6F1;
  --surface: #FFFFFF;
  --surface-alt: #EBEFE6;
  --line: #D8DFD2;
  --line-soft: #E6EAE1;
  --primary: #1F6F54;
  --primary-deep: #14493A;
  --primary-tint: #E4EFE8;
  --gold: #A5751F;
  --gold-tint: #F4E9D3;
  --danger: #A83A26;
  --danger-tint: #F5E2DC;
  --success: #2E7D4F;
  --shadow: 0 1px 2px rgba(20,43,34,0.06), 0 8px 24px -12px rgba(20,43,34,0.18);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", ui-serif, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); text-wrap: balance; }
p { margin: 0; }
button { font-family: inherit; }
a { color: var(--primary-deep); }

.app-shell { max-width: 640px; margin: 0 auto; padding: 0 0 64px; min-height: 100vh; }

.banner {
  background: linear-gradient(150deg, var(--primary-deep), var(--primary));
  color: #fff;
  padding: 28px 22px 30px;
}
.banner .badge {
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; opacity: .85;
}
.banner h1 { color: #fff; font-size: 24px; margin-top: 10px; line-height: 1.25; }
.banner .sub { color: rgba(255,255,255,.88); font-size: 14px; margin-top: 10px; line-height: 1.55; max-width: 46ch; }
.banner .time {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12.5px; font-weight: 700;
  background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px;
}

.progress-wrap { padding: 14px 22px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.progress-track { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 999px; transition: width .35s ease; }
.progress-label { font-size: 12px; color: var(--ink-faint); margin-top: 8px; font-weight: 600; }

.step-body { padding: 22px; }
.step { display: none; flex-direction: column; gap: 16px; }
.step.active { display: flex; }

.step-head { margin-bottom: 4px; }
.step-head .eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary-deep); }
.step-head h2 { font-size: 21px; margin-top: 6px; }
.step-head .sub { font-size: 13.8px; color: var(--ink-soft); margin-top: 6px; }

.field {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px;
  box-shadow: var(--shadow);
}
.field label.field-label {
  display: flex; align-items: baseline; gap: 4px; font-size: 13.8px; font-weight: 700; color: var(--ink);
}
.field .req { color: var(--danger); }
.field .help { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.field .err { font-size: 12.5px; color: var(--danger); margin-top: 6px; display: none; font-weight: 600; }
.field.has-error { border-color: var(--danger); }
.field.has-error .err { display: block; }

input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 11px 12px;
  font-size: 15px; color: var(--ink); background: var(--ground); font-family: inherit;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary); outline-offset: 1px; background: var(--surface);
}
input[type=file] { width: 100%; margin-top: 10px; font-size: 13.5px; }

.date-select-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; margin-top: 10px; }
.date-select-row select { margin-top: 0; }

.radio-grid, .checkbox-grid { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.radio-grid.cols-2, .checkbox-grid.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 11px 13px; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.opt:has(input:checked), .opt.opt-checked { border-color: var(--primary); background: var(--primary-tint); font-weight: 600; }
.opt input { margin: 0; accent-color: var(--primary); width: 17px; height: 17px; flex-shrink: 0; }

.reveal { border-left: 3px solid var(--gold); padding-left: 14px; margin-top: 14px; display: none; flex-direction: column; gap: 14px; }
.reveal.show { display: flex; }
.reveal-label { font-size: 10.8px; text-transform: uppercase; letter-spacing: .07em; color: var(--gold); font-weight: 700; }

.fee-card { margin-top: 4px; }
.fee-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.8px; color: var(--ink-soft); }
.fee-row:last-child { border-bottom: none; }
.fee-row.active { color: var(--primary-deep); font-weight: 700; }

.rules-list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.rules-list .r { display: flex; gap: 8px; }
.rules-list .r::before { content: "✔"; color: var(--primary); flex-shrink: 0; font-weight: 700; }

.notice { background: var(--gold-tint); border: 1px solid var(--gold); border-radius: var(--radius-s); padding: 13px 14px; font-size: 13.6px; color: #5C4315; }

.btn-row { display: flex; gap: 12px; margin-top: 6px; }
.btn {
  flex: 1; text-align: center; padding: 14px; border-radius: var(--radius-s); font-weight: 700; font-size: 15px;
  border: none; cursor: pointer; transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { background: var(--line); color: var(--ink-faint); cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink-soft); }

.loader-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 10px; text-align: center;
}
.loader-wrap p { font-size: 13.8px; color: var(--ink-soft); max-width: 34ch; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line-soft); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.2s; }
}

.confirm-wrap { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.confirm-check {
  width: 60px; height: 60px; border-radius: 50%; background: var(--primary-tint); display: flex; align-items: center;
  justify-content: center; color: var(--primary-deep); font-size: 28px;
}
.confirm-wrap h2 { font-size: 22px; }
.confirm-wrap p { font-size: 14.5px; color: var(--ink-soft); max-width: 42ch; line-height: 1.6; }

.top-error {
  background: var(--danger-tint); color: var(--danger); border-radius: var(--radius-s); padding: 12px 14px;
  font-size: 13.8px; font-weight: 600; display: none;
}
.top-error.show { display: block; }

.admin-warning {
  background: #3a1f1f; color: #ffd9d0; font-size: 12.5px; padding: 8px 22px; text-align: center; font-weight: 600;
}

@media (max-width: 420px) {
  .radio-grid.cols-2, .checkbox-grid.cols-2 { grid-template-columns: 1fr; }
}
