/* =====================================================================
   Test de nivel online · estilos propios (se cargan después de styles.css)
   ===================================================================== */

.test-page{background:var(--soft)}
.test-wrap{
  width:100%;
  max-width:780px;
  margin:0 auto;
  padding:48px 24px 96px;
}
@media (max-width:600px){
  .test-wrap{padding:28px 16px 88px}
}

/* ---------- pasos ---------- */
.test-steps{
  list-style:none;
  margin:0 0 20px;
  padding:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  counter-reset:tstep;
}
.test-steps li{
  counter-increment:tstep;
  font-size:.82rem;
  font-weight:600;
  color:var(--muted);
  padding-top:10px;
  border-top:4px solid var(--line);
  line-height:1.3;
}
.test-steps li::before{content:counter(tstep) ". "}
.test-steps li.is-done{border-top-color:var(--navy);color:var(--navy)}
.test-steps li.is-current{border-top-color:var(--red);color:var(--navy)}
@media (max-width:480px){
  .test-steps li{font-size:.74rem}
}

/* ---------- tarjeta ---------- */
.test-card{
  background:var(--white);
  border:1px solid var(--line);
  border-top:6px solid var(--red);
  border-radius:var(--radius);
  padding:clamp(24px,5vw,44px);
}
.test-card h1{
  font-size:clamp(1.8rem,4.6vw,2.6rem);
  margin-bottom:14px;
}
.test-card h2{
  font-size:clamp(1.4rem,3.6vw,1.9rem);
  margin-bottom:12px;
}
.test-lead{font-size:1.08rem;color:var(--muted);margin-bottom:24px}
.test-screen[hidden]{display:none!important}
.test-screen:focus{outline:none}

/* ---------- introducción ---------- */
.test-facts{
  list-style:none;
  margin:0 0 24px;
  padding:0;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.test-facts li{
  background:var(--soft);
  border-radius:var(--radius);
  padding:14px 16px;
  font-size:.92rem;
  color:var(--muted);
  line-height:1.4;
}
.test-facts strong{
  display:block;
  font-family:var(--head);
  font-size:1.35rem;
  font-weight:800;
  color:var(--navy);
}
@media (max-width:600px){
  .test-facts{grid-template-columns:1fr}
  .test-facts li{display:flex;align-items:baseline;gap:10px}
  .test-facts strong{font-size:1.15rem}
}
.test-rules{
  margin:0 0 28px;
  padding:0 0 0 20px;
  color:var(--text);
}
.test-rules li{margin-bottom:6px}

/* ---------- acciones ---------- */
.test-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  margin-top:28px;
}
.test-actions .spacer{flex:1}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.btn-red[disabled]:hover{background:var(--red)}
.link-btn{
  appearance:none;
  background:none;
  border:0;
  padding:8px 0;
  font:inherit;
  font-size:.92rem;
  font-weight:600;
  color:var(--navy);
  text-decoration:underline;
  text-underline-offset:3px;
  cursor:pointer;
}
.link-btn:hover{color:var(--red)}
@media (max-width:600px){
  .test-actions .btn{flex:1 1 auto}
  .test-actions .spacer{display:none}
}

