/* ═══════════════════════════════════════════════════════
           VARIABLES Y SISTEMA DE DISEÑO (UNIMEX BRAND TOKENS)
           ═══════════════════════════════════════════════════════ */
        :root {
            --primary: #00244e;
            --primary-hover: #001835;
            --primary-light: #00539b;
            --primary-subtle: #edf3fa;
            --accent-hover: #003a73;
            --border-subtle: rgba(0, 36, 78, 0.1);
            --border-card: rgba(0, 36, 78, 0.08);
            --option-border: #d4dde6;
            --option-hover-border: #99b8dc;
            --option-active-bg: #edf4fc;
            --option-active-border: #00539b;
            --text-main: #0f1d2e;
            --text-muted: #536477;
            --text-hint: #8292a4;
            --bg-page: #f5f7fb;
            --bg-card: #ffffff;
            --bg-input: #ffffff;
            --bg-disabled: #f8fafc;
            --progress-track: #dce5f2;
            --danger: #dc2626;
            --danger-subtle: #fef2f2;
            --danger-border: #fca5a5;
            --success: #16a34a;
            --radius-sm: 8px;
            --radius-md: 10px;
            --radius-card: 16px;
            --shadow-sm: 0 1px 2px rgba(0, 36, 78, 0.04);
            --shadow-card: 0 4px 20px -2px rgba(0, 36, 78, 0.07), 0 2px 6px -1px rgba(0, 36, 78, 0.04);
            --transition: all 0.18s cubic-bezier(0.23, 1, 0.32, 1);
            font-size: 85%;
        }

        *, *::before, *::after {
            box-sizing: border-box;
        }

        body {
            background: var(--bg-page);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            color: var(--text-main);
            min-height: 100vh;
            min-height: 100dvh;
            display: flex;
            flex-direction: column;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            margin: 0;
            padding-bottom: 0;
            touch-action: manipulation;
        }

        /* ── Progress bar ── */
        .quiz-progress-wrap {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            height: 5px;
            background: var(--progress-track);
        }

        .quiz-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-light), var(--primary));
            width: 0%;
            transition: width 0.35s cubic-bezier(0.23, 1, 0.32, 1);
            border-radius: 0 4px 4px 0;
        }

        /* ── Header ── */
        .quiz-header {
            background: var(--primary);
            padding: 10px 0;
            margin-top: 5px;
            box-shadow: 0 2px 8px rgba(0, 20, 45, 0.12);
            position: sticky;
            top: 0;
            z-index: 900;
            flex-shrink: 0;
        }

        .logo-quiz {
            height: 38px;
            width: auto;
            max-width: 170px;
            object-fit: contain;
            display: block;
        }

        .quiz-header .progress-label {
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.85rem;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.2px;
        }

        /* ── Main Layout Container (Centrado Vertical y Horizontal) ── */
        main.container,
        .quiz-main-container {
            flex: 1 0 auto;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            width: 100%;
            padding-top: 1.5rem;
            padding-bottom: 2rem;
            box-sizing: border-box;
        }

        /* ── Card Principal ── */
        .quiz-card {
            background: var(--bg-card);
            border-radius: var(--radius-card);
            border: 1px solid var(--border-card);
            box-shadow: var(--shadow-card);
            padding: 2.25rem 2.5rem;
            width: 100%;
            max-width: 720px;
            margin: auto;
            transition: padding 0.2s ease, margin 0.2s ease;
        }

        /* ── Question Header ── */
        .q-header {
            display: flex;
            align-items: flex-start;
            gap: 0.85rem;
            margin-bottom: 1.5rem;
        }

        .q-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            background: var(--primary);
            color: #ffffff;
            font-size: 0.85rem;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .q-text {
            font-size: 1.15rem;
            font-weight: 700;
            line-height: 1.45;
            color: var(--text-main);
            text-wrap: balance;
            margin: 0;
        }

        /* ── Option Cards ── */
        .option-btn {
            display: flex;
            align-items: center;
            gap: 0.85rem;
            width: 100%;
            min-height: 52px;
            padding: 0.85rem 1.1rem;
            border: 1.5px solid var(--option-border);
            border-radius: 12px;
            background: #ffffff;
            color: var(--text-main);
            font-size: 0.95rem;
            text-align: left;
            cursor: pointer;
            margin-bottom: 0.65rem;
            transition: var(--transition);
            user-select: none;
            -webkit-tap-highlight-color: transparent;
            position: relative;
        }

        .option-btn:hover:not(.selected) {
            border-color: var(--option-hover-border);
            background: #fbfdff;
            transform: translateY(-1px);
        }

        .option-btn:active {
            transform: scale(0.985);
        }

        .option-btn.selected {
            border-color: var(--primary-light);
            background: var(--option-active-bg);
            box-shadow: 0 0 0 2px var(--primary-light), 0 4px 12px rgba(0, 83, 155, 0.12);
        }

        .opt-letter {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            min-width: 30px;
            border-radius: var(--radius-sm);
            border: 1.5px solid var(--option-border);
            font-size: 0.82rem;
            font-weight: 700;
            color: var(--text-muted);
            background: #ffffff;
            flex-shrink: 0;
            transition: var(--transition);
            text-transform: uppercase;
        }

        .option-btn.selected .opt-letter {
            background: var(--primary);
            color: #ffffff;
            border-color: var(--primary);
        }

        .opt-text {
            flex: 1;
            font-weight: 500;
            line-height: 1.4;
            word-break: break-word;
        }

        .opt-check {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            min-width: 22px;
            border-radius: 50%;
            background: transparent;
            color: transparent;
            transition: var(--transition);
            flex-shrink: 0;
        }

        .option-btn.selected .opt-check {
            background: var(--primary);
            color: #ffffff;
        }

        /* ── Buttons & Navigation ── */
        .quiz-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.85rem;
            margin-top: 1.85rem;
        }

        .btn-primary-quiz {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            min-height: 48px;
            background: var(--primary);
            text-decoration: none;
            color: #ffffff;
            border: none;
            border-radius: var(--radius-md);
            padding: 0.75rem 1.6rem;
            font-size: 0.95rem;
            font-weight: 600;
            letter-spacing: 0.2px;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(0, 36, 78, 0.16);
            transition: var(--transition);
            -webkit-tap-highlight-color: transparent;
        }

        .btn-submit-quiz .btn-arrow {
            display: inline-flex;
            align-items: center;
            flex-shrink: 0;
        }

        .quiz-nav .btn-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .quiz-nav .btn-text {
            display: inline;
        }

        .btn-primary-quiz:hover:not(:disabled) {
            background: var(--primary-light);
            color: #ffffff;
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(0, 36, 78, 0.22);
        }

        .btn-primary-quiz:active:not(:disabled) {
            transform: scale(0.97);
            box-shadow: 0 2px 4px rgba(0, 36, 78, 0.12);
        }

        .btn-primary-quiz:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            box-shadow: none;
        }

        .btn-ghost {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 48px;
            background: transparent;
            color: var(--text-muted);
            border: 1.5px solid var(--option-border);
            border-radius: var(--radius-md);
            padding: 0.75rem 1.35rem;
            font-size: 0.92rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            -webkit-tap-highlight-color: transparent;
        }

        .btn-ghost:hover {
            border-color: var(--primary-light);
            color: var(--primary-light);
            background: var(--primary-subtle);
        }

        .btn-ghost:active {
            transform: scale(0.97);
        }

        /* ── Textbox & Form Controls ── */
        .form-section-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.25rem;
            text-wrap: balance;
        }

        .form-section-sub {
            font-size: 0.92rem;
            color: var(--text-muted);
            margin-bottom: 1.5rem;
            text-wrap: pretty;
        }

        .form-label-quiz {
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 0.4rem;
            display: block;
        }

        .form-control-quiz {
            width: 100%;
            min-height: 48px;
            padding: 0.75rem 1rem;
            border: 1.5px solid var(--option-border);
            border-radius: var(--radius-md);
            font-size: 16px; /* Evita auto-zoom en iOS Safari */
            color: var(--text-main);
            background: var(--bg-input);
            outline: none;
            transition: var(--transition);
            appearance: none;
            -webkit-appearance: none;
        }

        .form-control-quiz::placeholder {
            color: var(--text-hint);
            font-size: 0.92rem;
        }

        .form-control-quiz:focus {
            border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(0, 83, 155, 0.16);
            background: #ffffff;
        }

        .form-control-quiz:disabled {
            background: var(--bg-disabled);
            color: var(--text-muted);
            border-color: #e2e8f0;
            cursor: not-allowed;
            opacity: 0.85;
        }

        .form-control-quiz.is-invalid {
            border-color: var(--danger);
            background-color: var(--danger-subtle);
        }

        .form-control-quiz.is-invalid:focus {
            box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
        }

        /* ── Combobox / Select Personalizados (Homologados con UNIMEX UI) ── */
        .select-wrap {
            position: relative;
            width: 100%;
        }

        /* Ocultar visualmente el select nativo sin sacarlo del DOM */
        .custom-select-native-hidden {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            padding: 0 !important;
            margin: -1px !important;
            overflow: hidden !important;
            clip: rect(0, 0, 0, 0) !important;
            white-space: nowrap !important;
            border: 0 !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        /* Disparador personalizado que reemplaza visualmente al select */
        .custom-select-trigger {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            min-height: 50px;
            padding: 0.85rem 1.1rem;
            border: 1.5px solid var(--option-border);
            border-radius: 12px;
            background: var(--bg-input);
            color: var(--text-main);
            font-size: 0.95rem;
            text-align: left;
            cursor: pointer;
            user-select: none;
            transition: var(--transition);
            -webkit-tap-highlight-color: transparent;
            position: relative;
        }

        .custom-select-trigger:hover:not(:disabled) {
            border-color: var(--option-hover-border);
            background: #fbfdff;
        }

        .custom-select-trigger:focus-visible,
        .select-wrap.is-open .custom-select-trigger {
            border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(0, 83, 155, 0.16);
            background: #ffffff;
            outline: none;
        }

        .custom-select-trigger:disabled {
            background: var(--bg-disabled);
            color: var(--text-muted);
            border-color: #e2e8f0;
            cursor: not-allowed;
            opacity: 0.85;
        }

        .custom-select-trigger.is-invalid {
            border-color: var(--danger);
            background-color: var(--danger-subtle);
        }

        .custom-select-label {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding-right: 0.5rem;
            font-weight: 500;
        }

        .custom-select-label.is-placeholder {
            color: var(--text-hint);
            font-weight: 400;
        }

        .custom-select-arrow {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            color: var(--text-muted);
            transition: transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
            flex-shrink: 0;
        }

        .select-wrap.is-open .custom-select-arrow {
            transform: rotate(180deg);
            color: var(--primary-light);
        }

        /* Menú desplegable flotante (Toggle Menu) */
        .custom-select-menu {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            z-index: 1050;
            background: #ffffff;
            border: 1px solid rgba(0, 36, 78, 0.12);
            border-radius: 12px;
            box-shadow: 0 12px 32px -4px rgba(0, 36, 78, 0.16), 0 4px 12px -2px rgba(0, 36, 78, 0.08);
            opacity: 0;
            transform: translateY(-6px) scale(0.98);
            pointer-events: none;
            transition: opacity 0.18s cubic-bezier(0.23, 1, 0.32, 1), transform 0.18s cubic-bezier(0.23, 1, 0.32, 1);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .select-wrap.open-upwards .custom-select-menu {
            top: auto;
            bottom: calc(100% + 6px);
            transform: translateY(6px) scale(0.98);
        }

        .select-wrap.is-open .custom-select-menu {
            opacity: 1;
            transform: translateY(0) scale(1);
            pointer-events: auto;
        }

        .select-wrap.is-open,
        .pre-combo-box.is-active-dropdown,
        .form-group.is-active-dropdown {
            position: relative;
            z-index: 1050;
        }

        /* Buscador integrado para combos con muchas opciones (ej. Carreras) */
        .custom-select-search {
            position: relative;
            padding: 0.6rem 0.75rem;
            border-bottom: 1px solid rgba(0, 36, 78, 0.08);
            background: #fbfcfe;
        }

        .custom-select-search .search-icon {
            position: absolute;
            left: 1.25rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-hint);
            pointer-events: none;
        }

        .custom-select-search-input {
            width: 100%;
            min-height: 38px;
            padding: 0.45rem 0.75rem 0.45rem 2.2rem;
            border: 1px solid var(--option-border);
            border-radius: 8px;
            font-size: 14px;
            color: var(--text-main);
            background: #ffffff;
            outline: none;
            transition: var(--transition);
        }

        .custom-select-search-input:focus {
            border-color: var(--primary-light);
            box-shadow: 0 0 0 2px rgba(0, 83, 155, 0.15);
        }

        /* Contenedor de opciones con scroll suave */
        .custom-select-options-list {
            max-height: 250px;
            overflow-y: auto;
            overscroll-behavior: contain;
            padding: 0.35rem;
            scrollbar-width: thin;
            scrollbar-color: #cbd5e1 transparent;
        }

        .custom-select-options-list::-webkit-scrollbar {
            width: 6px;
        }

        .custom-select-options-list::-webkit-scrollbar-thumb {
            background-color: #cbd5e1;
            border-radius: 10px;
        }

        /* Encabezado o separador de placeholder */
        .custom-select-placeholder-header {
            padding: 0.5rem 0.85rem 0.3rem;
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--text-hint);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Botones de opción individual del menú */
        .custom-select-option {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            min-height: 44px; /* Estándar táctil WCAG */
            padding: 0.65rem 0.95rem;
            border: none;
            border-radius: 8px;
            background: transparent;
            color: var(--text-main);
            font-size: 0.93rem;
            font-weight: 500;
            text-align: left;
            cursor: pointer;
            transition: var(--transition);
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }

        .custom-select-option:hover,
        .custom-select-option:focus {
            background: var(--option-active-bg);
            color: var(--primary-light);
            outline: none;
        }

        .custom-select-option:active {
            transform: scale(0.985);
        }

        .custom-select-option.is-selected {
            background: var(--primary-subtle);
            color: var(--primary);
            font-weight: 700;
        }

        .custom-select-option .option-text {
            flex: 1;
            line-height: 1.35;
            word-break: break-word;
        }

        .custom-select-option .option-check {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            color: transparent;
            transition: var(--transition);
            flex-shrink: 0;
            margin-left: 0.5rem;
        }

        .custom-select-option.is-selected .option-check {
            color: var(--primary-light);
        }

        .custom-select-no-results {
            padding: 1.25rem 0.85rem;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.88rem;
        }

        .skeleton {
            background: linear-gradient(90deg, #eaf0f7 25%, #dae4f0 50%, #eaf0f7 75%);
            background-size: 200% 100%;
            animation: shimmer 1.2s infinite;
            border-radius: var(--radius-md);
            height: 48px;
            width: 100%;
        }

        @keyframes shimmer {
            to { background-position: -200% 0; }
        }

        /* ── Checkboxes Personalizados y Táctiles ── */
        .custom-checkbox-wrap {
            display: flex;
            align-items: flex-start;
            gap: 0.85rem;
            cursor: pointer;
            min-height: 44px; /* WCAG estándar táctil */
            padding: 0.4rem 0;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }

        .custom-checkbox-input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
            pointer-events: none;
        }

        .custom-checkbox-box {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            min-width: 22px;
            margin-top: 2px;
            border: 2px solid var(--option-border);
            border-radius: 6px;
            background: #ffffff;
            transition: var(--transition);
            color: transparent;
        }

        .custom-checkbox-input:checked + .custom-checkbox-box {
            background: var(--primary);
            border-color: var(--primary);
            color: #ffffff;
        }

        .custom-checkbox-input:focus-visible + .custom-checkbox-box {
            box-shadow: 0 0 0 3px rgba(0, 83, 155, 0.25);
        }

        .custom-checkbox-wrap:hover .custom-checkbox-box {
            border-color: var(--primary-light);
        }

        .check-icon {
            width: 14px;
            height: 14px;
            stroke-dasharray: 20;
            stroke-dashoffset: 0;
        }

        .custom-checkbox-content {
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
        }

        .checkbox-title {
            font-size: 0.92rem;
            font-weight: 600;
            color: var(--text-main);
            line-height: 1.35;
        }

        .checkbox-desc {
            font-size: 0.82rem;
            color: var(--text-muted);
            line-height: 1.35;
        }

        .link-privacidad {
            color: var(--primary-light);
            text-decoration: underline;
            text-underline-offset: 3px;
            font-weight: 600;
        }

        .link-privacidad:hover {
            color: var(--primary);
        }

        /* ── Modalidad Pills ── */
        .modalidad-group {
            display: flex;
            gap: 0.75rem;
            margin-top: 0.4rem;
        }

        .modalidad-pill {
            flex: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            min-height: 48px;
            padding: 0.65rem 1.25rem;
            border: 1.5px solid var(--option-border);
            border-radius: var(--radius-md);
            font-size: 0.92rem;
            font-weight: 500;
            cursor: pointer;
            background: #ffffff;
            color: var(--text-muted);
            transition: var(--transition);
            -webkit-tap-highlight-color: transparent;
        }

        .modalidad-pill:hover {
            border-color: var(--primary-light);
            color: var(--primary-light);
        }

        .modalidad-pill.active {
            border-color: var(--primary);
            background: var(--option-active-bg);
            color: var(--primary);
            font-weight: 700;
            box-shadow: 0 0 0 1.5px var(--primary);
        }

        /* ── Grid Layouts ── */
        .form-row-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .form-group {
            margin-bottom: 1.15rem;
        }

        /* ── Componente Preguntas Previas ── */
        .quiz-pre-questions,
        .pre-q-step {
            animation: fadeInPreQ 0.22s cubic-bezier(0.23, 1, 0.32, 1);
        }

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

        .pre-options-grid {
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
            margin-bottom: 1.5rem;
        }

        .pre-opt-btn {
            padding: 1rem 1.15rem;
            min-height: 64px;
        }

        /* ── Dividers ── */
        .form-divider {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin: 1.75rem 0 1.25rem;
        }

        .form-divider span {
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--text-muted);
            white-space: nowrap;
            text-transform: uppercase;
            letter-spacing: 0.75px;
        }

        .form-divider::before,
        .form-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border-subtle);
        }

        /* ── Error & Alert ── */
        .invalid-feedback-quiz {
            font-size: 0.82rem;
            color: var(--danger);
            margin-top: 0.35rem;
            display: none;
            font-weight: 500;
            line-height: 1.35;
        }

        .invalid-feedback-quiz.show {
            display: block;
        }

        .quiz-alert {
            background: #fffbeb;
            border-left: 4px solid #f59e0b;
            border-radius: var(--radius-sm);
            padding: 0.75rem 1rem;
            font-size: 0.88rem;
            color: #92400e;
            margin-bottom: 1.25rem;
            display: none;
            font-weight: 500;
        }

        /* ── Intro / Resumen Vocacional ── */
        .quiz-intro {
            text-align: justify;
        }

        .intro-logo-wrap {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .intro-logo-circular {
            width: 120px;
            height: 120px;
            object-fit: contain;
            border-radius: 50%;
            filter: drop-shadow(0 4px 12px rgba(0, 36, 78, 0.12));
            transition: transform 0.25s ease;
        }


        .intro-badge-wrap {
            margin-bottom: 0.75rem;
        }

        .intro-eyebrow {
            display: inline-block;
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--primary-light);
            text-transform: uppercase;
            letter-spacing: 0.8px;
            background: var(--primary-subtle);
            padding: 0.35rem 0.8rem;
            border-radius: 20px;
        }

        .intro-title {
            font-size: 1.6rem;
            font-weight: 800;
            color: var(--primary);
            line-height: 1.3;
            margin-bottom: 1.15rem;
            text-wrap: balance;
            letter-spacing: -0.015em;
        }

        .intro-text {
            font-size: 1rem;
            line-height: 1.65;
            color: var(--text-main);
            text-wrap: pretty;
            margin-bottom: 1.35rem;
        }

        /* Tarjeta destacada de bachillerato público */
        .intro-highlight-card {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            background: linear-gradient(135deg, #f0f7ff 0%, #e8f2fd 100%);
            border: 1.5px solid #bdd7f5;
            border-radius: 12px;
            padding: 1.15rem 1.25rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 2px 8px rgba(0, 83, 155, 0.06);
        }

        .highlight-icon {
            font-size: 1.85rem;
            line-height: 1;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .highlight-content {
            flex: 1;
        }

        .highlight-badge {
            display: inline-block;
            font-size: 0.75rem;
            font-weight: 800;
            color: #003a73;
            background: #d4e7fc;
            padding: 0.2rem 0.6rem;
            border-radius: 6px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.4rem;
        }

        .highlight-text {
            font-size: 0.95rem;
            line-height: 1.55;
            color: var(--text-main);
        }

        .highlight-text strong {
            color: var(--primary);
            font-weight: 700;
        }

        /* Trust pills */
        .intro-features {
            display: flex;
            flex-wrap: wrap;
            gap: 0.65rem;
            margin-bottom: 1.75rem;
        }

        .feature-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-muted);
            background: #f8fafc;
            border: 1px solid var(--border-subtle);
            border-radius: 20px;
            padding: 0.4rem 0.85rem;
        }

        /* Botón iniciar */
        .btn-start-test {
            width: 100%;
            max-width: 340px;
            min-height: 52px;
            font-size: 1.05rem;
            font-weight: 700;
            letter-spacing: 0.3px;
            box-shadow: 0 4px 14px rgba(0, 36, 78, 0.2);
        }

        .intro-duration-hint {
            font-size: 0.85rem;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 500;
        }

        /* ── Spinner / Loading ── */
        .quiz-loading,
        .quiz-result {
            text-align: center;
        }

        .spinner {
            width: 44px;
            height: 44px;
            border: 3.5px solid var(--progress-track);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 1.2rem;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* ── Results View ── */
        .result-card-inner {
            padding: 0.5rem 0;
        }

        .result-icon-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 64px;
            height: 64px;
            font-size: 2rem;
            background: var(--primary-subtle);
            border-radius: 50%;
            margin-bottom: 0.75rem;
        }

        .result-eyebrow {
            display: block;
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--primary-light);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 0.35rem;
        }

        .result-title {
            font-size: 1.6rem;
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 0.75rem;
            letter-spacing: -0.015em;
            text-wrap: balance;
        }

        .result-desc {
            font-size: 1rem;
            font-weight: 500;
            color: var(--text-main);
            line-height: 1.65;
            max-width: 600px;
            margin: 0 auto 1.5rem;
            text-wrap: pretty;
        }

        .result-carr-container {
            background: #f8fafc;
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            padding: 1.25rem;
            margin: 1.25rem 0 1.75rem;
        }

        .result-carr-title {
            font-size: 0.85rem;
            font-weight: 800;
            color: var(--primary);
            letter-spacing: 0.5px;
            margin-bottom: 0.5rem;
        }

        .result-carr {
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--primary-light);
            line-height: 1.55;
        }

        .result-infografia-card {
            max-width: 580px;
            margin: 0 auto 1.5rem;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 36, 78, 0.12);
            border: 1px solid var(--border-subtle);
            background: #ffffff;
            transition: var(--transition);
        }

        .result-infografia-img {
            width: 100%;
            height: auto;
            display: block;
        }

        .result-buttons {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.85rem;
            margin-top: 1.25rem;
        }

        .btn-download-action {
            width: 100%;
            max-width: 400px;
            min-height: 52px;
            font-size: 1rem;
        }

        /* ═══════════════════════════════════════════════════════
           DISEÑO RESPONSIVO Y TIPOGRAFÍA ERGONÓMICA
           (Basado en principios de Interface Design: jerarquía de 4 niveles,
           legibilidad móvil sin subescalas destructivas y áreas táctiles WCAG)
           ═══════════════════════════════════════════════════════ */

        /* ── Mobile Breakpoint (< 640px) ── */
        @media (max-width: 640px) {
            :root {
                font-size: 93.75%; /* Base armónica de 15px para móviles (iPhone 16 Pro Max, Pixel 9 Pro, etc.) */
            }

            main.container,
            .quiz-main-container {
                padding-top: 0.75rem;
                padding-bottom: 1.25rem;
                padding-left: 0.75rem;
                padding-right: 0.75rem;
            }

            .quiz-card {
                padding: 1.25rem 0.95rem;
                margin: auto;
                border-radius: 14px;
                width: 100%;
            }

            .q-header {
                gap: 0.75rem;
                margin-bottom: 1.15rem;
            }

            .q-badge {
                min-width: 30px;
                height: 30px;
                font-size: 0.85rem;
            }

            .q-text {
                font-size: 1.08rem;
                font-weight: 700;
                line-height: 1.38;
                letter-spacing: -0.01em;
                text-wrap: balance;
            }

            .option-btn {
                padding: 0.8rem 0.95rem;
                min-height: 50px;
                border-radius: 11px;
                font-size: 0.95rem;
                line-height: 1.42;
                gap: 0.75rem;
            }

            .opt-letter {
                width: 28px;
                height: 28px;
                min-width: 28px;
                font-size: 0.82rem;
            }

            .opt-text {
                font-size: 0.95rem;
                line-height: 1.42;
                font-weight: 500;
            }

            .form-row-2 {
                grid-template-columns: 1fr;
                gap: 0;
            }

            .quiz-nav {
                flex-direction: row;
                align-items: center;
                justify-content: space-between;
                gap: 0.65rem;
            }

            /* Navegación paso a paso de preguntas en móvil: solo iconos para anterior y siguiente */
            .quiz-nav:not(.quiz-nav-form):not(.quiz-nav-instructions) .btn-text {
                display: none !important;
            }

            .quiz-nav:not(.quiz-nav-form):not(.quiz-nav-instructions) .btn-ghost,
            .quiz-nav:not(.quiz-nav-form):not(.quiz-nav-instructions) .btn-primary-quiz {
                width: 52px;
                min-width: 52px;
                height: 48px;
                min-height: 48px;
                padding: 0 !important;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex: 0 0 52px;
            }

            /* Apilado en responsive para instrucciones previas y formulario final (volver arriba, acción principal abajo) */
            #preQInstructions .quiz-nav,
            .quiz-nav-instructions,
            #quizForm .quiz-nav,
            .quiz-nav-form {
                flex-direction: column !important;
                gap: 0.75rem;
                width: 100%;
            }

            #preQInstructions .quiz-nav .btn-ghost,
            .quiz-nav-instructions .btn-ghost,
            #quizForm .quiz-nav .btn-ghost,
            .quiz-nav-form .btn-ghost {
                order: 1;
                width: 100% !important;
                min-width: 100% !important;
                min-height: 48px;
                padding: 0.75rem 1rem !important;
                font-size: 0.94rem;
                white-space: normal;
                display: inline-flex !important;
                align-items: center;
                justify-content: center;
                text-align: center;
                gap: 0.5rem;
                flex: none !important;
            }

            #preQInstructions .quiz-nav .btn-ghost .btn-text,
            .quiz-nav-instructions .btn-ghost .btn-text {
                display: inline !important;
            }

            #preQInstructions .quiz-nav .btn-primary-quiz,
            .quiz-nav-instructions .btn-primary-quiz,
            #preQInstructions #btnStartVocationalTest,
            .quiz-nav-instructions #btnStartVocationalTest,
            #quizForm .quiz-nav .btn-primary-quiz,
            .quiz-nav-form .btn-primary-quiz {
                order: 2;
                width: 100% !important;
                min-width: 100% !important;
                min-height: 48px;
                padding: 0.75rem 1.25rem !important;
                font-size: 0.95rem;
                line-height: 1.3;
                display: inline-flex !important;
                align-items: center;
                justify-content: center;
                text-align: center;
                gap: 0.5rem;
                flex: none !important;
            }

            #preQInstructions .quiz-nav .btn-primary-quiz .btn-text,
            .quiz-nav-instructions .btn-primary-quiz .btn-text {
                display: inline !important;
            }

            .modalidad-group {
                flex-direction: row;
                gap: 0.5rem;
            }

            .modalidad-pill {
                padding: 0.5rem 0.75rem;
                font-size: 0.88rem;
            }

            .result-title {
                font-size: 1.35rem;
                line-height: 1.3;
            }

            .result-desc {
                font-size: 0.95rem;
                line-height: 1.6;
            }

            .result-carr {
                font-size: 0.98rem;
                line-height: 1.5;
            }

            .intro-logo-circular {
                width: 84px;
                height: 84px;
            }

            .intro-title {
                font-size: 1.35rem;
                line-height: 1.3;
                text-wrap: balance;
            }

            .intro-text {
                font-size: 0.96rem;
                line-height: 1.62;
                text-wrap: pretty;
            }

            .intro-highlight-card {
                padding: 1rem;
                gap: 0.75rem;
            }

            .highlight-icon {
                font-size: 1.5rem;
            }

            .highlight-text {
                font-size: 0.9rem;
            }

            .btn-start-test {
                max-width: 100%;
            }
        }

        /* ── Extra Narrow Mobile Breakpoint (< 380px, ej. Samsung Galaxy A55: 360px) ── */
        @media (max-width: 380px) {
            :root {
                font-size: 89%; /* Base de ~14.25px: conserva legibilidad sin crear texto microscópico */
            }

            /* Dispositivos estrechos pero altos (Samsung Galaxy A55: 360 x 800) */
            @media (min-height: 700px) {
                :root {
                    font-size: 91%; /* Se aprovecha la altura para dar letra aún más cómoda */
                }
            }

            main.container,
            .quiz-main-container {
                padding-top: 0.5rem;
                padding-bottom: 1rem;
                padding-left: 0.4rem;
                padding-right: 0.4rem;
            }

            /* Relleno lateral optimizado: libera ~20px útiles para evitar saltos de línea forzados */
            .quiz-card {
                padding: 1.15rem 0.75rem;
                margin: auto;
                border-radius: 12px;
            }

            .q-header {
                gap: 0.6rem;
                margin-bottom: 1rem;
            }

            .q-badge {
                min-width: 27px;
                height: 27px;
                font-size: 0.8rem;
            }

            .q-text {
                font-size: 1.04rem;
                line-height: 1.35;
                font-weight: 700;
            }

            .option-btn {
                padding: 0.75rem 0.75rem;
                gap: 0.65rem;
                min-height: 48px;
                border-radius: 10px;
                font-size: 0.94rem;
            }

            .opt-letter {
                width: 26px;
                height: 26px;
                min-width: 26px;
                font-size: 0.78rem;
            }

            .opt-text {
                font-size: 0.94rem;
                line-height: 1.38;
            }

            .intro-title {
                font-size: 1.25rem;
            }

            .intro-text {
                font-size: 0.93rem;
                line-height: 1.55;
            }

            .quiz-nav {
                gap: 0.45rem;
            }

            .quiz-nav:not(.quiz-nav-form):not(.quiz-nav-instructions) .btn-ghost,
            .quiz-nav:not(.quiz-nav-form):not(.quiz-nav-instructions) .btn-primary-quiz {
                width: 48px;
                min-width: 48px;
                height: 46px;
                min-height: 46px;
                flex: 0 0 48px;
            }

            #preQInstructions .quiz-nav .btn-ghost,
            .quiz-nav-instructions .btn-ghost,
            #preQInstructions .quiz-nav .btn-primary-quiz,
            .quiz-nav-instructions .btn-primary-quiz,
            #quizForm .quiz-nav .btn-ghost,
            .quiz-nav-form .btn-ghost,
            #quizForm .quiz-nav .btn-primary-quiz,
            .quiz-nav-form .btn-primary-quiz {
                font-size: 0.92rem;
                padding: 0.65rem 0.85rem;
                min-height: 46px;
            }
        }

        /* ── Plantilla profesional para generar PDF ── */
        .pdf-page {
            width: 794px;
            min-height: 1123px;
            background: var(--bg-page);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            color: var(--text-main);
            position: absolute;
            left: -99999px;
            top: 0;
            overflow: hidden;
        }

        .pdf-page-header {
            width: 100%;
            background: var(--primary);
            padding: 24px 48px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .pdf-page-header img {
            width: 280px;
            max-height: 80px;
            object-fit: contain;
        }

        .pdf-page-header-title {
            color: #ffffff;
            font-size: 20px;
            font-weight: 700;
            text-align: right;
            line-height: 1.3;
        }

        .pdf-page-body {
            padding: 55px 70px;
        }

        .pdf-page-card {
            background: #ffffff;
            border-radius: 18px;
            box-shadow: 0 4px 24px rgba(26, 58, 107, .12);
            padding: 50px 46px;
            text-align: center;
        }

        .pdf-page-icon {
            font-size: 52px;
            margin-bottom: 12px;
        }

        .pdf-page-title {
            font-size: 30px;
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 22px;
        }

        .pdf-page-desc {
            font-size: 19px;
            font-weight: 600;
            line-height: 1.7;
            color: var(--text-main);
            margin-bottom: 34px;
        }

        .pdf-page-carr-title {
            font-size: 22px;
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 10px;
        }

        .pdf-page-carr {
            font-size: 20px;
            font-weight: 800;
            color: var(--primary-light);
            line-height: 1.65;
        }