.level-test-page {
    background: linear-gradient(180deg, #f6f8ff 0%, #ffffff 48%, #f8f9ff 100%);
    color: #10204a;
}

.level-test-page .container {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.level-test-hero {
    padding: clamp(56px, 8vw, 96px) 0 36px;
}

.level-test-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: clamp(24px, 5vw, 56px);
    align-items: center;
}

.level-test-hero h1 {
    margin: 0 0 18px;
    max-width: 820px;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: #101f57;
}

.level-test-hero p {
    max-width: 720px;
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    line-height: 1.75;
    color: #415078;
}

.level-test-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.level-test-badges span {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(23, 39, 124, 0.16);
    background: #fff;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 800;
    color: #17277c;
    box-shadow: 0 8px 26px rgba(16, 31, 87, 0.06);
}

.level-test-card {
    background: #fff;
    border: 1px solid rgba(16, 31, 87, 0.09);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(16, 31, 87, 0.10);
    padding: clamp(22px, 4vw, 38px);
}

.level-test-summary-card strong {
    display: block;
    margin-bottom: 14px;
    color: #101f57;
    font-size: 1.2rem;
}

.level-test-summary-card ol {
    margin: 0;
    padding-left: 1.25rem;
    color: #52607e;
    line-height: 1.85;
}

.level-test-content {
    padding: 0 0 clamp(56px, 8vw, 96px);
}

.level-test-alert {
    border-radius: 18px;
    padding: 16px 18px;
    margin-bottom: 22px;
    line-height: 1.6;
}

.level-test-alert ul {
    margin: 8px 0 0;
    padding-left: 1.2rem;
}

.level-test-alert-error {
    border: 1px solid rgba(230, 0, 38, 0.18);
    background: #fff1f3;
    color: #8a0018;
}

.level-test-alert-warning {
    border: 1px solid rgba(240, 170, 0, 0.24);
    background: #fff8e8;
    color: #7a5200;
}

.level-test-start-form {
    max-width: 900px;
    margin-inline: auto;
}

.level-test-form-header {
    margin-bottom: 24px;
}

.level-test-form-header h2,
.level-test-step-header h2,
.level-test-result h2 {
    margin: 0 0 10px;
    color: #101f57;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.15;
}

.level-test-form-header p,
.level-test-step-header p {
    color: #52607e;
    line-height: 1.65;
    margin: 0;
}

.level-test-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.level-test-form-grid label:not(.level-test-check) {
    display: grid;
    gap: 8px;
    font-weight: 800;
    color: #15245c;
}

.level-test-form-grid input,
.level-test-form-grid select {
    width: 100%;
    min-height: 52px;
    border: 1px solid rgba(16, 31, 87, 0.16);
    border-radius: 14px;
    padding: 0 14px;
    color: #10204a;
    background: #fbfcff;
    font: inherit;
}

.level-test-form-grid input:focus,
.level-test-form-grid select:focus,
.test-option:focus-within {
    outline: 3px solid rgba(232, 0, 38, 0.16);
    border-color: #e80026;
}

.level-test-form-grid .full {
    grid-column: 1 / -1;
}

.level-test-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #415078;
    line-height: 1.5;
}

.level-test-check input {
    width: auto;
    min-height: auto;
    margin-top: 4px;
}

.hp-field {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

.level-test-questions {
    max-width: 980px;
    margin-inline: auto;
}

.level-test-step-header {
    border-bottom: 1px solid rgba(16, 31, 87, 0.10);
    margin-bottom: 28px;
    padding-bottom: 22px;
}

.test-question {
    padding: 22px 0;
    border-bottom: 1px solid rgba(16, 31, 87, 0.10);
}

.test-question:last-of-type {
    border-bottom: 0;
}

.question-number {
    display: inline-flex;
    margin-bottom: 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #17277c;
    padding: 6px 12px;
    font-weight:800;
    font-size: 0.88rem;
}

.test-question h3 {
    margin: 0 0 16px;
    color: #101f57;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.35;
}

.test-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.test-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-height: 58px;
    border: 1px solid rgba(16, 31, 87, 0.13);
    border-radius: 16px;
    background: #fbfcff;
    padding: 14px;
    color: #33415f;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.test-option:hover {
    transform: translateY(-1px);
    border-color: rgba(232, 0, 38, 0.32);
    box-shadow: 0 12px 28px rgba(16, 31, 87, 0.08);
}

.test-option input {
    margin-top: 3px;
    accent-color: #e80026;
}

.audio-question audio {
    display: block;
    width: 100%;
    margin: 0 0 16px;
}

.audio-question-text {
    margin: 0 0 14px;
    color: #415078;
    font-weight: 800;
}

