        :root {
            --primary-color: #135bec;
            --primary-hover: #0e45b5;
            --external-color: #6f42c1;
            /* Color distintivo para Externos */
            --external-hover: #59359a;
            --bg-body: #f4f6f9;
            --bg-app: #ffffff;
            --input-border: #e1e4e8;
            --input-focus-shadow: rgba(19, 91, 236, 0.15);
        }

        body {
            font-family: 'Lexend', sans-serif;
            background-color: var(--bg-body);
            color: #1c1c1e;
            margin: 0;
            padding: 0;
            height: 100vh;
            overflow: hidden;
            /* El scroll lo maneja el app-frame o los contenedores internos */
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* --- CONTENEDOR PRINCIPAL RESPONSIVO --- */
        #app-frame {
            background-color: var(--bg-app);
            width: 100%;
            height: 100%;
            position: relative;
            /* Necesario para el absolute de los hijos */
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* ESTILOS DE ESCRITORIO (Pantallas Grandes) */
        @media (min-width: 992px) {
            #app-frame {
                width: 90%;
                max-width: 1000px;
                height: 85vh;
                max-height: 900px;
                border-radius: 24px;
                box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
                border: 1px solid rgba(0, 0, 0, 0.02);
            }
        }

        /* ESTILOS MÓVIL */
        @media (max-width: 991.98px) {
            #app-frame {
                height: 100vh;
                /* Full viewport height */
                border-radius: 0;
                box-shadow: none;
            }
        }

        /* --- PANTALLAS (BASE PARA ANIMATE.CSS) --- */
        .screen {
            position: absolute;
            /* Superposición para transiciones */
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-app);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            /* El scroll es interno en .scroll-container */
        }

        /* Gestión del Scroll Interno */
        .scroll-container {
            flex-grow: 1;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            /* Smooth scroll en iOS */
            padding-bottom: 2rem;
        }

        /* Scrollbar estilizado */
        .scroll-container::-webkit-scrollbar {
            width: 6px;
        }

        .scroll-container::-webkit-scrollbar-track {
            background: transparent;
        }

        .scroll-container::-webkit-scrollbar-thumb {
            background-color: rgba(0, 0, 0, 0.1);
            border-radius: 10px;
        }

        /* --- UTILIDADES PERSONALIZADAS --- */
        .text-primary-custom {
            color: var(--primary-color) !important;
        }

        .bg-primary-custom {
            background-color: var(--primary-color) !important;
        }

        .bg-primary-subtle-custom {
            background-color: rgba(19, 91, 236, 0.08) !important;
        }

        /* Botones */
        .btn-primary-custom {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
            padding: 12px 24px;
            border-radius: 14px;
            font-weight: 600;
            box-shadow: 0 4px 10px rgba(19, 91, 236, 0.2);
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .btn-primary-custom:hover {
            background-color: var(--primary-hover);
            border-color: var(--primary-hover);
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(19, 91, 236, 0.3);
        }

        .btn-primary-custom:active {
            transform: translateY(0);
        }

        .btn-primary-custom:disabled {
            background-color: #e9ecef !important;
            border-color: #e9ecef !important;
            color: #adb5bd !important;
            box-shadow: none !important;
            transform: none !important;
            cursor: not-allowed;
        }

        .btn-back {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: #495057;
            transition: all 0.2s;
        }

        .btn-back:hover {
            background-color: #f1f3f5;
            color: #212529;
        }

        /* Formularios Mejorados */
        .form-control-lg,
        .form-select-lg {
            border-radius: 12px;
            padding: 14px 16px;
            font-size: 1rem;
            border: 1px solid var(--input-border);
            background-color: #ffffff;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .form-control-lg:focus,
        .form-select-lg:focus,
        .form-control:focus,
        .form-select:focus {
            border-color: var(--primary-color);
            background-color: #fff;
            box-shadow: 0 0 0 4px var(--input-focus-shadow);
            outline: none;
        }

        .form-label {
            font-weight: 500;
            color: #343a40;
            margin-bottom: 0.5rem;
        }

        /* Inputs con Iconos */
        .input-group-text {
            border-color: var(--input-border);
            background-color: #f8f9fa;
            border-right: none;
            border-top-left-radius: 12px;
            border-bottom-left-radius: 12px;
            color: #6c757d;
        }

        .input-group .form-control {
            border-left: none;
        }

        .input-group:focus-within .input-group-text {
            border-color: var(--primary-color);
            background-color: #fff;
        }

        /* --- TARJETAS DE SELECCIÓN DE USUARIO (Screen 1) --- */
        .card-type-student,
        .card-type-external {
            border: 2px solid transparent;
            border-color: #f1f3f5;
            border-radius: 18px;
            padding: 18px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            background: white;
            position: relative;
            overflow: hidden;
            user-select: none;
        }

        .card-type-student:hover,
        .card-type-external:hover {
            transform: translateY(-3px);
            background-color: #fff;
        }

        /* STUDENT (BLUE) */
        .card-type-student .icon-box {
            width: 52px;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 14px;
            background-color: rgba(19, 91, 236, 0.08);
            color: var(--primary-color);
            transition: all 0.3s ease;
        }

        .card-type-student:hover {
            border-color: rgba(19, 91, 236, 0.3);
        }

        .card-type-student.active {
            border-color: var(--primary-color);
            background-color: rgba(19, 91, 236, 0.03);
            box-shadow: 0 10px 25px rgba(19, 91, 236, 0.12);
        }

        .card-type-student.active .icon-box {
            background-color: var(--primary-color);
            color: white;
            box-shadow: 0 4px 12px rgba(19, 91, 236, 0.3);
        }

        .card-type-student.active .radio-circle {
            border-color: var(--primary-color);
            background-color: var(--primary-color);
        }

        /* EXTERNAL (PURPLE) */
        .card-type-external .icon-box {
            width: 52px;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 14px;
            background-color: rgba(111, 66, 193, 0.08);
            color: var(--external-color);
            transition: all 0.3s ease;
        }

        .card-type-external:hover {
            border-color: rgba(111, 66, 193, 0.3);
        }

        .card-type-external.active {
            border-color: var(--external-color);
            background-color: rgba(111, 66, 193, 0.03);
            box-shadow: 0 10px 25px rgba(111, 66, 193, 0.12);
        }

        .card-type-external.active .icon-box {
            background-color: var(--external-color);
            color: white;
            box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
        }

        .card-type-external.active .radio-circle {
            border-color: var(--external-color);
            background-color: var(--external-color);
        }

        /* Radio Circle General */
        .radio-circle {
            width: 22px;
            height: 22px;
            border: 2px solid #ced4da;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.2s;
        }

        .radio-circle::after {
            content: '';
            width: 8px;
            height: 8px;
            background: white;
            border-radius: 50%;
            display: none;
        }

        .active .radio-circle::after {
            display: block;
        }

        /* Tarjetas de Cursos (Estilo simple) */
        .selection-card {
            border: 1px solid #e9ecef;
            border-radius: 16px;
            padding: 16px;
            cursor: pointer;
            transition: all 0.2s ease;
            background: white;
        }

        .selection-card:hover {
            background-color: #f8f9fa;
            border-color: #dee2e6;
            transform: translateY(-1px);
        }

        .selection-card.active {
            border-color: var(--primary-color);
            background-color: #f8faff;
            box-shadow: 0 0 0 1px var(--primary-color) inset;
        }

        .selection-card.active .radio-circle {
            border-color: var(--primary-color);
            background-color: var(--primary-color);
        }

        /* Iconos */
        .material-symbols-outlined {
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
        }

        .material-symbols-filled {
            font-variation-settings: 'FILL' 1;
        }

        /* Estilos Toggle Modalidad (Mejorados) */
        .modality-container {
            background-color: transparent;
            padding: 0;
            border: none;
        }

        .btn-modality {
            border: none;
            /* Removed border */
            border-radius: 12px;
            transition: all 0.2s;
            font-weight: 600;
            /* Fallback generic */
            background-color: #f8f9fa;
            color: #6c757d;
        }

        /* Estilo Inactivo / Base por Tipo */
        .btn-modality[data-type="all"] {
            background-color: #e9ecef;
            /* Gris suave */
            color: #495057;
        }

        .btn-modality[data-type="all"]:hover {
            background-color: #dee2e6;
        }

        .btn-modality[data-type="presencial"] {
            background-color: rgba(25, 135, 84, 0.1);
            /* Verde suave */
            color: #198754;
        }

        .btn-modality[data-type="presencial"]:hover {
            background-color: rgba(25, 135, 84, 0.2);
        }

        .btn-modality[data-type="virtual"] {
            background-color: rgba(19, 91, 236, 0.1);
            /* Azul suave */
            color: var(--primary-color);
        }

        .btn-modality[data-type="virtual"]:hover {
            background-color: rgba(19, 91, 236, 0.2);
        }

        /* Active States Modalities (Colores Solidos) */
        .btn-modality.active {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            color: white;
            transform: translateY(-1px);
        }

        .btn-modality[data-type="all"].active {
            background-color: #343a40;
            /* Neutral Dark Solid */
            box-shadow: 0 4px 12px rgba(52, 58, 64, 0.3);
        }

        .btn-modality[data-type="presencial"].active {
            background-color: #198754;
            /* Green Solid */
            box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
        }

        .btn-modality[data-type="virtual"].active {
            background-color: var(--primary-color);
            /* Blue Solid */
            box-shadow: 0 4px 12px rgba(19, 91, 236, 0.3);
        }

        /* Schedule Capacity Visuals */
        .capacity-box {
            background-color: #f8f9fa;
            border-radius: 10px;
            padding: 12px;
            border: 1px solid #e9ecef;
        }

        .capacity-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            font-weight: 700;
            color: var(--dark-color);
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }

        .capacity-bar-bg {
            height: 8px;
            background-color: #e9ecef;
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 6px;
        }

        .anim-header {
            position: sticky;
            top: 0;
            z-index: 10;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(0, 0, 0, 0.04);
            padding: 1rem 1.25rem;
        }

        /* Validación visual */
        .input-error {
            border-color: #dc3545 !important;
            animation: headShake 0.5s;
            /* Usando Animate.css headShake para error */
        }