/* ---------- pregunta ---------- */
.q-meta{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:12px;
  font-size:.9rem;
  color:var(--muted);
  margin-bottom:10px;
}
.q-meta strong{color:var(--navy)}
.q-bar{
  height:6px;
  background:var(--soft);
  border-radius:3px;
  overflow:hidden;
  margin-bottom:28px;
}
.q-bar span{
  display:block;
  height:100%;
  width:0;
  background:var(--navy);
  transition:width .25s ease;
}
.q-text{
  font-family:var(--head);
  font-weight:700;
  font-size:clamp(1.2rem,3.4vw,1.5rem);
  line-height:1.45;
  color:var(--navy);
  margin:0 0 22px;
}
.q-blank{
  display:inline-block;
  min-width:3.6em;
  border-bottom:2px solid var(--red);
  margin:0 .1em;
}
.q-options{
  border:0;
  margin:0;
  padding:0;
  display:grid;
  gap:10px;
}
.q-options legend{
  position:absolute;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
}
.q-opt{
  position:relative;
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  min-height:56px;
  border:2px solid var(--line);
  border-radius:var(--radius);
  background:var(--white);
  cursor:pointer;
  transition:border-color .12s,background-color .12s;
}
.q-opt:hover{border-color:#9AA6BF}
.q-opt input{
  position:absolute;
  opacity:0;
  width:1px;height:1px;
}
.q-letter{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:32px;height:32px;
  border-radius:50%;
  background:var(--soft);
  font-family:var(--head);
  font-weight:800;
  font-size:.9rem;
  color:var(--navy);
  text-transform:uppercase;
}
.q-label{font-size:1.05rem;line-height:1.35}
.q-opt:has(input:checked){border-color:var(--navy);background:#EEF2FA}
.q-opt:has(input:checked) .q-letter{background:var(--navy);color:var(--white)}
.q-opt:has(input:focus-visible){outline:3px solid var(--red);outline-offset:2px}
.q-opt.is-unsure{border-style:dashed}
.q-opt.is-unsure .q-label{color:var(--muted)}
.q-stop{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid var(--line);
  font-size:.9rem;
  color:var(--muted);
}
.q-stop p{margin:0}

/* ---------- formularios ---------- */
.f-group{
  border:0;
  margin:0 0 26px;
  padding:0;
}
.f-group > legend,
.f-label{
  display:block;
  font-family:var(--head);
  font-weight:700;
  color:var(--navy);
  font-size:1.02rem;
  margin-bottom:10px;
  padding:0;
}
.f-hint{font-size:.88rem;color:var(--muted);margin:-6px 0 10px}
.f-optional{font-weight:500;color:var(--muted);font-size:.88rem}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{position:relative}
.chip input{position:absolute;opacity:0;width:1px;height:1px}
.chip span{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:10px 16px;
  border:2px solid var(--line);
  border-radius:999px;
  background:var(--white);
  font-size:.95rem;
  font-weight:500;
  cursor:pointer;
  transition:border-color .12s,background-color .12s,color .12s;
}
.chip span:hover{border-color:#9AA6BF}
.chip input:checked + span{background:var(--navy);border-color:var(--navy);color:var(--white)}
.chip input:focus-visible + span{outline:3px solid var(--red);outline-offset:2px}

.f-field{margin-bottom:18px}
.f-input,
.f-select,
.f-textarea{
  display:block;
  width:100%;
  font:inherit;
  font-size:1rem;
  color:var(--text);
  background:var(--white);
  border:2px solid var(--line);
  border-radius:var(--radius);
  padding:12px 14px;
  min-height:50px;
}
.f-textarea{min-height:110px;resize:vertical}
.f-input:focus,.f-select:focus,.f-textarea:focus{border-color:var(--navy);outline:none;box-shadow:0 0 0 3px rgba(1,33,105,.15)}
.f-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:600px){.f-row{grid-template-columns:1fr;gap:0}}
.f-sub{
  background:var(--soft);
  border-radius:var(--radius);
  padding:18px;
  margin:-10px 0 26px;
}
.f-sub[hidden]{display:none}
.f-sub .f-group:last-child,.f-sub .f-field:last-child{margin-bottom:0}

.f-check{
  display:flex;
  gap:12px;
  align-items:flex-start;
  font-size:.95rem;
  line-height:1.5;
  cursor:pointer;
}
.f-check input{
  flex:none;
  width:22px;height:22px;
  margin:1px 0 0;
  accent-color:var(--navy);
}
.f-check a{color:var(--navy);font-weight:600}
.f-error{
  display:block;
  color:var(--red);
  font-size:.88rem;
  font-weight:600;
  margin-top:6px;
}
.f-error:empty{display:none}
.is-invalid{border-color:var(--red)!important}
.hp-field{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}

.form-alert{
  border-left:4px solid var(--red);
  background:#FCF1F3;
  padding:14px 16px;
  border-radius:var(--radius);
  font-size:.95rem;
  margin:0 0 20px;
}
.form-alert[hidden]{display:none}

/* ---------- enviando ---------- */
.sending{
  display:flex;
  align-items:center;
  gap:14px;
  color:var(--muted);
}
.spinner{
  width:28px;height:28px;
  border:3px solid var(--line);
  border-top-color:var(--navy);
  border-radius:50%;
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- resultado ---------- */
.result-head{
  display:flex;
  align-items:center;
  gap:24px;
  margin-bottom:22px;
}
.result-badge{
  flex:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:112px;height:112px;
  border-radius:50%;
  background:var(--navy);
  color:var(--white);
  font-family:var(--head);
  font-weight:800;
  font-size:2.6rem;
  letter-spacing:-.02em;
  box-shadow:0 0 0 6px var(--white),0 0 0 10px var(--red);
}
.result-badge.is-small{font-size:1.35rem}
.result-kicker{font-size:.92rem;color:var(--muted);margin:0 0 4px}
.result-label{font-size:clamp(1.5rem,4vw,2rem);margin:0}
.result-desc{font-size:1.08rem;margin-bottom:18px}
.result-note{
  background:var(--soft);
  border-radius:var(--radius);
  padding:16px 18px;
  font-size:.95rem;
  color:var(--muted);
  margin-bottom:8px;
}
.result-mail{font-size:.92rem;color:var(--muted);margin-top:18px}
.result-mail.is-warn{color:var(--red);font-weight:600}
@media (max-width:480px){
  .result-head{flex-direction:column;align-items:flex-start;gap:20px}
  .result-badge{width:92px;height:92px;font-size:2.1rem}
}
