/* ============================================================
   Eligibility checker - concept redesign.

   A from-scratch presentation layer for design-concepts/eligibility-
   checker-concept.js, built entirely on this site's own design system
   (design-concepts/styles.css: --heading/--sub/--accent/--card-*/--btn-*
   tokens, plus its real .card/.btn/.btn-primary/.btn-line components)
   instead of inheriting or retinting the production widget's markup.
   No dependency on public/styles.css. All classes are prefixed `ec-`.
   ============================================================ */

.ec-shell { color: var(--body); }
.ec-shell h2, .ec-shell h3, .ec-shell h4 { color: var(--heading); font-family: var(--font-sans); }
.ec-shell p { margin: 0; }

.ec-kicker,
.ec-eyebrow,
.ec-eyebrow-sm {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 8px;
}

/* ---------- Top bar: step tracker + start over ---------- */
.ec-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.ec-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ec-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
}

.ec-step-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--alt-bg);
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
  flex: none;
}

.ec-step.is-active {
  background: rgba(0, 128, 128, .1);
  color: var(--heading);
}
.ec-step.is-active .ec-step-num,
.ec-step.is-complete .ec-step-num {
  background: var(--btn-primary-bg);
  color: #fff;
}
.ec-step.is-complete { color: var(--heading); }

.ec-clear { margin-left: auto; }

/* ---------- Header ---------- */
.ec-header { max-width: 640px; margin-bottom: 24px; }
.ec-header h2 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; font-weight: 800; }
.ec-header-body { color: var(--sub); font-size: 14.5px; }

.ec-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--grey);
  overflow: hidden;
  margin-top: 18px;
}
.ec-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--btn-primary-bg);
  transition: width .3s ease;
}

/* ---------- Panel that hosts each stage ---------- */
.ec-form { display: block; }
.ec-panel { padding: clamp(22px, 4vw, 36px); }

/* ---------- Purpose picker (Choose) ---------- */
.ec-intro h3 { font-size: 22px; margin: 0 0 8px; }
.ec-intro-body { color: var(--sub); font-size: 14.5px; margin-bottom: 22px !important; }

.ec-purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.ec-purpose-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.ec-purpose-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0,128,128,.14);
  border-color: rgba(0,128,128,.4);
}
.ec-purpose-card.is-active {
  border-color: var(--accent);
  background: rgba(0, 128, 128, .06);
}
.ec-purpose-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34,184,184,.16), rgba(0,112,112,.1));
  color: var(--accent);
}
.ec-purpose-icon svg { width: 20px; height: 20px; }
.ec-purpose-card strong { display: block; font-size: 15.5px; color: var(--heading); margin-bottom: 4px; }
.ec-purpose-desc { display: block; color: var(--sub); font-size: 13.5px; margin-bottom: 10px; }
.ec-purpose-example { color: var(--sub); font-size: 12px; line-height: 1.4; }

/* ---------- Question stage (Answer) ---------- */
.ec-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--sub);
}
.ec-question-meta strong { color: var(--accent); text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; font-weight: 700; }
.ec-question-copy h3 { font-size: 21px; margin: 0 0 8px; }
.ec-question-help { color: var(--sub); font-size: 14px; margin-bottom: 24px !important; line-height: 1.5; }
.ec-question-control { margin-bottom: 8px; }

/* ---------- Choice cards ---------- */
.ec-choice-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ec-choice {
  flex: 1 1 170px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: var(--radius-card);
  border: var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--heading);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.ec-choice:hover, .ec-choice:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,128,128,.14);
  border-color: rgba(0,128,128,.45);
  outline: none;
}
.ec-choice.is-active { background: rgba(0,128,128,.08); border-color: var(--accent); }
.ec-choice[disabled] { opacity: .5; pointer-events: none; box-shadow: none; }
.ec-choice-check {
  flex: none;
  color: var(--accent);
  font-weight: 800;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
}
.ec-choice.is-active .ec-choice-check { opacity: 1; transform: scale(1); }

/* ---------- Text / number / currency inputs ---------- */
.ec-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(0,128,128,.22);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--heading);
}
.ec-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ec-currency {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(0,128,128,.22);
  background: #fff;
}
.ec-currency-prefix { color: var(--sub); font-weight: 600; margin-right: 4px; }
.ec-currency .ec-input { border: none; padding: 0; min-height: auto; }
.ec-currency .ec-input:focus,
.ec-currency .ec-input:focus-visible {
  outline: none;
  box-shadow: none;
}
.ec-currency:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Address lookup ---------- */
.ec-address { display: grid; gap: 10px; }
.ec-address-status {
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.45;
}
.ec-address-list {
  display: grid;
  gap: 8px;
}
.ec-address-suggestion {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0,128,128,.18);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  color: var(--heading);
  cursor: pointer;
}
.ec-address-suggestion:hover,
.ec-address-suggestion:focus-visible {
  border-color: rgba(0,128,128,.38);
  box-shadow: 0 8px 20px rgba(0,128,128,.1);
}
.ec-address-suggestion strong { font-size: 14px; line-height: 1.3; }
.ec-address-suggestion span { color: var(--sub); font-size: 12.5px; }
.ec-address-manual {
  border: 1px solid rgba(0,128,128,.16);
  border-radius: 12px;
  background: rgba(0,128,128,.04);
  overflow: hidden;
}
.ec-address-manual summary {
  padding: 11px 14px;
  color: var(--heading);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.ec-address-manual summary::-webkit-details-marker { display: none; }
.ec-address-manual-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}
.ec-address-manual-body p {
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0 !important;
}
.ec-address-manual-body .ec-input { min-height: 46px; }

