:root {
  --page-bg: #e8edf4;
  --paper: #ffffff;
  --ink: #151515;
  --muted: #546174;
  --line: #111111;
  --soft-line: #cad1db;
  --label-bg: #d8d8da;
  --required-bg: #fffaa2;
  --accent: #1f5f9f;
  --accent-strong: #12467b;
  --shadow: 0 24px 60px rgba(19, 37, 62, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(31, 95, 159, 0.14), transparent 22%),
    linear-gradient(180deg, #f7f9fc 0%, var(--page-bg) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  overflow-y: auto !important;
}

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

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 32px auto 56px;
  display: grid;
  gap: 28px;
}

.paper-card {
  padding: clamp(18px, 3vw, 34px);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.form-header__titles {
  flex: 1;
  text-align: center;
}

.club-name {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 800;
}

.form-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
}

.form-header__season {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 800;
  color: var(--accent-strong);
}

.return-note {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.6rem);
  font-weight: 700;
}

.return-note a {
  color: var(--ink);
}

.club-logo {
  width: clamp(92px, 12vw, 130px);
  height: auto;
}

.helper-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 2px solid rgba(31, 95, 159, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 95, 159, 0.08), rgba(255, 250, 162, 0.25));
}

.helper-banner p,
.helper-banner output {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.helper-banner output {
  color: #153e68;
}

.helper-banner output.is-error {
  color: #a52b2b;
}

.helper-banner output.is-success {
  color: #1f6b39;
  font-weight: 800;
}

.helper-banner output.is-warning {
  color: #8a6413;
}

.helper-banner span {
  color: var(--muted);
}

.backend-status {
  margin: -4px 0 14px;
  padding: 12px 14px;
  border: 1px solid #d7dfea;
  border-radius: 14px;
  background: #f5f7fb;
  color: var(--muted);
  font-weight: 600;
}

.backend-hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.4;
}

.backend-hint code {
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #153e68;
}

.backend-status.is-ready {
  border-color: #b7dec4;
  background: #effaf2;
  color: #1f6b39;
}

.backend-status.is-warning {
  border-color: #ead39a;
  background: #fff9e8;
  color: #8a6413;
}

.backend-status.is-error {
  border-color: #efc2c2;
  background: #fff3f3;
  color: #a52b2b;
}

.sticky-abandon-bar {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 9998;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  pointer-events: none;
}

.sticky-abandon-bar .button {
  pointer-events: auto;
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid #c63d3d;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(19, 37, 62, 0.22);
  background: rgba(255, 255, 255, 0.98);
  color: #9f1f1f;
  font-weight: 800;
}

.sticky-abandon-bar .button:hover,
.sticky-abandon-bar .button:focus {
  background: #fff7f7;
  color: #7e1313;
}

@media (max-width: 782px) {
  .sticky-abandon-bar {
    right: 12px;
    left: 12px;
    bottom: 76px;
    justify-content: stretch;
  }

  .sticky-abandon-bar .button {
    width: 100%;
    justify-content: center;
  }
}

.table-card,
.table-note,
.signature-grid,
.totals-panel {
  margin-top: 14px;
}

.form-block {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #d9e0e8;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.9), rgba(255, 255, 255, 1));
}

.form-block--active {
  border-color: rgba(31, 95, 159, 0.28);
  box-shadow: 0 16px 32px rgba(19, 37, 62, 0.08);
}

.form-block__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.form-block__eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-block__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.form-block__status {
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef2f7;
  color: #153e68;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.form-block__message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 600;
}

.form-block__message[hidden] {
  display: none;
}

.form-block__message--top {
  margin-bottom: 12px;
}

.form-block__message--bottom {
  margin-top: 12px;
}

.form-block__message.is-error {
  background: #fff3f3;
  color: #a52b2b;
}

.form-block__message.is-info {
  background: #f2f7fd;
  color: #153e68;
}

.form-block__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.table-card {
  overflow: hidden;
  border: 2px solid var(--line);
}

.identity-grid {
  display: grid;
  grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
}

