/* ===========================================================================
   autoescuela.io — test web (/test-dgt-online) y layout público.
   Complementa landing.css (variables, .btn, .hdr, .foot). Móvil primero.
   =========================================================================== */

.page-publico { display: flex; flex-direction: column; min-height: 100vh; }
.page-publico .hdr { position: static; background: var(--navy); }
.tw .btn, .cta-web .btn { white-space: normal; text-align: center; }
.pub-main { flex: 1; background: var(--bg-alt); padding: 20px 0 48px; }

.tw { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.tw h1 { font-size: clamp(26px, 6vw, 38px); line-height: 1.15; }
.tw .tw-lead { margin-top: 10px; font-size: 17px; line-height: 1.5; }
.tw-eyebrow { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b45309; margin-bottom: 8px; }

.tw-aviso { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #57430f; font-size: 15px; }
.tw-continuar { margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: 15.5px; color: var(--ink); }

/* ── Elegir test ─────────────────────────────────────────────────────── */
.tw-modos { display: grid; gap: 12px; margin-top: 22px; }
.tw-modo { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px 18px;
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tw-modo:hover, .tw-modo:focus-visible { border-color: var(--amber); transform: translateY(-1px); box-shadow: var(--shadow); outline: none; }
.tw-modo strong { display: block; font-size: 19px; color: var(--ink); letter-spacing: -0.01em; }
.tw-modo span { display: block; margin-top: 2px; font-size: 15px; color: var(--text); }
.tw-modo.destacado { border-color: var(--amber); background: linear-gradient(100deg, #fff7e6, #fffdf7); }
.tw-legal { margin-top: 16px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.tw-legal a { text-decoration: underline; }
.tw-ventajas { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15.5px; }
.tw-ventajas li::before { content: "✓"; color: var(--wa-dk); font-weight: 700; margin-right: 8px; }

/* ── Pregunta ────────────────────────────────────────────────────────── */
.tw-progreso { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--ink); }
.tw-barra { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.tw-barra > span { display: block; height: 100%; border-radius: 99px; background: var(--amber); }

.tw-card { background: #fff; border: 1px solid var(--line-2); border-radius: 16px; padding: 20px 18px; box-shadow: var(--shadow-sm); }
.tw-card h1, .tw-card h2.tw-enunciado { font-size: 19px; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; }
.tw-img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; margin-bottom: 14px; background: var(--bg-alt); }

.tw-opts { display: flex; flex-direction: column; gap: 10px; }
.tw-opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; min-height: 52px;
  padding: 14px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fafbfd;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink); }
button.tw-opt { cursor: pointer; transition: border-color .15s, background .15s; }
button.tw-opt:hover, button.tw-opt:focus-visible { border-color: var(--navy-3); background: var(--bg-tint); outline: none; }
.tw-opt .letra { font-weight: 700; flex-shrink: 0; }
.tw-opt.ok { background: #ecfdf5; border-color: #34d399; }
.tw-opt.ko { background: #fef2f2; border-color: #f87171; }
.tw-opt .marca { margin-left: auto; flex-shrink: 0; font-size: 13px; font-weight: 700; }
.tw-opt.ok .marca { color: #047857; }
.tw-opt.ko .marca { color: #b91c1c; }

.tw-veredicto { margin: 16px 0 0; font-size: 18px; font-weight: 700; }
.tw-veredicto.ok { color: #047857; }
.tw-veredicto.ko { color: #b91c1c; }
.tw-exp { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; font-size: 15.5px; line-height: 1.5; color: #57430f; }
.tw-sig { margin-top: 18px; }
.tw-sig .btn { width: 100%; justify-content: center; }

/* ── Resultado ───────────────────────────────────────────────────────── */
.tw-res { background: linear-gradient(160deg, #0b2e5c, #14396f); color: #fff; border-radius: 18px; padding: 28px 20px; text-align: center; }
.tw-res .tw-apto { display: inline-block; padding: 6px 16px; border-radius: 99px; font-size: 15px; font-weight: 800; letter-spacing: .08em; margin-bottom: 12px; }
.tw-res .tw-apto.si { background: #34d399; color: #053b2a; }
.tw-res .tw-apto.no { background: #f87171; color: #450a0a; }
.tw-res .tw-nota { font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.tw-res .tw-desglose { margin-top: 10px; font-size: 16px; color: #dbe7f5; }
.tw-res p { margin-top: 12px; color: #b8c9de; font-size: 16px; line-height: 1.5; }
.tw-acciones { display: grid; gap: 10px; margin-top: 18px; }
.tw-acciones .btn { width: 100%; justify-content: center; }
.tw-sec { margin-top: 12px; text-align: center; font-size: 15px; }
.tw-sec a { text-decoration: underline; color: var(--ink); font-weight: 600; }

.tw-oferta { margin-top: 18px; padding: 20px 18px; border-radius: 16px; background: linear-gradient(100deg, #fff7e6, #fffdf7); border: 1px solid #fbe3b3; }
.tw-oferta h2 { font-size: 20px; margin-bottom: 6px; }
.tw-oferta p { font-size: 15.5px; color: #5c4a2a; margin-bottom: 14px; }

.tw-repaso { margin-top: 28px; }
.tw-repaso > h2 { font-size: 22px; margin-bottom: 12px; }
.tw-repaso .tw-card { margin-bottom: 12px; }
.tw-repaso .tw-enunciado { font-size: 17px; }

/* CTA al test web dentro de las landings (solo con el interruptor encendido). */
.cta-web { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex-shrink: 0; }
.cta-web .sec { font-size: 14.5px; color: #5c4a2a; text-decoration: underline; }
.cta-web.centro { align-items: center; }
.cta-web.claro .sec { color: #b8c9de; }

@media (min-width: 640px) {
  .pub-main { padding: 36px 0 72px; }
  .tw-card { padding: 26px 28px; }
  .tw-modos { grid-template-columns: repeat(3, 1fr); }
  .tw-acciones { grid-template-columns: 1fr 1fr; }
  .tw-sig .btn { width: auto; }
}

/* ── Muro de pago (/pase) ────────────────────────────────────────────── */
.tw-pase .tw-res h1 { color: #fff; font-size: clamp(24px, 6vw, 32px); }
.tw-pase-ok { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.tw-pagos { display: grid; gap: 14px; margin-top: 24px; padding: 20px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.tw-pago .btn, .tw-pago summary.btn { width: 100%; justify-content: center; }
.tw-pago-nota { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text); }
.tw-pago-nota strong { display: block; margin-top: 4px; color: var(--ink); }
.tw-pago-ok { padding: 14px 16px; border-radius: 12px; background: #ecfdf5; border: 1px solid #34d399; color: #064e3b; font-size: 15.5px; line-height: 1.5; }
.tw-tarjeta summary { list-style: none; cursor: pointer; }
.tw-tarjeta summary::-webkit-details-marker { display: none; }
.tw-tarjeta-form { margin-top: 14px; display: grid; gap: 10px; font-size: 15.5px; }
.tw-tarjeta-form label { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.tw-tarjeta-form input[type="email"] { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fafbfd; }
.tw-tarjeta-form input[type="email"]:focus-visible { outline: 2px solid var(--navy-3); outline-offset: 1px; }
.tw-tarjeta-form input[aria-invalid="true"] { border-color: #f87171; }
.tw-tarjeta-form .btn { justify-content: center; }
.tw-tarjeta-form .tw-legal { margin-top: 0; }
.tw-campo-error { color: #b91c1c; font-size: 14.5px; font-weight: 600; }
.tw-senuelo { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tw-cupo { margin: 16px 0 0; font-size: 15px; color: var(--text); }
.tw-cupo a { text-decoration: underline; color: var(--ink); font-weight: 600; }

/* ── Precios (/precios) ──────────────────────────────────────────────── */
.tw-planes { display: grid; gap: 14px; margin-top: 24px; }
.tw-plan { background: #fff; border: 1px solid var(--line-2); border-radius: 16px; padding: 20px 18px; box-shadow: var(--shadow-sm); }
.tw-plan.destacado { border-color: var(--amber); background: linear-gradient(160deg, #fff7e6, #fffdf7); }
.tw-plan h2 { font-size: 20px; }
.tw-plan-precio { margin-top: 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }
.tw-plan-precio span { display: block; font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.tw-plan-precio.sec { font-size: 20px; margin-top: 12px; }
.tw-plan-nota { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--text); }
.tw-plan .tw-ventajas { margin-top: 16px; }
.tw-plan .tw-ventajas a, .tw-devolucion a, .tw-faq a { text-decoration: underline; color: var(--ink); font-weight: 600; }
.tw-devolucion, .tw-faq { margin-top: 28px; }
.tw-devolucion h2, .tw-faq h2 { font-size: 22px; margin-bottom: 8px; }
.tw-devolucion p, .tw-faq p { font-size: 15.5px; line-height: 1.55; }
.tw-faq h3 { font-size: 17px; margin-top: 16px; margin-bottom: 4px; color: var(--ink); }
.tw-acciones.uno { grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 640px) {
  .tw-planes { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ── Recuperar el acceso (/acceso) y «Guarda tu progreso» ────────────── */
.tw-acceso-form { margin-top: 20px; padding: 20px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.tw-acceso .tw-pago-ok { margin-top: 16px; }
.tw-guardar { margin-top: 18px; }
.tw-guardar details { padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); }
.tw-guardar summary { font-size: 15.5px; color: var(--ink); }
.tw-guardar summary span { color: var(--muted); font-size: 14px; }
.tw-guardar summary::after { content: "＋"; float: right; color: var(--muted); }
.tw-guardar details[open] summary::after { content: "−"; }

/* ── Páginas de preguntas (/pregunta-dgt/…, /preguntas-dgt) ──────────── */
.pq a { overflow-wrap: anywhere; }
.pq-migas { margin-bottom: 14px; font-size: 13.5px; color: var(--muted); }
.pq-migas ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.pq-migas li { min-width: 0; }
.pq-migas li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.pq-migas a { text-decoration: underline; color: var(--text); }
.pq-migas [aria-current] { overflow-wrap: anywhere; }
.pq-card h1 { font-size: clamp(20px, 5vw, 26px); line-height: 1.35; overflow-wrap: anywhere; }
.pq-card .tw-img { height: auto; }
.pq-ayuda { margin-bottom: 10px; font-size: 14.5px; color: var(--text); }
.pq-sol { margin-top: 16px; }
.pq-sol summary { cursor: pointer; font-size: 15.5px; font-weight: 600; color: var(--ink); text-decoration: underline; min-height: 44px; display: flex; align-items: center; }
.pq-sol.abierta summary { display: none; }
.pq-correcta { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.pq-exp-titulo { margin-top: 14px; font-size: 17px; letter-spacing: -0.01em; }
.pq-cta .btn { width: 100%; }
.pq-landing { text-align: left; }
.pq-landing-top { margin-top: 12px; font-size: 15.5px; }
.pq-landing-top a { text-decoration: underline; color: var(--ink); font-weight: 600; }
.pq-rel { margin-top: 28px; }
.pq-rel h2 { font-size: 22px; margin-bottom: 12px; }
.pq-rel .tw-sec { text-align: left; }
.pq-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pq-lista a { display: block; padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--ink); font-size: 15.5px; line-height: 1.4; transition: border-color .15s; }
.pq-lista a:hover, .pq-lista a:focus-visible { border-color: var(--amber); outline: none; }
.pq-numerada { margin-top: 20px; }
.pq-temas { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.pq-temas a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 15px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; transition: border-color .15s; }
.pq-temas a:hover, .pq-temas a:focus-visible { border-color: var(--amber); outline: none; }
.pq-temas strong { font-size: 16.5px; color: var(--ink); }
.pq-temas span { font-size: 14px; color: var(--text); flex-shrink: 0; }
.pq-pag { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 20px; }
.pq-pag > :last-child { justify-self: end; }
.pq-pag > :first-child { justify-self: start; }
.pq-pag .btn { white-space: nowrap; padding: 11px 16px; }
.pq-pag-pos { font-size: 14.5px; color: var(--text); text-align: center; }
.pq .tw-oferta { margin-top: 22px; }
@media (min-width: 640px) {
  .pq-cta .btn { width: auto; }
  .pq-temas { grid-template-columns: 1fr 1fr; }
}
