:root {
  --navy-950: #0b2638;
  --navy-900: #123b55;
  --navy-800: #194b67;
  --teal-700: #1e6970;
  --teal-100: #dff1f0;
  --blue-50: #f2f7f8;
  --ink: #14222c;
  --muted: #5e6c75;
  --line: #cbd7dc;
  --white: #ffffff;
  --gold: #e9aa36;
  --gold-soft: #fff4d8;
  --red: #a4362e;
  --red-soft: #fff0ee;
  --green: #27724d;
  --shadow: 0 14px 36px rgba(15, 48, 66, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 85% -10%, rgba(30, 105, 112, 0.13), transparent 31rem),
    var(--blue-50);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
canvas:focus-visible {
  outline: 3px solid rgba(233, 170, 54, 0.72);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--navy-950);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(203, 215, 220, 0.78);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner,
main {
  width: min(100% - 32px, 1040px);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.brand h1,
.brand p,
.intro h2,
.intro p,
.section-heading h2,
.section-heading p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(1.03rem, 2vw, 1.3rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.eyebrow,
.step-kicker {
  color: var(--teal-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.privacy-badge {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #b9d9d6;
  border-radius: 999px;
  background: #effaf8;
  color: #225d55;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.privacy-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2e8c67;
  box-shadow: 0 0 0 4px rgba(46, 140, 103, 0.12);
}

main {
  padding: 38px 0 calc(120px + env(safe-area-inset-bottom));
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 30px;
}

.intro h2 {
  max-width: 760px;
  margin-top: 5px;
  color: var(--navy-950);
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.intro p:not(.eyebrow) {
  max-width: 700px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.05rem;
}

.autosave-status {
  min-width: 145px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.84);
}

.step-tab {
  position: relative;
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.step-tab:last-child {
  border-right: 0;
}

.step-tab span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--navy-900);
  font-size: 0.8rem;
  font-weight: 800;
}

.step-tab strong {
  font-size: 0.84rem;
}

.step-tab.is-current {
  background: var(--navy-900);
  color: white;
}

.step-tab.is-current span {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy-950);
}

.step-tab.is-complete {
  background: #edf7f4;
  color: #255d4a;
}

.step-tab.is-complete span {
  border-color: #4c9477;
  background: #4c9477;
  color: white;
}

.step-panel {
  min-height: 420px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.step-panel[hidden] {
  display: none;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  color: var(--navy-950);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.section-heading > p {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

.required-star {
  color: var(--red);
  font-weight: 800;
}

.form-card {
  margin-top: 22px;
  padding: clamp(17px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fcfdfd;
}

.form-card:first-child {
  margin-top: 0;
}

.form-card.emphasis {
  border-color: #b7d8d6;
  background: #f3fbfa;
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-heading h3,
.card-heading p {
  margin: 0;
}

.card-heading h3 {
  color: var(--navy-900);
  font-size: 1.12rem;
}

.card-heading p {
  max-width: 520px;
  color: var(--muted);
  font-size: 0.88rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
}

.span-7 {
  grid-column: span 7;
}

.span-6 {
  grid-column: span 6;
}

.span-5 {
  grid-column: span 5;
}

.span-4 {
  grid-column: span 4;
}

.span-3 {
  grid-column: span 3;
}

.span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > label,
.group-label {
  color: #30434f;
  font-size: 0.86rem;
  font-weight: 720;
}

.helper {
  color: var(--muted);
  font-size: 0.78rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1.5px solid #aebfc7;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-size: 16px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

textarea {
  min-height: 126px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 4px rgba(30, 105, 112, 0.12);
  outline: 0;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--red);
  background: var(--red-soft);
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice {
  position: relative;
  min-width: 112px;
  flex: 1 1 128px;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice label {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1.5px solid #b6c5cb;
  border-radius: 10px;
  background: white;
  color: #33454f;
  font-size: 0.9rem;
  font-weight: 690;
  text-align: center;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
  cursor: pointer;
}

.choice input:checked + label {
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: white;
}

.choice input:focus-visible + label {
  outline: 3px solid rgba(233, 170, 54, 0.72);
  outline-offset: 2px;
}

.choice input[aria-invalid="true"] + label {
  border-color: var(--red);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.check-row input {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--navy-900);
}

.check-row label {
  flex: 1;
  font-weight: 650;
}

.check-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(250px, 1.15fr);
  align-items: center;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid #e1e8eb;
}

.question-row:last-child {
  border-bottom: 0;
}

.question-row > .group-label {
  font-size: 0.93rem;
}

.seat-tabs {
  display: flex;
  overflow-x: auto;
  gap: 9px;
  margin: -4px 0 20px;
  padding: 4px 1px 7px;
  scrollbar-width: thin;
}

.seat-tab {
  min-width: 112px;
  min-height: 45px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--navy-900);
  font-weight: 760;
}

.seat-tab.is-current {
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: white;
}

.remove-seat {
  color: var(--red);
}

.signature-pad {
  overflow: hidden;
  border: 1.5px solid #9fb4bd;
  border-radius: 12px;
  background:
    linear-gradient(to bottom, transparent calc(100% - 36px), #b7c6cc calc(100% - 35px), transparent calc(100% - 34px)),
    repeating-linear-gradient(
      0deg,
      rgba(18, 59, 85, 0.018) 0,
      rgba(18, 59, 85, 0.018) 1px,
      transparent 1px,
      transparent 17px
    ),
    white;
}

.signature-pad.has-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(164, 54, 46, 0.12);
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: 156px;
  touch-action: none;
  cursor: crosshair;
}

.signature-pad.initials canvas {
  height: 112px;
}

.signature-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border-top: 1px solid var(--line);
  background: #f5f8f9;
  color: var(--muted);
  font-size: 0.78rem;
}

.signature-toolbar button {
  min-height: 35px;
  padding: 5px 10px;
  border: 1px solid #aebfc7;
  border-radius: 8px;
  background: white;
  color: var(--navy-900);
  font-weight: 750;
}

.waiver {
  max-height: 390px;
  overflow: auto;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
  color: #2b3a44;
  font-size: 0.91rem;
}

.waiver h3 {
  margin: 0 0 12px;
  color: var(--navy-900);
}

.waiver ul {
  margin: 0;
  padding-left: 22px;
}

.waiver li + li {
  margin-top: 12px;
}

.notice {
  display: flex;
  align-items: start;
  gap: 12px;
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  border-radius: 4px 10px 10px 4px;
  background: var(--gold-soft);
  color: #5c431b;
}

.notice strong {
  color: #3d2a0c;
}

.conditional {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px dashed #b6c5cb;
}

.conditional[hidden] {
  display: none;
}

.review-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border: 1px solid #b7d8d6;
  border-radius: 14px;
  background: #f1faf8;
}

.review-score {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-900);
  color: white;
  font-size: 1.25rem;
  font-weight: 850;
}

.review-hero h3,
.review-hero p {
  margin: 0;
}

.review-hero p {
  margin-top: 4px;
  color: var(--muted);
}

.missing-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--red);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.summary-item small {
  display: block;
  color: var(--muted);
}

.summary-item strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--navy-900);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.pdf-result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #a8cfbb;
  border-radius: 12px;
  background: #eef9f2;
}

.pdf-result[hidden] {
  display: none;
}

.pdf-result h3,
.pdf-result p {
  margin: 0;
}

.pdf-result p {
  margin-top: 4px;
  color: #3d674e;
}

.form-actions {
  position: sticky;
  z-index: 10;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  margin: 18px auto 0;
  padding: 12px;
  border: 1px solid rgba(183, 199, 206, 0.9);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(10, 38, 56, 0.18);
  backdrop-filter: blur(14px);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-weight: 780;
  text-decoration: none;
}

.button.compact {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 0.88rem;
}

.button.primary {
  background: var(--navy-900);
  color: white;
}

.button.primary:hover {
  background: var(--navy-800);
}

.button.secondary {
  border-color: #9fb2ba;
  background: white;
  color: var(--navy-900);
}

.button.secondary:hover {
  border-color: var(--navy-900);
  background: #f5f9fa;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--navy-900);
}

.button.danger {
  background: var(--red);
  color: white;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  max-width: min(390px, calc(100vw - 36px));
  padding: 12px 16px;
  transform: translateY(22px);
  border-radius: 10px;
  background: var(--navy-950);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(8, 28, 42, 0.3);
}

dialog::backdrop {
  background: rgba(9, 31, 44, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-card {
  padding: 27px;
}

.dialog-card h2 {
  margin: 5px 0 8px;
  color: var(--navy-950);
}

.dialog-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 780px) {
  .header-inner,
  main {
    width: min(100% - 22px, 1040px);
  }

  .privacy-badge {
    font-size: 0;
  }

  .privacy-badge::after {
    content: "Private";
    font-size: 0.8rem;
  }

  .intro {
    grid-template-columns: 1fr;
  }

  .autosave-status {
    justify-self: start;
  }

  .step-tab {
    min-height: 55px;
    flex-direction: column;
    gap: 3px;
  }

  .step-tab strong {
    font-size: 0.7rem;
  }

  .step-tab span {
    width: 24px;
    height: 24px;
  }

  .question-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    position: relative;
  }

  .header-inner {
    min-height: 74px;
  }

  .brand img {
    width: 50px;
    height: 50px;
  }

  main {
    padding-top: 24px;
  }

  .intro h2 {
    font-size: 2rem;
  }

  .stepper {
    position: sticky;
    z-index: 15;
    top: 8px;
  }

  .step-tab strong {
    display: none;
  }

  .step-panel {
    padding: 19px 15px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading > p {
    text-align: left;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  [class*="span-"] {
    grid-column: 1;
  }

  .choice {
    min-width: 100px;
    flex-basis: 115px;
  }

  .card-heading {
    flex-direction: column;
  }

  .summary-grid,
  .pdf-actions {
    grid-template-columns: 1fr;
  }

  .review-hero {
    grid-template-columns: 1fr;
  }

  .form-actions {
    grid-template-columns: 1fr 1fr;
  }

  #save-draft {
    display: none;
  }

  .button {
    padding-inline: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .site-header,
  .intro,
  .stepper,
  .form-actions {
    display: none;
  }

  body,
  main {
    background: white;
  }

  main {
    width: 100%;
    padding: 0;
  }

  .step-panel {
    border: 0;
    box-shadow: none;
  }
}
