/* Palette lifted from the printed membership packet so the online form and the
   paper form read as the same document. */
:root {
  --navy:        #1b3a5c;
  --navy-deep:   #12283f;
  --teal:        #1a7a6e;
  --teal-dark:   #146157;
  --teal-wash:   #e8f2f0;
  --amber:       #b8860b;
  --amber-wash:  #fdf6e7;
  --ink:         #1f2933;
  --ink-soft:    #52616b;
  --line:        #d5dde3;
  --page:        #f6f8f9;
  --card:        #ffffff;
  --error:       #b3261e;
  --error-wash:  #fdecea;

  --radius:      10px;
  --shadow:      0 1px 3px rgba(18, 40, 63, .08), 0 4px 16px rgba(18, 40, 63, .06);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  /* Generous defaults: this form is read by people of every age on phones. */
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- Header ---------- */

.masthead {
  background: var(--navy);
  color: #fff;
  padding: 18px 20px;
}

.masthead-inner {
  max-width: 720px;
  margin: 0 auto;
}

.masthead .practice {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8fb8cc;
  margin: 0 0 2px;
  font-weight: 700;
}

.masthead h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ---------- Progress ---------- */

.progress-wrap {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.progress-inner {
  max-width: 720px;
  margin: 0 auto;
}

.progress-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  transition: width .3s ease;
}

/* ---------- Layout ---------- */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 120px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin: 0 0 6px;
}

h2.step-title {
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.25;
  color: var(--navy);
  letter-spacing: -.02em;
}

.blurb {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 16px;
}

/* ---------- Fields ---------- */

.field { margin-bottom: 22px; }

.field > label,
.group-label {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--navy);
  font-size: 16px;
}

.req { color: var(--teal); margin-left: 2px; }

.help {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 6px 0 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  font-size: 17px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}

input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 122, 110, .16);
}

input[aria-invalid="true"] {
  border-color: var(--error);
  background: var(--error-wash);
}

.error-text {
  color: var(--error);
  font-size: 14px;
  margin: 6px 0 0;
  font-weight: 500;
}

.row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.row-3 { grid-template-columns: 2fr 1fr 1fr; }

@media (max-width: 560px) {
  .row, .row-3 { grid-template-columns: 1fr; }
}

/* ---------- Choice cards ---------- */

.choices { display: grid; gap: 12px; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.choice:hover { border-color: var(--teal); }

.choice input {
  margin: 3px 0 0;
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.choice.selected {
  border-color: var(--teal);
  background: var(--teal-wash);
}

.choice-body { flex: 1; min-width: 0; }

.choice-title {
  font-weight: 650;
  color: var(--navy);
  font-size: 17px;
}

.choice-detail {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 3px;
}

.choice-price {
  font-size: 15px;
  color: var(--teal-dark);
  font-weight: 650;
  margin-top: 6px;
  white-space: nowrap;
}

/* ---------- Checkbox ---------- */

.check {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.check.selected { border-color: var(--teal); background: var(--teal-wash); }

.check input {
  margin: 2px 0 0;
  width: 21px;
  height: 21px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.check span { font-size: 16px; line-height: 1.5; }

/* ---------- Notices ---------- */

.notice {
  background: var(--amber-wash);
  border-left: 4px solid var(--amber);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 22px;
  font-size: 15px;
}

.notice strong { color: var(--navy-deep); }

.notice-teal {
  background: var(--teal-wash);
  border-left-color: var(--teal);
}

/* ---------- Signature ---------- */

.sig-wrap {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.sig-wrap.signed { border-style: solid; border-color: var(--teal); }

canvas.sig {
  display: block;
  width: 100%;
  height: 170px;
  touch-action: none;
  cursor: crosshair;
}

.sig-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa7b0;
  font-size: 15px;
  pointer-events: none;
}

.sig-wrap.signed .sig-hint { display: none; }

.sig-clear {
  background: none;
  border: none;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0 0;
  text-decoration: underline;
}

/* ---------- Terms table ---------- */

.terms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 15px;
}

.terms-table th,
.terms-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.terms-table th {
  color: var(--navy);
  font-weight: 650;
  width: 38%;
  background: var(--teal-wash);
}

.bullets { margin: 0 0 20px; padding-left: 20px; }
.bullets li { margin-bottom: 7px; }

.fineprint {
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--page);
  padding: 14px 16px;
  border-radius: 8px;
}

/* ---------- Repeatable ---------- */

.member-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  background: #fcfdfd;
}

.member-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.member-head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--navy);
}

.link-btn {
  background: none;
  border: none;
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.add-btn {
  width: 100%;
  padding: 14px;
  border: 1.5px dashed var(--teal);
  background: var(--teal-wash);
  color: var(--teal-dark);
  font-size: 16px;
  font-weight: 650;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- Footer nav ---------- */

.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 14px 20px;
  box-shadow: 0 -2px 12px rgba(18, 40, 63, .06);
}

.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

button.primary {
  flex: 1;
  padding: 15px 24px;
  font-size: 17px;
  font-weight: 650;
  font-family: inherit;
  color: #fff;
  background: var(--teal);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s;
}

button.primary:hover { background: var(--teal-dark); }
button.primary:disabled { background: #a8bcc4; cursor: not-allowed; }

button.secondary {
  padding: 15px 22px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

button.secondary:hover { border-color: var(--navy); }

.saved-note {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
  min-height: 18px;
}

/* ---------- Summary / done ---------- */

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.summary-row dt { color: var(--ink-soft); margin: 0; }
.summary-row dd { margin: 0; font-weight: 600; color: var(--navy); text-align: right; }

.done-mark {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--teal-wash);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 18px;
  font-weight: 700;
}

.center { text-align: center; }

.ref-box {
  background: var(--teal-wash);
  border-radius: 10px;
  padding: 18px;
  margin: 22px 0;
  text-align: center;
}

.ref-box .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal-dark);
  font-weight: 700;
}

.ref-box .code {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .08em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  margin-top: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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