* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f0f4ff;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.navbar {
    padding: 24px 60px;
}

.logo-box {
    width: 140px;
    height: 44px;
    border-radius: 4px;
}

/* Layout */
.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    flex: 1;
}

/* Sección Izquierda */
.left-section {
    flex: 1;
    max-width: 500px;
    padding-right: 40px;
}

.left-section h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 40px;
    color: #0b0c10;
}

.features {
    display: flex;
    gap: 30px;
}

.feature-item {
    flex: 1;
    border-left: 2px solid #ccc;
    padding-left: 12px;
}

.feature-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.35;
}

/* Sección Derecha */
.right-section {
    width: 100%;
    max-width: 420px;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 32px 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: #111;
}

.input-group {
    margin-bottom: 16px;
    position: relative;
    margin-bottom: 8px; /* Reducido para dar espacio al texto de error */
}

.error-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc2626;
    display: none;
}

/* Mensaje de error debajo del input */
.error-message {
    font-size: 0.8rem;
    color: #dc2626;
    margin-bottom: 16px;
    display: none;
    text-align: left;
    padding-left: 4px;
}
.input-group.error input {
    border-color: #dc2626;
    color: #dc2626;
}

.input-group.error input::placeholder {
    color: #dc2626;
}

.input-group.error .error-icon {
    display: flex;
}

.error-message.active {
    display: block;
}
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #4b5563;
}

.toggle-password:hover {
    color: #111;
}
.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #4b62db;
}

.password-group {
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.forgot-password {
    text-align: right;
    margin-top: -6px;
    margin-bottom: 20px;
}

.forgot-password a {
    color: #3b82f6;
    font-size: 0.8rem;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: #aebbf2;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #4b62db;
}

.btn-submit.active {
    background-color: color-mix(in srgb, rgb(62, 85, 200) 90%, rgb(255, 255, 255) 10%);
    cursor: pointer;
}

.divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    position: relative;
    background: #ffffff;
    padding: 0 10px;
    font-size: 0.82rem;
    color: #4b5563;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    color: #111;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #f9fafb;
}

.subtitle {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Footer */
.footer-links {
    margin-top: 24px;
    text-align: center;
    font-size: 0.78rem;
    color: #6b7280;
}

.footer-links a {
    color: #3b82f6;
    text-decoration: none;
    margin: 0 4px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links p {
    margin-top: 6px;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 20px;
    }

    .left-section {
        max-width: 100%;
        padding-right: 0;
        margin-bottom: 40px;
    }

    .features {
        flex-direction: column;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5); /* Fondo semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 460px;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    text-align: left;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4b5563;
}

.modal-icon-box {
    width: 44px;
    height: 44px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.modal-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
    line-height: 1.4;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 24px;
}

.otp-container label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.otp-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 28px;
}

.otp-input {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    background: #fff;
    transition: all 0.2s;
}

.otp-input:focus {
    border-color: #4b62db;
    box-shadow: 0 0 0 3px rgba(75, 98, 219, 0.15);
}

.otp-separator {
    font-size: 1.5rem;
    color: #9ca3af;
    font-weight: 300;
}

.btn-confirmar:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-confirmar:not(:disabled) {
    background-color: #4b62db;
    color: #fff;
    cursor: pointer;
}

/* ========================================= */
/* ESTILOS RESPONSIVOS PARA DISPOSITIVOS MÓVILES */
/* ========================================= */

@media (max-width: 768px) {
    /* Ajustar el contenedor principal en columna */
    .logo-box {
        width: 120px;
        height: 27px;
        margin: 0 auto;
    }
    .logo-box img{
        width: 120px;
        height: 27px;
    }
    .container {
        flex-direction: column;
        padding: 15px;
        gap: 30px;
    }

    /* Reducir márgenes y padding del navbar */
    .navbar {
        display: flex;
        padding: 16px 20px;
    }

    .logo-box {
        width: 110px;
        height: 36px;
    }

    /* Sección izquierda (textos y características) */
    .left-section {
        max-width: 100%;
        padding-right: 0;
        text-align: center;
        display: none;
    }

    .left-section h1 {
        font-size: 2rem; /* Tamaño de fuente más pequeño para pantallas móviles */
        line-height: 1.2;
        margin-bottom: 24px;
    }

    /* Cambiar las características a una sola columna y centrar */
    .features {
        flex-direction: column;
        gap: 16px;
        text-align: left;
        max-width: 320px;
        margin: 0 auto;
    }

    .feature-item {
        border-left: 2px solid #4b62db;
        padding-left: 12px;
    }

    /* Sección derecha (tarjeta de login) */
    .right-section {
        max-width: 100%;
    }

    .card {
        padding: 24px 20px 20px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .card h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    /* Ajuste de inputs y botones para facilitar el toque en celulares */
    .input-group input {
        padding: 12px 14px;
        font-size: 1rem; /* Evita que algunos navegadores móviles hagan zoom automático */
    }

    .btn-submit, .btn-secondary {
        padding: 12px;
        font-size: 0.95rem;
    }

    /* Enlaces del pie de página */
    .footer-links {
        font-size: 0.75rem;
        padding: 0 10px;
    }
}
/* Contenedor del spinner */
#loader-espera {
    display: none; /* Se mantiene oculto hasta que JavaScript lo active */
    text-align: center;
    margin-top: 50px;
    font-family: sans-serif;
    color: #333;
}

/* Estilo cuando hay error en los inputs del OTP */
.otp-input.error {
    border-color: #e74c3c !important; /* Borde rojo */
    background-color: #fdf2f2 !important; /* Fondo rojizo suave */
    color: #e74c3c;
}

/* El círculo giratorio */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;       /* Color de fondo del círculo (gris claro) */
    border-top: 5px solid #3498db;   /* Color del borde que gira (azul, puedes cambiarlo al color de tu web) */
    border-radius: 50%;
    margin: 0 auto 20px auto;        /* Centra el spinner horizontalmente y deja espacio abajo */
    animation: girar 1s linear infinite; /* Animación continua */
}

/* Animación de giro */
@keyframes girar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Pantallas muy pequeñas (menos de 480px, ej. celulares compactos) */
@media (max-width: 480px) {
    .left-section h1 {
        font-size: 1.7rem;
    }
    
    body {
        background-color: #ffffff; /* Opcional: fondo blanco en pantallas muy pequeñas para maximizar espacio */
    }
    .modal-card {
        max-width: 92%;          /* Deja un pequeño margen a los lados de la pantalla */
        padding: 24px 16px;      /* Reduce los espacios internos para aprovechar el espacio */
        max-height: 90vh;        /* Evita que sea más alto que la pantalla del celular */
        overflow-y: auto;        /* Permite hacer scroll interno si la pantalla es muy pequeña */
        border-radius: 12px;
    }

    .modal-card h2 {
        font-size: 1.1rem;       /* Título un poco más compacto */
        line-height: 1.3;
    }

    .modal-subtitle {
        font-size: 0.78rem;
        margin-bottom: 16px;
    }

    /* Ajustar las 6 casillas del OTP para que no se salgan en pantallas angostas */
    .otp-inputs {
        gap: 4px;                
        margin-bottom: 20px;
        justify-content: center;
    }

    .otp-input {
        width: 38px;             /* Ancho ligeramente menor para celulares */
        height: 44px;            /* Altura proporcional */
        font-size: 1.1rem;
    }

    .otp-separator {
        font-size: 1.2rem;
        margin: 0 2px;
    }

    .modal-close {
        top: 14px;
        right: 14px;
    }
}