.level-test-result {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
    gap: clamp(20px, 4vw, 36px);
    align-items: start;
}

.result-label {
    display: inline-flex;
    border-radius: 999px;
    background: #eef2ff;
    color: #17277c;
    padding: 8px 14px;
    font-weight:800;
    margin: 4px 0 16px;
}

.result-main p,
.result-recommendations p {
    color: #52607e;
    line-height: 1.7;
}

.result-score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.result-score-grid div {
    border-radius: 18px;
    background: #f6f8ff;
    padding: 14px;
    text-align: center;
}

.result-score-grid strong,
.result-score-grid span {
    display: block;
}

.result-score-grid strong {
    color: #17277c;
}

.result-score-grid span {
    margin-top: 5px;
    font-size: 1.45rem;
    font-weight:800;
    color: #101f57;
}

.recommended-course {
    border-radius: 20px;
    background: #f8f9ff;
    padding: 18px;
    margin-top: 14px;
}

.recommended-course h3 {
    margin: 0 0 10px;
    color: #101f57;
}

.result-recommendations hr {
    border: 0;
    border-top: 1px solid rgba(16, 31, 87, 0.10);
    margin: 28px 0;
}

.level-test-page .btn-primary,
.level-test-page .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border-radius: 999px;
    padding: 0 22px;
    font-weight:800;
    text-decoration: none;
}

@media (max-width: 860px) {
    .level-test-hero-grid,
    .level-test-result {
        grid-template-columns: 1fr;
    }

    .level-test-form-grid,
    .test-options {
        grid-template-columns: 1fr;
    }

    .result-score-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .level-test-page .container {
        width: min(100% - 22px, 1120px);
    }

    .level-test-card {
        border-radius: 22px;
        padding: 20px;
    }

    .result-score-grid {
        grid-template-columns: 1fr;
    }
}

/* Ajuste: preguntas de hueco escrito */
.test-fill-gap {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    max-width: 560px;
    font-weight: 800;
    color: #1f2a44;
}

.test-fill-gap input {
    width: 100%;
    border: 1px solid #d8deee;
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    background: #fff;
    box-shadow: 0 8px 20px rgba(22, 39, 124, .06);
}

.test-fill-gap input:focus {
    outline: 3px solid rgba(22, 39, 124, .16);
    border-color: #17277c;
}

.test-question h3 .gap,
.test-question h3 strong.gap {
    border-bottom: 3px solid currentColor;
    padding: 0 .2em;
}

/* Ajuste: inicio sin formulario y email gate al final */
.level-test-start-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 26px;
}

.level-test-start-points span {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(23, 39, 124, 0.12);
    background: #f6f8ff;
    border-radius: 16px;
    padding: 12px 14px;
    color: #17277c;
    font-weight:800;
}

.level-test-start-points span::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e80026;
    color: #fff;
    font-size: 0.78rem;
    flex: 0 0 auto;
}

.level-test-final-form {
    position: relative;
    overflow: hidden;
}

.level-test-final-form::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: linear-gradient(90deg, #17277c, #e80026);
}

.level-test-check a {
    color: #17277c;
    font-weight:800;
}

@media (max-width: 720px) {
    .level-test-start-points {
        grid-template-columns: 1fr;
    }
}

/* Horarios en la recomendación final del test */
.recommended-schedules {
    margin: 18px 0 20px;
    padding: 16px;
    border: 1px solid rgba(23, 39, 124, 0.12);
    border-radius: 18px;
    background: #f6f8ff;
}

.recommended-schedules h4 {
    margin: 0 0 12px;
    color: #17277c;
    font-size: 1rem;
    font-weight:800;
}

.recommended-schedule-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.recommended-schedule-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(22, 39, 124, 0.06);
}

.recommended-schedule-item strong {
    color: #111827;
    font-weight:800;
}

.recommended-schedule-item span {
    color: #17277c;
    font-weight: 800;
}

.recommended-schedule-item small {
    color: #5b6478;
    line-height: 1.45;
}

.recommended-schedules-empty {
    margin: 14px 0 18px;
    padding: 12px 14px;
    border-left: 4px solid #e80026;
    border-radius: 12px;
    background: #fff7f8;
    color: #35405a;
}

/* Resultado: varias opciones de curso y reserva por horario */
.recommendation-intro {
    margin: 0 0 14px;
    color: #52607e;
}

.schedule-with-cta {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
}

.level-test-page .btn-schedule-book {
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.92rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .schedule-with-cta {
        grid-template-columns: 1fr;
    }

    .level-test-page .btn-schedule-book {
        width: 100%;
    }
}
