:root {
  --ink: #6f68b8;
  --ink-soft: #6d7d9c;
  --line: #b5bfd3;
  --paper: #ffffff;
  --sky: #eaf1ff;
  --sky-strong: #7d98c9;
  --danger: #c03434;
  --success-bg: #eaf8ef;
  --success-text: #1f6b3a;
  --error-bg: #fdecec;
  --error-text: #8f1f1f;
  --shadow: 0 18px 40px rgba(39, 62, 102, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", Tahoma, sans-serif;
  color: #6f68b8;
  background: radial-gradient(
    circle at top right,
    #f3f7ff 0%,
    #eef3fb 35%,
    #e7edf7 100%
  );
}

.page-shell {
  padding: 28px 16px 56px;
}

.page-container {
  max-width: 1080px;
  margin: 0 auto;
}

.hero-banner {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 350px;
  background: #dbe4f5;
  box-shadow: var(--shadow);
}

.hero-banner-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 18% 24%,
      rgba(255, 255, 255, 0.36),
      transparent 45%
    ),
    radial-gradient(
      circle at 82% 78%,
      rgba(255, 255, 255, 0.24),
      transparent 42%
    );
  padding: 34px 38px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-kicker {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.hero-title {
  margin: 10px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.15;
  color: #ffffff;
  font-weight: 800;
}

.page-title {
  margin: 28px 0 22px;
  text-align: center;
  color: var(--ink);
  letter-spacing: 0.05em;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  text-transform: uppercase;
  font-weight: 800;
}

.form-card {
  background: var(--paper);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.flash {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #c7e8d3;
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid #efbcbc;
}

.form-section {
  border: 1px dashed #d8deea;
  border-radius: 16px;
  padding: 18px;
}

.form-section + .form-section {
  margin-top: 16px;
}

.section-title {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.section-optional {
  color: #9aa8c2;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}

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

.field {
  grid-column: span 12;
}

.span-2 {
  grid-column: span 2;
}
.span-3 {
  grid-column: span 3;
}
.span-4 {
  grid-column: span 4;
}
.span-5 {
  grid-column: span 5;
}
.span-6 {
  grid-column: span 6;
}
.span-8 {
  grid-column: span 8;
}
.span-9 {
  grid-column: span 9;
}
.span-12 {
  grid-column: span 12;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #314a73;
}

.required::after {
  content: " *";
  color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: #1f3152;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: transparent;
  padding: 8px 2px;
  min-height: 38px;
  outline: none;
  transition: border-color 0.16s ease;
}

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

.is-locked {
  background: #f2f5fb;
}

input:focus,
select:focus,
textarea:focus {
  border-bottom-color: var(--ink);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-bottom-color: var(--danger);
}

.birth-age-combo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: end;
  gap: 12px;
  max-width: 445px;
}

.birth-age-combo.is-invalid .birth-age-input,
.birth-age-combo.is-invalid .birth-age-age {
  border-bottom-color: var(--danger);
}

.birth-age-input {
  min-height: 38px !important;
  padding: 8px 2px !important;
}

.birth-age-age {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  font-size: 1rem;
  color: #233454;
  padding: 8px 2px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.helper {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.error-text {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--danger);
}

.form-error-text {
  margin-bottom: 10px;
}

.checkbox,
.radio {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #2c4268;
}

.checkbox input,
.radio input {
  margin-top: 3px;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

.membership-plan-card {
  margin: 0;
  border: 1px solid #d7deeb;
  border-radius: 16px;
  padding: 12px;
  display: block;
  text-transform: none;
  background: #f9fbff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.membership-plan-card:hover {
  border-color: #9bb0d8;
  box-shadow: 0 8px 20px rgba(37, 58, 96, 0.12);
  transform: translateY(-2px);
}

.membership-plan-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.membership-plan-position {
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #365a90, #2b4773);
}

.membership-plan-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.93rem;
  color: #6f68b8;
  line-height: 1.35;
}

.membership-type-checkbox {
  margin: 0;
}

.membership-plan-title {
  font-weight: 700;
}

.membership-plan-banner {
  width: 100%;
  border-radius: 12px;
  display: block;
  background: #e3eaf7;
}

.membership-plan-description {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #4c5f81;
}

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

.consent-card {
  margin-top: 16px;
  border: 1px solid #d5dceb;
  border-radius: 26px;
  background: #f1f4fa;
  padding: 16px 18px;
}

.consent-checkbox {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #2f3a51;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
}

.consent-checkbox input {
  margin-top: 4px;
}

.consent-checkbox input.is-invalid {
  outline: 2px solid rgba(192, 52, 52, 0.4);
  outline-offset: 2px;
}

.consent-checkbox a {
  color: inherit;
  text-decoration: underline;
  font-weight: 700;
}

.consent-link {
  cursor: pointer;
}

.consent-checkbox a:hover {
  color: #203f70;
}

.consent-required {
  color: var(--danger);
  font-weight: 800;
}

.actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.btn-submit {
  border: 0;
  border-radius: 999px;
  padding: 12px 30px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, #6f68b8, #6f68b8);
  cursor: pointer;
  min-width: 240px;
  box-shadow: 0 10px 22px rgba(45, 71, 113, 0.28);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #2f4e7c, #243c63);
}

.btn-submit:disabled,
.btn-submit.is-submitting {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.hidden {
  display: none;
}

@media (min-width: 1200px) {
  .child-birth-field {
    grid-column: span 6;
  }
}

@media (max-width: 960px) {
  .span-2,
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-8,
  .span-9 {
    grid-column: span 12;
  }

  .form-card {
    padding: 20px;
    border-radius: 18px;
  }

  .hero-banner {
    min-height: 180px;
    border-radius: 18px;
  }

  .hero-overlay {
    padding: 24px;
  }

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

  .membership-plan-grid {
    grid-template-columns: 1fr;
  }

  .btn-submit {
    width: 100%;
  }

  .birth-age-combo {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .birth-age-age {
    font-size: 0.92rem;
  }
}

/* membership agreement modal */
.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 26, 44, 0.64);
}

.policy-modal.is-visible {
  display: flex;
}

.policy-modal-panel {
  width: min(100%, 1120px);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(17, 25, 44, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.policy-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.policy-modal-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.policy-modal-header {
  padding: 42px 34px 28px;
  background: linear-gradient(135deg, #6f68b8, #6f68b8);
  color: #ffffff;
}

.policy-modal-header h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  font-weight: 800;
}

.policy-modal-header p {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.94);
}

.policy-modal-body {
  padding: 28px 34px;
  overflow-y: auto;
}

.policy-modal-body p {
  margin: 0 0 14px;
  color: #6f68b8;
  line-height: 1.8;
}

.policy-modal-body p strong {
  color: var(--ink);
  font-weight: 800;
  margin-right: 6px;
}

.policy-modal-body h4,
.policy-modal-body h5 {
  margin: 22px 0 10px;
  color: var(--ink);
  font-weight: 800;
}

.policy-modal-body h4 {
  font-size: 1.28rem;
}

.policy-modal-body h5 {
  font-size: 1.05rem;
}

.policy-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.policy-list li {
  position: relative;
  margin: 0 0 8px;
  padding: 10px 14px 10px 42px;
  color: #6f68b8;
  line-height: 1.75;
  border-left: 4px solid transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.policy-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #6f68b8;
  box-shadow: 0 0 0 3px rgba(54, 90, 144, 0.2);
}

.policy-list li strong {
  color: #6f68b8;
  font-weight: 800;
}

.policy-list li:hover {
  background: #eef3ff;
  border-left-color: #6f68b8;
}

.policy-modal-footer {
  padding: 16px 24px 22px;
  border-top: 1px solid #e2e8f3;
  display: flex;
  justify-content: flex-end;
  background: #ffffff;
}

.policy-modal-close-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 22px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, #6f68b8, #6f68b8);
  cursor: pointer;
}

.policy-modal-close-btn:hover {
  background: linear-gradient(135deg, #2f4e7c, #243c63);
}

.policy-modal-copyright {
  background: #6f68b8;
  color: #ffffff;
  text-align: center;
  padding: 16px 18px;
  font-size: 0.92rem;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .policy-modal {
    padding: 12px;
  }

  .policy-modal-panel {
    max-height: 95vh;
    border-radius: 18px;
  }

  .policy-modal-header {
    padding: 36px 18px 22px;
  }

  .policy-modal-body {
    padding: 20px 18px;
  }

  .policy-modal-footer {
    padding: 14px 18px 18px;
  }

  .policy-modal-close {
    top: 10px;
    right: 10px;
  }

  .policy-list li {
    padding-left: 36px;
  }

  .policy-modal-copyright {
    font-size: 0.85rem;
    padding: 14px 12px;
  }
}
