/* ============================================================
   ELIGIBILITY PAGE
   ============================================================ */

/* ---- PAGE SHELL ---- */
.elig-page {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "header  header"
    "progress progress"
    "form    sidebar";
  min-height: calc(100vh - 69px);
  align-items: start;
  background: var(--off-white);
}

@media (min-width: 901px) {
  .elig-page { align-items: start; }
  #elig-steps-wrapper { transform: none; }
  .elig-container { padding-top: 2.25rem; }
}

/* ---- HEADER ---- */
.elig-header {
  grid-area: header;
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  border-bottom: 3px solid var(--gold);
  padding: 3.5rem 2rem 3rem;
}

.elig-header .section-label { color: var(--gold); }
.elig-header h1 { color: #fff; margin: 0.5rem 0 0.5rem; font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.elig-header-sub { color: rgba(255,255,255,0.6); font-size: 0.9375rem; margin: 0; }

/* ---- PROGRESS BAR ---- */
.progress-container {
  grid-area: progress;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.progress-track {
  flex: 1;
  height: 5px;
  background: #e4dfd9;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}

/* ---- MAIN FORM AREA ---- */
.elig-container {
  grid-area: form;
  padding: 2.5rem 2.5rem 4rem;
  background: #fff;
  border-right: 1px solid var(--border);
}

/* ---- STEP TRANSITIONS ---- */
.elig-step {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

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

/* Enter animation — applied briefly via JS */
.elig-step--entering {
  opacity: 0;
  transform: translateY(18px);
}

/* Exit animation */
.elig-step--exiting {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.step-counter {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.step-question {
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.step-hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  line-height: 1.65;
}

/* ---- OPTION BUTTONS ---- */
.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1.1rem 1.25rem;
  text-align: left;
  background: var(--off-white);
  border: 2px solid var(--border);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 54px;
  position: relative;
}

.option-btn::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c0bab3;
  margin-right: 0.875rem;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.option-btn:hover {
  border-color: var(--gold);
  background: #fefae8;
}

.option-btn.selected {
  border-color: var(--gold);
  background: #fefae8;
  font-weight: 700;
}

/* Pulse on select */
@keyframes selectPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.option-btn.selected {
  animation: selectPulse 0.3s ease;
}

.option-btn.selected::before {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 3px #fefae8;
}

.option-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.option-btn { position: relative; line-height: normal; }
.step-question:focus { outline: none; }
.option-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.option-btn:has(input:checked) {
  border-color: var(--gold);
  background: #fefae8;
  font-weight: 700;
  animation: selectPulse 0.3s ease;
}
.option-btn:has(input:checked)::before {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 3px #fefae8;
}
.option-btn:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- CHECKBOXES ---- */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--off-white);
  border: 2px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 54px;
}

.checkbox-label:hover { border-color: var(--gold); background: #fefae8; }
.checkbox-label:has(input:checked) {
  border-color: var(--gold);
  background: #fefae8;
  animation: selectPulse 0.3s ease;
}

.checkbox-label input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #b8b2ab;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 1px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--gold);
  border-color: var(--gold);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid var(--navy);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox-label input:focus-visible + .checkbox-custom {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.checkbox-text { display: flex; flex-direction: column; gap: 0.2rem; }
.checkbox-text strong { color: var(--navy); font-size: 0.9375rem; }
.checkbox-text .micro { color: var(--muted); }

/* ---- FIELDS ---- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}
.field-group[hidden] { display: none; }
#payoff-date-wrap { margin-top: 1.25rem; }
#contact-anon-note { margin-top: 1rem; }
#contact-anon-note[hidden] { display: none; }
#contact-fields-wrap { margin-top: 1.25rem; }
#contact-fields-wrap[hidden] { display: none; }
.contact-fields-hint { margin: 0 0 0.85rem; }

.field-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--navy);
}

.required-mark { color: #b91c1c; margin-left: 2px; }
.optional-mark { font-weight: 400; color: var(--muted); font-size: 0.8125rem; }

.field-select,
.field-input {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--navy);
  background: #fff;
  border: 2px solid #c8c3bc;
  border-radius: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5856' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.field-select:focus, .field-input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.18);
}

.field-select.input-error, .field-input.input-error { border-color: #b91c1c; }

.field-error {
  display: block;
  font-size: 13px;
  color: #b91c1c;
  margin-top: 0.25rem;
}

.contact-fields { margin-bottom: 1rem; }

/* ---- ERRORS ---- */
.step-error {
  display: block;
  color: #b91c1c;
  font-size: 13px;
  padding: 0.5rem 0.75rem;
  background: #fff0f0;
  border-left: 3px solid #b91c1c;
  margin-top: 0.5rem;
}
.step-error[hidden] { display: none; }

/* ---- STEP NAV ---- */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--sans);
  padding: 0.5rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-back:hover { color: var(--navy); }
.btn-back:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- CONSENT ---- */
.consent-notice {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.65;
}
.consent-notice a { color: var(--navy); }
.consent-notice a:hover { color: var(--gold); }

/* ---- RESULT PANEL ---- */
@keyframes resultReveal {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

.elig-result {
  background: var(--white);
  border-top: 4px solid var(--gold);
  padding: 3rem 2.5rem;
  animation: resultReveal 0.5s ease forwards;
}
.elig-result[hidden] { display: none; }

.result-inner { max-width: 540px; }

.result-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.3rem 0.875rem;
  border-radius: 2px;
  margin-bottom: 1.25rem;
}

.result-high         { background: #d1fae5; color: #065f46; }
.result-review       { background: #fef9c3; color: #713f12; }
.result-unlikely     { background: #fee2e2; color: #991b1b; }
.result-may-qualify   { background: #dbeafe; color: #1e40af; }
.result-disqualified { background: #e5e7eb; color: #374151; }

.result-heading {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--navy);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.result-body {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
  line-height: 1.75;
}

.result-details {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-bottom: 2rem;
}
.result-details p { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.5rem; }
.result-details a { color: var(--navy); }

.result-actions { display: flex; gap: 0.875rem; flex-wrap: wrap; }

/* ---- SIDEBAR ---- */
.elig-sidebar {
  grid-area: sidebar;
  background: var(--navy);
  border-left: 1px solid rgba(255,255,255,0.06);
  align-self: stretch;
}

.sidebar-inner {
  padding: 2.25rem 1.75rem;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.45) transparent;
}

.sidebar-progress-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.75rem;
}

/* ---- STEP TRACKER ---- */
.step-track-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.track-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  position: relative;
}

/* Indicator column: circle + connecting line */
.track-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 32px;
}

.track-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  transition: all 0.25s;
  background: transparent;
}

.track-line {
  width: 2px;
  flex: 1;
  min-height: 28px;
  background: rgba(255,255,255,0.1);
  margin: 4px 0;
}

/* Content column */
.track-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 1.75rem;
  padding-top: 4px;
}

.track-title {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  color: rgba(255,255,255,0.28);
  line-height: 1.2;
  transition: color 0.25s;
}

.track-desc {
  font-size: 11.5px;
  color: rgba(255,255,255,0.2);
  line-height: 1.4;
  transition: color 0.25s;
}

/* Last step — no connecting line */
.track-step:last-child .track-content { padding-bottom: 0; }

/* COMPLETED */
.track-step--done .track-circle {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-size: 15px;
  line-height: 1;
}

.track-step--done .track-title { color: rgba(255,255,255,0.5); }
.track-step--done .track-desc  { color: rgba(255,255,255,0.28); }
.track-step--done .track-line  { background: var(--gold); opacity: 0.5; }

/* ACTIVE */
.track-step--active .track-circle {
  border-color: var(--gold);
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.1);
}

.track-step--skipped .track-circle {
  color: rgba(255,255,255,0.55);
  border-color: rgba(255,255,255,0.28);
  background: transparent;
}
.track-step--skipped .track-title { color: rgba(255,255,255,0.4); }
.track-step--skipped .track-line { background: rgba(255,255,255,0.16); }

.track-step--active .track-title { color: #fff; }
.track-step--active .track-desc  { color: rgba(255,255,255,0.55); }

/* ---- SIDEBAR FOOTER ---- */
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 1.5rem 0; }
.sidebar-disclaimer { font-size: 12px; color: rgba(255,255,255,0.28) !important; line-height: 1.65; }

@media (min-width: 901px) {
  .sidebar-inner {
    max-height: calc(100vh - 108px);
    padding: 0.7rem 1rem 0.6rem;
  }
  .sidebar-progress-label { margin-bottom: 0.4rem; }
  .track-step { gap: 0.45rem; }
  .track-indicator { width: 20px; }
  .track-circle { width: 20px; height: 20px; font-size: 10px; }
  .track-line { min-height: 2px; margin: 1px 0; }
  .track-content { padding-bottom: 0.15rem; padding-top: 0; }
  .track-title { font-size: 0.72rem; line-height: 1.15; }
  .track-step--done .track-circle { font-size: 11px; }
  .track-step--active .track-circle { box-shadow: 0 0 0 2px rgba(201,168,76,0.14); }
  .sidebar-divider { margin: 0.4rem 0; }
  .sidebar-disclaimer { font-size: 10.5px; line-height: 1.35; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .elig-page {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "progress" "form";
  }
  .elig-sidebar { display: none; }
  .elig-container { border-right: none; padding: 2rem 1.25rem 3rem; }
  #elig-steps-wrapper { transform: none !important; padding-bottom: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .elig-step,
  .elig-step--exiting,
  #elig-steps-wrapper,
  .progress-fill,
  .track-circle,
  .track-title,
  .track-line {
    transition: none !important;
  }
  .elig-step--entering { opacity: 1; transform: none; }
  .sidebar-inner { scroll-behavior: auto; }
}

@media (max-width: 480px) {
  .elig-header { padding: 2.5rem 1.25rem 2rem; }
  .step-nav .btn-primary { flex: 1; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; text-align: center; }
}

/* ---- INTERSTITIAL STOPS (not numbered steps) ---- */
.elig-stop[hidden],
.step-main[hidden] { display: none; }
.elig-stop .step-hint { font-size: 1.05rem; color: var(--navy); line-height: 1.7; max-width: 38rem; }
.elig-stop .step-hint a { color: var(--navy); font-weight: 700; text-underline-offset: 2px; }
.elig-stop .step-hint a:hover { color: var(--gold); }
.elig-stop-nav { align-items: center; flex-wrap: wrap; gap: 1rem; }
.elig-stop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-left: auto; }
.elig-stop-actions .btn { white-space: normal; line-height: 1.35; letter-spacing: 0.04em; }
@media (max-width: 700px) {
  .elig-stop-actions { margin-left: 0; width: 100%; }
  .elig-stop-actions .btn { width: 100%; }
}