.row-label,
.row-field {
  min-height: 46px;
  border-bottom: 1px solid var(--line);
}

.row-label {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--label-bg);
  border-right: 2px solid var(--line);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.row-label--required,
.row-field--required {
  background: var(--required-bg);
}

.row-label.pending-required,
.row-field.pending-required,
.stack-field.pending-required input,
.stack-field.pending-required textarea,
.stack-field.pending-required select,
.choice-item.pending-required,
.pricing-label.pending-required,
.signature-canvas-wrap.pending-required {
  background: #fff4a8 !important;
}

.stack-field.pending-required {
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 244, 168, 0.45);
}

.license-panel.pending-required {
  background: rgba(255, 244, 168, 0.45);
}

.choice-item.pending-required,
.pricing-label.pending-required {
  box-shadow: inset 0 0 0 2px rgba(177, 132, 13, 0.28);
}

.choice-list.pending-required,
.table-card.pending-required {
  background: rgba(255, 244, 168, 0.2);
}

.choice-list.is-invalid {
  border-radius: 18px;
  box-shadow: inset 0 0 0 2px rgba(165, 43, 43, 0.2);
}

.pricing-value.pending-required {
  background: #fff4a8 !important;
}

.pricing-value.pending-required input[type="text"] {
  background: #fff4a8;
}

.pricing-label.is-invalid {
  background: #fff3f3;
  box-shadow: inset 0 0 0 2px rgba(165, 43, 43, 0.2);
  color: #a52b2b;
}

.signature-canvas-wrap.pending-required {
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 244, 168, 0.45);
}

.row-field {
  display: flex;
  align-items: center;
  padding: 0;
  background: #fff;
}

.row-field input:not([type="radio"]):not([type="checkbox"]),
.row-field textarea,
.license-panel select,
.signature-grid input,
.signature-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
}


.row-field textarea,
.signature-grid textarea {
  resize: vertical;
}


.row-field--choice {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-start;
  align-items: center;
  padding: 8px 12px;
}

.inline-choice,
.choice-item,
.pricing-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-choice {
  flex: 0 0 auto;
  white-space: nowrap;
}

.inline-choice input[type="radio"],
.choice-item input[type="radio"],
.choice-item input[type="checkbox"],
.pricing-label input[type="radio"],
.pricing-label input[type="checkbox"] {
  width: auto;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.table-note {
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-top: 0;
  font-size: 1rem;
}

.table-note.is-error {
  color: #a52b2b;
  border-color: #c63434;
  background: #fff1f1;
  font-weight: 700;
}

.section-heading {
  padding: 8px 12px;
  background: var(--label-bg);
  border-bottom: 2px solid var(--line);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-heading span {
  text-transform: none;
}

.pricing-table {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) repeat(3, minmax(120px, 1fr));
}

.pricing-table--three {
  grid-template-columns: minmax(0, 2.1fr) repeat(2, minmax(120px, 1fr));
}

.table-head,
.pricing-label,
.pricing-value {
  min-height: 48px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--label-bg);
  font-weight: 800;
  text-align: center;
}

.table-head--label {
  justify-content: flex-start;
  text-transform: uppercase;
}

.pricing-table--child .table-head--label,
.pricing-table--child .pricing-label--required {
  background: var(--required-bg);
}

.child-form .row-label--required {
  background: var(--label-bg);
}

.child-form .row-field--required,
.child-form .pricing-label--required {
  background: #fff;
}

.pricing-label {
  font-size: 1rem;
}

