/* ════════════════════════════════════════════════
   AFCR — Test de fines exploratorios (modal)
   Scoped with .test- prefix. Reuses brand tokens.
   ════════════════════════════════════════════════ */

#test-modal .test-card {
  background: var(--cream);
  border-radius: var(--r-lg);
  max-width: 620px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(10, 20, 38, 0.6);
  animation: testIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes testIn { from { transform: translateY(16px) scale(0.98); } to { transform: none; } }
html[data-motion="off"] #test-modal .test-card { animation: none; }

.test-close {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px;
  border: 0; background: transparent;
  font-size: 24px; line-height: 1; color: var(--stone);
  cursor: pointer; border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 3;
}
.test-close:hover { background: rgba(10,20,38,0.06); color: var(--ink); }

/* ── Header / progress ── */
.test-head {
  padding: 36px 40px 0;
  flex-shrink: 0;
}
.test-head .eyebrow { margin-bottom: 20px; }
.test-progress {
  height: 4px; border-radius: 4px;
  background: var(--line-strong);
  overflow: hidden;
}
.test-progress-bar {
  display: block; height: 100%;
  width: 20%;
  background: var(--accent-grad);
  border-radius: 4px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.test-step-count {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--stone);
  margin-top: 12px;
}

/* ── Body ── */
.test-body {
  padding: 28px 40px 8px;
  overflow-y: auto;
  flex: 1;
}
.test-step { animation: stepIn 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes stepIn { from { transform: translateX(14px); } to { transform: none; } }
html[data-motion="off"] .test-step { animation: none; }

.test-q {
  font-family: var(--display);
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.test-help {
  font-family: var(--sans);
  font-size: 14px; color: var(--stone);
  margin: 12px 0 0;
}

/* ── Radio options ── */
.test-options {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: flex; flex-direction: column; gap: 10px;
}
.test-opt {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  cursor: pointer;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}
.test-opt:hover { border-color: var(--accent); transform: translateX(3px); }
.test-opt-text { display: flex; flex-direction: column; gap: 3px; }
.test-opt-label { font-weight: 400; }
.test-opt-sub { font-size: 12px; color: var(--stone); font-weight: 400; }
.test-opt.selected .test-opt-sub { color: var(--ink-3); }
.test-opt .test-radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex-shrink: 0; position: relative;
  transition: border-color 0.18s ease;
}
.test-opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.test-opt.selected .test-radio { border-color: var(--accent); }
.test-opt.selected .test-radio::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--accent);
}

