/* Preview (/test/{id}) y realización (take_test) — máx. 1320px en desktop */

body.page-test-preview,
body.page-take-test {
    background: #eef2f7;
}

body.page-test-preview .container.mt-4,
body.page-take-test .container.mt-4 {
    max-width: 1320px;
    padding-top: 1.25rem;
    padding-bottom: 0.5rem;
}

body.page-take-test .test-layout {
    margin: 0;
}

body.page-test-preview.public-guest .main-nav {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pretest-layout {
    max-width: 100%;
    margin: 0 auto;
}

.pretest-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 14px;
}

.pretest-breadcrumb a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.pretest-breadcrumb a:hover {
    text-decoration: underline;
}

.pretest-breadcrumb-sep {
    color: #cbd5e1;
}

.pretest-breadcrumb [aria-current="page"] {
    color: #334155;
    font-weight: 600;
}

.pretest-hero {
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.pretest-hero-band {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 45%, #4f46e5 100%);
    padding: 18px 28px 20px;
    position: relative;
    overflow: hidden;
}

.pretest-hero-band::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -5%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.pretest-hero-band-top {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
}

.pretest-hero-body {
    padding: 28px 32px 26px;
    background: #fff;
}

.pretest-hero-content {
    position: relative;
    z-index: 1;
}

.pretest-back {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.pretest-back:hover {
    color: #fff;
}

.pretest-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.pretest-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pretest-badge-free {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
}

.pretest-badge-opo {
    background: rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
}

.pretest-eyebrow {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6366f1;
}

.pretest-title {
    font-size: clamp(1.55rem, 2.6vw, 2.15rem);
    font-weight: 800;
    margin: 0;
    line-height: 1.28;
    color: #0f172a;
    letter-spacing: -0.025em;
    max-width: none;
}

.pretest-desc {
    color: #64748b;
    opacity: 1;
    margin: 12px 0 0;
    font-size: 0.95rem;
    max-width: 820px;
    line-height: 1.65;
}

.pretest-meta {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pretest-meta-item {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 10px 14px;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 110px;
    color: #fff;
}

.pretest-meta-icon {
    font-size: 1.15rem;
    opacity: 0.9;
}

.pretest-meta-val {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.pretest-meta-label {
    font-size: 0.68rem;
    opacity: 0.82;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pretest-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    margin-bottom: 16px;
    overflow: hidden;
}

.pretest-section-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pretest-section-header i {
    color: #6366f1;
}

.pretest-section-body {
    padding: 18px;
}

.pretest-instruction {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
}

.pretest-instruction:last-child {
    border: none;
}

.pretest-instr-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eef2ff;
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
}

.pretest-instr-text {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.55;
    padding-top: 4px;
}

.diff-bar {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    height: 10px;
    margin-top: 10px;
}

.diff-bar-easy { background: #22c55e; }
.diff-bar-med { background: #f59e0b; }
.diff-bar-hard { background: #ef4444; }

.diff-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.76rem;
    color: #64748b;
}

.diff-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.diff-legend span::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

.diff-legend .easy::before { background: #22c55e; }
.diff-legend .med::before { background: #f59e0b; }
.diff-legend .hard::before { background: #ef4444; }

.cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.76rem;
    color: #475569;
    margin: 2px 4px 2px 0;
    font-weight: 500;
}

.cat-tag .cat-count {
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 10px;
    padding: 1px 7px;
    font-weight: 700;
    font-size: 0.68rem;
}

.attempt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
}

.attempt-row:last-child {
    border: none;
}

.attempt-score {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.68rem;
    color: #fff;
    flex-shrink: 0;
}

.attempt-info { flex: 1; min-width: 0; }
.attempt-date { font-size: 0.82rem; font-weight: 600; color: #1e293b; }
.attempt-detail { font-size: 0.72rem; color: #94a3b8; }

.pretest-start-box {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.pretest-start-icon {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: #6366f1;
}

.pretest-start-box h3 {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    font-size: 1.15rem;
}

.pretest-start-lead {
    color: #64748b;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.pretest-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
    text-decoration: none;
}

.pretest-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(99, 102, 241, 0.45);
    color: #fff;
}

.pretest-start-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 14px;
    line-height: 1.5;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.pretest-start-note a {
    color: #4f46e5;
    font-weight: 600;
}

.pretest-guest-card {
    border-color: #c7d2fe !important;
    background: linear-gradient(135deg, #eef2ff, #faf5ff) !important;
}

.pretest-guest-card .pretest-section-body {
    font-size: 0.86rem;
    color: #4338ca;
}

.pretest-guest-card p {
    color: #6366f1;
    margin-bottom: 12px;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
}

.stat-pill i {
    color: #6366f1;
}

.pretest-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.pretest-modal-overlay.active {
    display: flex;
}

.pretest-modal {
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    animation: pretestSlideUp 0.3s ease;
}

@keyframes pretestSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.pretest-modal h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.pretest-modal p {
    font-size: 0.88rem;
    color: #64748b;
}

.pretest-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.pretest-modal-cancel {
    padding: 10px 22px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
}

.pretest-modal-cancel:hover {
    background: #f1f5f9;
}

.pretest-modal-go {
    padding: 10px 26px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.pretest-modal-go:hover {
    transform: translateY(-1px);
}

@media (max-width: 991.98px) {
    body.page-test-preview .container.mt-4,
    body.page-take-test .container.mt-4 {
        padding-top: 1rem;
    }

    .pretest-hero-band {
        padding: 16px 20px 18px;
    }

    .pretest-hero-body {
        padding: 22px 20px 20px;
    }

    .pretest-hero-band-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .pretest-badges {
        justify-content: flex-start;
    }

    .pretest-meta-item {
        min-width: calc(50% - 8px);
        flex: 1 1 calc(50% - 8px);
    }
}

@media (max-width: 575.98px) {
    .pretest-meta-item {
        min-width: 100%;
    }

    .pretest-start-btn {
        width: 100%;
    }
}

/* Contenido SEO bajo la ficha del test (invitados / crawlers) */
.pretest-seo {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    max-width: 820px;
}

.pretest-seo-intro h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 1rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.pretest-seo-intro p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: #475569;
    margin: 0 0 0.85rem;
}

.pretest-seo-links {
    font-size: 0.88rem;
    margin-top: 1.15rem !important;
}

.pretest-seo-links a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.pretest-seo-links a:hover {
    text-decoration: underline;
}

.pretest-seo-block {
    margin-top: 2rem;
    padding: 1.25rem 1.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.pretest-seo-block h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.85rem;
}

.pretest-seo-related {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px 16px;
}

.pretest-seo-related a {
    display: block;
    font-size: 0.88rem;
    color: #4f46e5;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 0;
}

.pretest-seo-related a:hover {
    text-decoration: underline;
}

.pretest-seo-related a::before {
    content: '→ ';
    color: #94a3b8;
}

.pretest-seo-faq-list {
    margin: 0;
}

.pretest-seo-faq-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.pretest-seo-faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pretest-seo-faq-item dt {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.35rem;
}

.pretest-seo-faq-item dd {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #64748b;
    margin: 0;
}

@media (max-width: 575.98px) {
    .pretest-seo-related {
        grid-template-columns: 1fr;
    }
}