.pricing-value {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pricing-value input[type="text"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.pricing-value input[type="text"]:disabled {
  background: #eef2f7;
  color: #7b8797;
  cursor: not-allowed;
}

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

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

.license-panel {
  display: grid;
  gap: 8px;
  padding: 16px 12px;
  background: #f5f7fb;
}

.license-panel__label {
  margin: 0;
  font-weight: 700;
}

.license-display {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: #fff;
  line-height: 1.4;
}

.license-panel.is-error .license-display {
  border-color: #efc2c2;
  background: #fff3f3;
  color: #a52b2b;
}

.license-panel select {
  min-height: 48px;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: #fff;
}

.info-block {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.info-block p {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.info-block p:last-child {
  margin-bottom: 0;
}

.health-legal-title {
  font-weight: 800;
  text-transform: uppercase;
}

.health-legal-subtitle {
  font-weight: 700;
}

.health-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 10px;
}

.choice-inline--boxed {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: #fff;
}

.health-period-label {
  margin: 6px 0 10px;
  font-weight: 800;
  color: var(--accent-strong);
}

.choice-list {
  display: grid;
}

.choice-item {
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
}

.choice-item--split {
  display: grid;
  gap: 10px;
}

.choice-item--highlight {
  background: #fff4a8;
}

.choice-item--highlight.is-complete {
  background: #ffffff;
}

.choice-item span {
  flex: 1;
}

.choice-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.choice-inline label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
}

.choice-inline label.is-selected {
  background: #eef6ff;
  border-color: #7aa6d8;
  color: #12467b;
}

.choice-inline input[type="radio"] {
  accent-color: #12467b;
}

.choice-item strong {
  font-weight: 700;
  text-align: right;
}

.choice-list--payment {
  margin: 0;
  padding: 0;
  border: 0;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.signature-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.signature-grid__full {
  grid-column: 1 / -1;
}

.signature-panel,
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.stack-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.stack-field--full {
  grid-column: 1 / -1;
}

.stack-field input,
.stack-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: #fff;
}

.stack-field textarea[readonly] {
  background: #f5f7fb;
}

.signature-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.signature-canvas {
  width: 100%;
  height: 220px;
  border: 2px dashed #aab6c8;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 162, 0.2), rgba(255, 255, 255, 0.96)),
    #ffffff;
  touch-action: none;
  cursor: crosshair;
}

.signature-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.signature-grid input,
.signature-grid textarea {
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: #fff;
}

.totals-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f2944, #1f5f9f);
  color: #fff;
}

.totals-panel__label {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.totals-panel__total {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
}

.totals-panel__details {
  max-width: 560px;
}

.totals-panel__details p {
  margin: 0;
  line-height: 1.45;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  align-items: stretch;
  position: static;
  z-index: 1;
  padding: 14px;
  border: 1px solid rgba(19, 37, 62, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 1);
  box-shadow: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  text-align: center;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--accent);
  color: #fff;
}

.button--secondary {
  background: #f5f7fb;
  border-color: #d9e0ea;
  color: var(--accent-strong);
}

.button--ghost {
  background: transparent;
  border-color: #c8d0da;
  color: var(--ink);
}

.button.is-disabled,
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-actions .button {
  flex: 1 1 220px;
}

.output-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.output-card__eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.output-card__header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.output-card__header p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
}

.send-preview {
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid #dbe3ee;
}

.send-preview__code {
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: #0f172a;
  color: #d9f3ff;
  font-size: 0.95rem;
  line-height: 1.45;
}

.send-preview__code[hidden] {
  display: none;
}

.is-invalid {
  box-shadow: inset 0 0 0 2px #c63434;
  background: #fff1f1 !important;
}

#medical-status-return.is-invalid,
#medical-status-return.is-invalid:focus {
  color: #a52b2b;
}

.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 (max-width: 860px) {
  .form-header {
    flex-direction: column-reverse;
    text-align: center;
  }

  .identity-grid,
  .pricing-table,
  .output-row,
  .signature-panel,
  .delivery-grid {
    grid-template-columns: 1fr;
  }

  .row-label {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .row-field-help {
    grid-column: auto;
  }

  .pricing-value--span-3 {
    grid-column: auto;
  }

  .table-head,
  .pricing-label,
  .pricing-value {
    border-right: 0;
  }

  .choice-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #fff;
  }

  .page-shell {
    width: 100%;
    margin: 0;
  }

  .paper-card {
    box-shadow: none;
    padding: 0;
  }

  .helper-banner,
  .form-actions,
  #adhesion-form,
  #print-output {
    display: none !important;
  }
}
