body {
    padding-top: 20px;
    padding-bottom: 20px;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex; 
    flex-direction: column; /* FORZA que la cabecera y la caja se apilen en vertical */
    justify-content: flex-start; 
    align-items: center; /* Centra horizontalmente la cabecera y la caja */
    min-height: 100vh; 
    margin: 0;
    box-sizing: border-box;
}

/* Cabecera del logo: Comparte el mismo ancho exacto de .container */
.header-logo {
    width: 90%;
    max-width: 600px; /* Coincide exactamente con el max-width de .container */
    margin: 0 0 10px 0; 
    padding: 0; 
    display: flex;
    justify-content: flex-start; /* Empuja el logo totalmente a la izquierda */
    box-sizing: border-box;
}

/* Imagen del logo */
.logo-top-left {
    display: block;
    position: relative; 
    width: 180px;    
    height: auto; 
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.logo-top-left:hover {
    transform: scale(1.03); /* Efecto sutil al pasar el mouse */
}

/* Contenedor del Formulario */
.container {
    background: #fff; 
    padding: 30px; 
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    width: 90%; 
    max-width: 600px; 
    margin: 0 0 20px 0;
    box-sizing: border-box;
}

.form-row-dual {
    display: flex;       
    gap: 15px;           
    width: 100%;
}

.form-row-dual .form-group {
    flex: 1;             
    margin-bottom: 15px; 
}

/* Adaptación para pantallas pequeñas (Móviles) */
@media (max-width: 480px) {
    .header-logo {
        margin-bottom: 8px;
    }
    .logo-top-left {
        width: 130px; /* Tamaño adaptado a teléfonos */
    }
    .form-row-dual {
        flex-direction: column;
        gap: 0;
    }
}

.help-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1001;
    transition: transform 0.2s ease;
}

.tooltip-box {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.tooltip-box::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

.tooltip-hidden {
    opacity: 0;
}

.help-button:hover {
    transform: scale(0.9);
}

.video-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    position: relative;
    width: 85%;
    max-width: 350px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#tutorialVideo {
    width: 100%;
    aspect-ratio: 9 / 16;
    display: block;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.main-title { 
    text-align: center; 
    color: #1e3c72; 
    font-size: 2rem; 
    font-weight: 800; 
    margin-bottom: 0; 
}

h3 { 
    text-align: center; 
    color: #2c467571; 
    font-size: 18px; 
    margin-top: -5px; 
}

.subtitulo-estudiante {
    text-align: center;
    color: #1e3c72;      
    font-size: 1.1rem;
    font-weight: 600;
    font-style: italic;
    margin-top: -10px;   
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc; 
    text-transform: uppercase;      
}

#contenedor_cuotas {
    margin-top: 10px;
}

input[readonly].auto-fill {
    background-color: #f8f9fa;
    border-color: #d1d1d1;
    color: #555;
}

h2 { 
    text-align: center; 
    color: #3498db; 
    border-bottom: 2px solid #3498db; 
    padding-bottom: 10px; 
}

.form-group { margin-bottom: 15px; }

input, select { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    box-sizing: border-box; 
}

input[readonly] { 
    background-color: #eceef1; 
    cursor: not-allowed; 
}

.tabla-cuotas {
    width: 100%; border-collapse: collapse; 
    margin-bottom: 20px; 
    font-size: 0.9rem; 
}

.tabla-cuotas th, .tabla-cuotas td {
    padding: 10px; 
    border: 1px solid #ddd; 
}

.tabla-cuotas th { 
    background-color: #f2f2f2; 
}

.texto-rojo { 
    color: #e74c3c; 
    background-color: #fdf2f2; 
    font-weight: bold; 
}

.fila-seleccionada { 
    background-color: #e1f5fe !important; 
}

button {
    width: 100%; padding: 14px; background-color: #3498db;
    color: white; border: none; border-radius: 6px;
    font-weight: bold; cursor: pointer; transition: 0.3s;
}

button:hover:not(:disabled) { background-color: #2980b9; transform: translateY(-1px); }

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-back { 
    background-color: #7f8c8d; 
    margin-top: 10px; 
}

.d-none { 
    display: none;
}

.btn-inscripcion-activa {
    background-color: #28a745;
    color: #ffffff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-inscripcion-activa:hover {
    background-color: #218838;
}

.btn-bloqueado {
    background-color: #e0e0e0;
    color: #888888;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: not-allowed;
}

.input-calculadora {
    font-family: monospace;
    font-size: 1.2rem;
    text-align: right;
    font-weight: bold;
    letter-spacing: 1px;
}

.alerta-monto {
    color: #d9534f;
    background-color: #fdf7f7;
    border: 1px solid #d9534f;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 6px;
}