/* ── Specialty search ── */
.test-search-wrap { position: relative; margin-top: 28px; }
.test-search {
  width: 100%;
  padding: 16px 18px 16px 46px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: #fff;
  transition: border-color 0.18s ease;
}
.test-search:focus { outline: none; border-color: var(--accent); }
.test-search-wrap svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--stone); pointer-events: none;
}
.test-list {
  list-style: none; padding: 6px; margin: 10px 0 0;
  max-height: 230px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff;
  display: flex; flex-direction: column; gap: 2px;
}
.test-list li {
  padding: 11px 14px; border-radius: 8px;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  cursor: pointer;
  transition: background 0.14s ease;
}
.test-list li:hover { background: var(--accent-soft); }
.test-list li.sel { background: var(--accent); color: #fff; }
.test-list .test-empty { color: var(--stone); cursor: default; font-style: italic; }
.test-list .test-empty:hover { background: transparent; }
.test-chosen {
  margin-top: 14px; font-family: var(--sans); font-size: 14px; color: var(--stone);
}
.test-chosen strong { color: var(--ink); }

/* ── Footer / nav ── */
.test-foot {
  flex-shrink: 0;
  padding: 20px 40px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.test-back {
  border: 0; background: transparent;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--stone); cursor: pointer;
  padding: 8px 4px;
  transition: color 0.18s ease, opacity 0.18s ease;
}
.test-back:hover { color: var(--ink); }
.test-back[disabled] { opacity: 0; pointer-events: none; }
.test-next[disabled] { opacity: 0.4; pointer-events: none; }

/* ════════ Results ════════ */
.test-result { animation: stepIn 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.test-result .test-verdict-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.test-result h3 {
  font-family: var(--display); font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.02em;
  color: var(--ink); margin: 0; text-wrap: balance;
}
.test-result .test-lede {
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  color: var(--ink-3); margin: 16px 0 0;
}

/* stacked split bar */
.test-bar {
  margin-top: 28px;
  height: 46px; border-radius: 10px; overflow: hidden;
  display: flex; background: var(--line);
}
.test-bar span {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 12px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden;
}
.test-seg-costos { background: #5C6A82; }
.test-seg-imp { background: #E8852C; }
.test-seg-gan { background: #2D8A6F; }

.test-legend {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px;
}
.test-legend div { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 13px; color: var(--ink-3); }
.test-legend i { width: 11px; height: 11px; border-radius: 3px; display: block; }

/* concrete figures */
.test-figures {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 26px;
}
.test-fig {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px; background: var(--paper);
}
.test-fig .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); }
.test-fig .v { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--ink); margin-top: 8px; letter-spacing: -0.02em; }
.test-fig .sub { font-family: var(--sans); font-size: 12px; color: var(--stone); margin-top: 4px; }

.test-disclaimer {
  font-family: var(--sans); font-size: 12px; line-height: 1.6; color: var(--stone);
  margin: 22px 0 0; padding: 14px 16px; border-radius: var(--r-md);
  background: rgba(10,20,38,0.03);
}

/* reference table (real data backing) */
.test-ref {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.test-ref-head {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--stone);
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.test-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
}
.test-ref-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--stone); font-weight: 500;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.test-ref-table td {
  padding: 11px 16px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.test-ref-table tbody tr:last-child td { border-bottom: 0; }
.test-ref-table tr.on td {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}
.test-ref-table tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* email capture */
.test-capture {
  margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line);
}
.test-capture h4 { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; }
.test-capture p { font-family: var(--sans); font-size: 13px; color: var(--stone); margin: 8px 0 0; }
.test-capture-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.test-capture-row input {
  flex: 1; min-width: 200px;
  padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  font-family: var(--sans); font-size: 14px; color: var(--ink); background: #fff;
}
.test-capture-row input:focus { outline: none; border-color: var(--accent); }
.test-capture-ok {
  font-family: var(--sans); font-size: 14px; color: #2D8A6F; font-weight: 600;
  margin-top: 14px; display: none;
}
.test-capture.done .test-capture-row { display: none; }
.test-capture.done .test-capture-ok { display: block; }
.test-restart {
  border: 0; background: transparent; color: var(--stone);
  font-family: var(--sans); font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 4px;
}
.test-restart:hover { color: var(--ink); }

/* ── Launch band on home ── */
.test-band {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #14223a 0%, #0A1426 60%, #050B17 100%);
  border-radius: var(--r-lg);
  padding: clamp(36px, 5vw, 56px);
  display: grid; grid-template-columns: 1.3fr 0.9fr; gap: clamp(32px, 5vw, 64px); align-items: center;
}
.test-band .test-band-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 70% at 85% 50%, rgba(255,122,42,0.18) 0%, transparent 60%);
}
.test-band-main { position: relative; z-index: 2; }
.test-band .eyebrow { color: var(--accent-2); }
.test-band h2 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; color: var(--cream); letter-spacing: -0.02em; line-height: 1.08; margin: 18px 0 0; max-width: 20ch; text-wrap: balance; }
.test-band p { font-family: var(--sans); font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.72); margin: 16px 0 0; max-width: 50ch; }
.test-band .test-band-cta { display: flex; align-items: center; gap: 18px; margin-top: 32px; flex-wrap: wrap; }
.test-band .test-band-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.5); }

/* result preview card (teaser, also a button) */
.test-band-preview {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 14px;
  text-align: left;
  padding: 26px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.test-band-preview:hover { transform: translateY(-3px); border-color: rgba(255,122,42,0.5); background: rgba(255,255,255,0.06); }
.tbp-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.tbp-bar { display: flex; height: 38px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.08); }
.tbp-seg { display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }
.tbp-c { background: #5C6A82; }
.tbp-i { background: #E8852C; }
.tbp-g { background: #2D8A6F; }
.tbp-note { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.78); }
.tbp-note strong { color: var(--accent-2); }
.tbp-cta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent-2); }
.tbp-cta svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.test-band-preview:hover .tbp-cta svg { transform: translateX(4px); }

/* nav entry-point highlight */
.nav-test {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent) !important;
  font-weight: 700;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}
.nav-test:hover { opacity: 1; }
.nav-test::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  flex: none;
}
.nav-test::after { content: none; }
html[data-motion="off"] .nav-test::after { animation: none; }
.nav.scrolled .nav-test, .nav.classic .nav-test { color: var(--accent) !important; }

@media (max-width: 760px) {
  .test-band { grid-template-columns: 1fr; }
  .test-head, .test-body, .test-foot { padding-left: 24px; padding-right: 24px; }
  .test-figures { grid-template-columns: 1fr; }
}