/* ============================================================
   RUTAS ABIERTAS — Programa de beta testers (/testers-form/)
   Complementa /style.css: reutiliza tokens, navbar, botones,
   letrero, ruta y pie. Acá va lo que solo usa esta página.
   ============================================================ */

:root {
    --peligro: #B3261E;
    --peligro-suave: #FDECEA;
    --ambar: #C98A2E;
}

[data-theme="dark"] {
    --peligro: #F2857C;
    --peligro-suave: #2A1614;
}

/* ---------- PORTADA ---------- */
.t-portada {
    padding-top: calc(var(--nav-h) + 1.25rem);
}

.t-letrero {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: end;
}

.t-letrero .t-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
    font-size: var(--fs-sm);
    font-weight: 700;
}

.t-chip i {
    color: var(--highlight);
}

.t-letrero h1 {
    margin-top: 1.5rem;
    font-size: clamp(2.3rem, 1.5rem + 3.2vw, 4rem);
    line-height: 1.04;
    letter-spacing: -0.025em;
    color: #FFFFFF;
    max-width: 13em;
}

.t-lead {
    margin-top: 1.25rem;
    font-size: var(--fs-lead);
    max-width: 36rem;
}

.t-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

/* Tres datos que responden lo primero que alguien se pregunta antes de
   inscribirse: cuánto cuesta, cuánto tiempo, y si se puede salir. */
.t-datos {
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.t-datos li {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.05rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.35;
}

.t-datos i {
    width: 1.5rem;
    text-align: center;
    color: var(--highlight);
    font-size: 1.1rem;
}

/* ---------- QUÉ ES ---------- */
.t-what {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.t-what li {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-strong);
}

.t-what-ic {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--primary);
    font-size: 1.25rem;
}

.t-what h3 {
    margin-top: 1.25rem;
    font-size: 1.35rem;
}

.t-what p {
    margin-top: 0.6rem;
    color: var(--text-muted);
}

.t-objective {
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    max-width: 48rem;
    padding: 1.5rem 1.75rem;
    background: var(--surface-2);
    border-radius: var(--radius);
}

.t-objective strong {
    color: var(--primary);
}

/* ---------- PASOS: LA RUTA EN HORIZONTAL ---------- */
/* Cuatro paradas en fila, como el diagrama de una línea de metro. La
   línea va del centro de la primera parada al de la última. */
.ruta--horizontal {
    --gap: 2rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gap);
    margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.ruta--horizontal::before {
    top: calc(var(--parada) / 2 - var(--linea) / 2);
    bottom: auto;
    left: calc(var(--parada) / 2);
    right: calc((100% - 3 * var(--gap)) / 4 - var(--parada) / 2);
    width: auto;
    height: var(--linea);
}

.ruta--horizontal .parada {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.25rem;
}

.ruta--horizontal .parada-texto h3 {
    font-size: 1.3rem;
}

.ruta--horizontal .parada-texto p {
    margin-top: 0.55rem;
    color: var(--text-muted);
}

/* ---------- GANAS / PEDIMOS ---------- */
.t-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.t-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3vw, 2.25rem);
}

.t-panel h3 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.4rem;
    margin-bottom: 1.4rem;
}

.t-panel--good h3 i {
    color: var(--primary);
}

.t-panel--ask h3 i {
    color: var(--ambar);
}

.t-panel ul {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.t-panel li {
    position: relative;
    padding-left: 1.6rem;
    color: var(--text-muted);
}

.t-panel li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--primary);
}

.t-panel--ask li::before {
    background: var(--ambar);
}

.t-panel li strong {
    color: var(--text-main);
}

/* ---------- FORMULARIO ---------- */
.t-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}

.t-form-intro {
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
}

.t-form-intro h2 {
    font-size: var(--fs-h2);
}

.t-form-nota {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 1.0625rem;
}

.t-form-nota i {
    margin-top: 0.25em;
    color: var(--primary);
}

.t-form-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: var(--shadow-sm);
}

.field {
    margin-bottom: 2rem;
    border: 0;
    padding: 0;
    min-width: 0;
}

.field label,
.field legend {
    display: block;
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    padding: 0;
}

.req-mark {
    color: var(--peligro);
    font-weight: 800;
}

.opt {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 1rem;
}

.hint {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* 18 px en los campos: con menos, Safari en iPhone hace zoom al enfocar. */
.field input[type="text"],
.field input[type="email"],
.field textarea {
    width: 100%;
    min-height: 3.25rem;
    font: inherit;
    font-size: 1.125rem;
    color: var(--text-main);
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
    resize: vertical;
    min-height: 8rem;
}

.field input:focus-visible,
.field textarea:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: var(--peligro);
}

/* ---------- RADIOS TIPO TARJETA ---------- */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.choice {
    position: relative;
    display: grid;
    margin: 0;
    cursor: pointer;
}

.field .choice {
    margin: 0;
    font-weight: 400;
    font-size: 1rem;
}

.choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.choice-body {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.9rem;
    align-items: center;
    height: 100%;
    padding: 1.1rem 2.9rem 1.1rem 1.2rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice-body i {
    grid-row: span 2;
    font-size: 1.8rem;
    color: var(--text-muted);
}

.choice-title {
    font-weight: 800;
    font-size: 1.125rem;
}

.choice-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* El estado elegido no depende solo del color: además del borde, aparece
   el punto de un radio a la derecha. */
.choice-body::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 1.3rem;
    height: 1.3rem;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--surface);
}

.choice input:checked+.choice-body {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.choice input:checked+.choice-body i {
    color: var(--primary);
}

.choice input:checked+.choice-body::after {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 4px var(--surface);
    background: var(--primary);
}

.choice input:focus-visible+.choice-body {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.ios-note {
    display: flex;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.95rem 1.1rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--ambar) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--ambar) 40%, transparent);
    font-size: 1rem;
    line-height: 1.5;
}

.ios-note i {
    color: var(--ambar);
    margin-top: 0.2em;
}

/* ---------- LISTA DE CASILLAS (perfil) ---------- */
.opt-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.field .opt-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: 0;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font-weight: 400;
    font-size: 1.0625rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.opt-row input,
.check input {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 0.15rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.opt-row:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.opt-row:focus-within {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent);
}

/* ---------- CONSENTIMIENTO ---------- */
.field--check {
    background: var(--surface-2);
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
}

.field--check .check {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    font-weight: 400;
    font-size: 1.0625rem;
    margin: 0;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {

    .choice:hover .choice-body,
    .field .opt-row:hover {
        border-color: var(--primary);
    }
}

/* ---------- ERRORES ---------- */
.field-err {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--peligro);
}

.field-err::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.t-errors {
    background: var(--peligro-suave);
    border-left: 4px solid var(--peligro);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 2rem;
}

.t-errors h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.t-errors h3 i {
    color: var(--peligro);
}

.t-errors ul {
    margin-left: 1.2rem;
    display: grid;
    gap: 0.35rem;
}

.t-errors a,
.privacy-note a {
    color: var(--primary);
    font-weight: 700;
}

/* ---------- ENVÍO Y ÉXITO ---------- */
.btn-submit {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 1.125rem;
    min-height: 3.6rem;
}

.btn-submit[disabled] {
    opacity: 0.65;
    cursor: progress;
    transform: none;
}

.privacy-note {
    display: flex;
    gap: 0.65rem;
    margin-top: 1.3rem;
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.privacy-note i {
    margin-top: 0.25em;
    color: var(--primary);
}

.t-success {
    padding: 0.5rem 0;
}

.t-success-ic {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.t-success h3 {
    font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
    margin-bottom: 0.9rem;
}

.t-success p {
    color: var(--text-muted);
    max-width: 32rem;
    margin-bottom: 1rem;
}

.t-success-tip {
    background: var(--surface-2);
    border-radius: 12px;
    padding: 0.95rem 1.15rem;
}

.t-success .btn {
    margin-top: 1rem;
}

/* ---------- PREGUNTAS ---------- */
.t-faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}

.t-faq {
    border-top: 1px solid var(--border-strong);
}

.t-faq details {
    border-bottom: 1px solid var(--border-strong);
}

.t-faq summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 1.35rem 0;
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1.35;
}

.t-faq summary::-webkit-details-marker {
    display: none;
}

/* Un + que gira a ×: dice que se abre y, abierto, que se cierra. */
.t-faq summary::after {
    content: '\2b';
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.9rem;
    color: var(--primary);
    transition: transform 0.2s var(--ease);
}

.t-faq details[open] summary::after {
    transform: rotate(45deg);
}

.t-faq summary:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

.t-faq details p {
    padding: 0 3.5rem 1.5rem 0;
    color: var(--text-muted);
    max-width: 42rem;
}

/* ---------- TRAMPA ANTISPAM ---------- */
.hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {

    .t-letrero,
    .t-form-layout,
    .t-faq-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .t-form-intro {
        position: static;
    }

    .t-what {
        grid-template-columns: minmax(0, 1fr);
    }

    /* La fila de paradas pasa a ser vertical, igual que en la portada. */
    .ruta--horizontal {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.25rem;
    }

    .ruta--horizontal::before {
        top: calc(var(--parada) / 2);
        bottom: calc(var(--parada) / 2);
        left: calc(var(--parada) / 2 - var(--linea) / 2);
        right: auto;
        width: var(--linea);
        height: auto;
    }

    .ruta--horizontal .parada {
        grid-template-columns: var(--parada) minmax(0, 1fr);
        column-gap: 1.25rem;
    }

    .ruta--horizontal .parada-texto {
        padding-top: 0.45rem;
    }

    .t-cols {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .choice-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .t-acciones .btn {
        flex: 1 1 100%;
    }

    .t-faq details p {
        padding-right: 0;
    }
}