/* ---------- Date picker ---------- */
.ec-date { position: relative; }
.ec-date-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 0 16px;
  min-height: 52px;
  border-radius: 14px;
  border: 1.5px solid rgba(0,128,128,.22);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ec-date-field.is-open { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0,128,128,.14); }
.ec-date-input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--heading);
  min-width: 0;
}
.ec-date-input:focus-visible { outline: none; }
.ec-date-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: rgba(0,128,128,.1);
  color: var(--accent);
  cursor: pointer;
}
.ec-date-toggle svg { width: 18px; height: 18px; }
.ec-date-toggle.is-open, .ec-date-toggle:hover { background: var(--btn-primary-bg); color: #fff; }

.ec-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(320px, 92vw);
  padding: 14px;
  border-radius: 18px;
  border: var(--card-border);
  background: #fff;
  box-shadow: var(--shadow, 0 18px 55px rgba(15,34,64,.14));
}
.ec-date-panel-header { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 8px; margin-bottom: 10px; }
.ec-date-nav {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--alt-bg);
  color: var(--heading);
  cursor: pointer;
  font-weight: 700;
}
.ec-date-nav:hover { background: rgba(0,128,128,.1); color: var(--accent); }
.ec-date-period { display: flex; justify-content: center; align-items: baseline; gap: 6px; font-weight: 700; color: var(--heading); }
.ec-date-year { color: var(--sub); font-size: 13px; font-weight: 600; }
.ec-date-weekdays, .ec-date-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.ec-date-weekdays { margin-bottom: 4px; }
.ec-date-weekdays span { text-align: center; font-size: 11px; font-weight: 700; color: var(--sub); }
.ec-date-day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--heading);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.ec-date-day:hover { background: rgba(0,128,128,.1); }
.ec-date-day.is-outside { color: var(--grey); }
.ec-date-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.ec-date-day.is-selected { background: var(--btn-primary-bg); color: #fff; }

/* ---------- Field label/hint (shared) ---------- */
.ec-field-hint { color: var(--sub); font-size: 12.5px; margin-top: 8px !important; line-height: 1.5; }

/* ---------- Actions row ---------- */
.ec-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 28px; }
.ec-actions .btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Review stage (Check) ---------- */
.ec-review h3 { font-size: 22px; margin: 0 0 8px; }
.ec-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin: 24px 0 4px;
}
.ec-review-chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ec-review-chip:hover { transform: translateY(-2px); border-color: rgba(0,128,128,.4); box-shadow: 0 10px 24px rgba(0,128,128,.12); }
.ec-review-chip span { color: var(--sub); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.ec-review-chip strong { color: var(--heading); font-size: 14.5px; }

/* ---------- Result stage (Next step) ---------- */
.ec-result-empty { display: flex; gap: 16px; align-items: flex-start; }
.ec-result-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,128,128,.1);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.ec-result-empty h3 { font-size: 19px; margin: 0 0 6px; }
.ec-result-empty-copy { color: var(--sub); font-size: 14px; line-height: 1.5; }
.ec-missing-list { margin: 16px 0 0; padding-left: 18px; color: var(--sub); font-size: 13px; }

.ec-result h3 { font-size: 22px; margin: 0 0 8px; }
.ec-result > p { color: var(--sub); font-size: 14.5px; margin-bottom: 18px !important; }

.ec-result-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ec-result-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.ec-result.is-refer .ec-result-badge { background: linear-gradient(135deg, #E4B563, #C7963A); }
.ec-result.is-fail .ec-result-badge { background: linear-gradient(135deg, #D97C63, #C0563F); }

.ec-result-callout {
  background: var(--alt-bg);
  border: var(--card-border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.ec-result-callout span { display: block; color: var(--sub); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ec-result-callout strong { color: var(--heading); font-size: 15px; }

.ec-result-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.ec-meta-label { display: block; color: var(--sub); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ec-result-meta strong { color: var(--heading); font-size: 14.5px; }

.ec-result-section { margin-bottom: 20px; }
.ec-result-section h4 { color: var(--heading); font-size: 15px; margin: 0 0 12px; }
.ec-offer-grid, .ec-document-list { display: grid; gap: 12px; }
.ec-offer-card, .ec-document-card, .ec-fallback-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
}
.ec-offer-card strong, .ec-fallback-card strong { color: var(--heading); display: block; margin-bottom: 6px; }
.ec-offer-card p, .ec-fallback-card p { color: var(--sub); font-size: 13px; margin: 0 0 6px !important; }
.ec-offer-card span, .ec-fallback-card span { color: var(--accent); font-weight: 700; font-size: 12.5px; }
.ec-document-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ec-document-topline strong { color: var(--heading); font-size: 14px; }
.ec-document-topline span { text-transform: capitalize; font-size: 12px; font-weight: 700; color: var(--accent); }
.ec-document-card.is-missing .ec-document-topline span { color: #C0563F; }
.ec-document-card p { color: var(--sub); font-size: 12.5px; margin: 0 !important; }

.ec-result-details { margin-bottom: 18px; }
.ec-result-details summary { color: var(--accent); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.ec-reasons { margin: 12px 0 0; padding-left: 18px; color: var(--sub); font-size: 13px; line-height: 1.6; }

.ec-call-btn svg { width: 16px; height: 16px; margin-right: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .ec-purpose-grid, .ec-review-grid { grid-template-columns: 1fr; }
  .ec-actions { flex-direction: column-reverse; }
  .ec-actions .btn { width: 100%; justify-content: center; }
  .ec-clear { margin-left: 0; }
}
