/* ========================================================================== */
/* ======================== 1. Variables CSS (Root) ========================= */
/* ========================================================================== */

:root {
    /* REDUCIR EL ZOOM O TAMAÑO DE TODO EL HTML */
    font-size: 95%;
}

/* ========================================================================== */
/* ===================== 2. Estilos Generales (Reset/Body) ================== */
/* ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(90deg, #023a94, #10459a, #488fed);
    min-height: 100vh;
    overflow-x: hidden;
    color: white; /* Color de texto por defecto para el body */
}

.container {
    display: flex;
    min-height: 100vh;
}

/* ========================================================================== */
/* ========================= 3. Animaciones (@keyframes) ==================== */
/* ========================================================================== */

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* ========================================================================== */
/* ================ 4. Layout Principal (Paneles Izquierdo/Derecho) ================ */
/* ========================================================================== */

.left-panel {
    display: none; /* Oculto por defecto en móvil */
    width: 50%;
    position: relative;
    overflow: hidden;
}

.right-panel {
    width: 100%; /* Ocupa todo el ancho en móvil */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    position: relative;
}

/* ========================================================================== */
/* ========================= 5. Decoraciones de Fondo ====================== */
/* ========================================================================== */

.background-decoration {
    position: absolute;
    inset: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(60px);
    opacity: 0.2;
}

.shape-1 {
    top: 80px;
    left: 80px;
    width: 288px;
    height: 288px;
    background: #3b82f6;
    animation: pulse 4s ease-in-out infinite;
}

.shape-2 {
    bottom: 80px;
    right: 80px;
    width: 288px;
    height: 288px;
    background: #06b6d4;
    animation: pulse 4s ease-in-out infinite 2s;
}

.shape-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 384px;
    height: 384px;
    background: #1d4ed8;
    animation: pulse 4s ease-in-out infinite 1s;
    opacity: 0.1;
}

.floating-particle {
    position: absolute;
    border-radius: 50%;
    background: white;
    opacity: 0.2;
    animation: float 6s ease-in-out infinite;
}

.particle-1 {
    top: 25%;
    right: 25%;
    width: 8px;
    height: 8px;
    animation-delay: 0s;
}

.particle-2 {
    bottom: 33%;
    left: 33%;
    width: 6px;
    height: 6px;
    animation-delay: 1.5s;
}

.particle-3 {
    top: 66%;
    right: 33%;
    width: 10px;
    height: 10px;
    animation-delay: 2.3s;
}

.mobile-background {
    position: absolute;
    inset: 0;
    display: block; /* Visible en móvil por defecto */
}

.mobile-shape-1 {
    top: -160px;
    right: -160px;
    width: 320px;
    height: 320px;
    background: #3b82f6;
    animation: pulse 4s ease-in-out infinite;
}

.mobile-shape-2 {
    bottom: -160px;
    left: -160px;
    width: 320px;
    height: 320px;
    background: #06b6d4;
    animation: pulse 4s ease-in-out infinite 2s;
}

.mobile-particle-1 {
    top: 25%;
    right: 33%;
    width: 6px;
    height: 6px;
    animation-delay: 0.7s;
}

.mobile-particle-2 {
    bottom: 33%;
    left: 25%;
    width: 4px;
    height: 4px;
    animation-delay: 1.2s;
}

/* ========================================================================== */
/* ==================== 6. Componentes Principales (Login Card) ============= */
/* ========================================================================== */

.login-card {
    width: 100%;
    max-width: 448px;
    position: relative;
    backdrop-filter: blur(10px);
    background: rgba(123, 219, 249, 0.278);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.5s ease;
    transform: translateY(0);
    opacity: 1;
    animation: fadeIn 0.8s ease-out;
}

.login-card:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    animation: float 6s ease-in-out infinite;
    transition: all 0.3s ease;
}

.login-icon:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.6);
}

.login-icon i {
    font-size: 32px;
    color: white;
}

.login-title {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-description {
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}

.form-group:hover {
    transform: translateY(-2px);
}

.form-group label {
    color: white;
    font-weight: 500;
    font-size: 14px;
}

.input-container {
    position: relative;
    transition: all 0.3s ease;
    align-items: center;
}

.input-container:focus-within {
    transform: scale(1.02);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
}

.input-container input {
    width: 100%;
    height: 48px;
    padding: 0 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-container input::placeholder {
    color: #94a3b8;
}

.input-container input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: white;
}

.login-button {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0) 100%);
    transition: all 0.5s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.login-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

/* ========================================================================== */
/* ============== 7. Componentes de la Sección Izquierda ==================== */
/* ========================================================================== */

.content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    /* color: white; - Ya definido en body */
}

.header-section {
    margin-bottom: 10px;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.6);
}

.logo-icon i {
    font-size: 24px;
    color: white;
}

.brand-title {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 16px;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.gradient-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #60a5fa, #06b6d4);
    transition: width 0.5s ease;
}

.main-title:hover .gradient-text::after {
    width: 100%;
}

.description {
    font-size: 20px;
    color: #e1dede;
    margin-bottom: 20px;
    line-height: 1.6;
}

.features-section {
    margin-bottom: 15px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 12px;
}

.feature-item:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-item:hover .feature-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.feature-item:hover .feature-content h3 {
    color: #60a5fa;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    transition: all 0.3s ease;
}

.feature-icon i {
    font-size: 24px;
    color: #60a5fa;
}

.feature-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.feature-content p {
    color: #d4d5d7;
    line-height: 1.5;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    font-size: 14px;
    color: #94a3b8;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: scale(1.1);
    color: white;
}

.badge i {
    color: #60a5fa;
}

/* ========================================================================== */
/* ======================== 8. Componentes Modales ======================== */
/* ========================================================================== */

/* Botones principales (pueden ser parte de un modal o login) */
.create-account-button,
.back-to-login-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: transparent;
    border: none;
    color: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.create-account-button:hover,
.back-to-login-button:hover {
    color: rgb(202, 244, 255);
    transform: translateY(-2px);
}

/* Select personalizado */
.input-container select {
    width: 100%;
    padding: 12px 45px;
    border: 2px solid rgba(0, 123, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

.input-container select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

/* Modal Overlay y Container */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 123, 255, 0.059);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: transparent; /* Verificado como opacidad 0 */
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 123, 255, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
}

/* Scroll del modal */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
    background: rgba(0, 123, 255, 0.3);
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 123, 255, 0.5);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* Encabezado del Modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.modal-subtitle {
    margin: 5px 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Cuerpo del Modal */
.modal-body {
    padding: 25px;
    background: rgba(248, 251, 255, 0.7);
}

/* Formulario del Modal */
.modal-form label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.modal-form input {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #2c3e50 !important;
    border: 2px solid rgba(0, 123, 255, 0.3) !important;
}

.modal-form input:focus {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
}

.modal-form input::placeholder {
    color: rgba(44, 62, 80, 0.6) !important;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-column .form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Botón de envío del Modal */
.modal-submit-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

/* ========================================================================== */
/* ===================== 9. Utilidades y Estados ============================ */
/* ========================================================================== */

/* Requisitos de contraseña simplificados */
.password-requirements {
    margin-top: 5px;
}

.password-requirements small {
    color: rgba(44, 62, 80, 0.7);
    font-size: 11px;
    line-height: 1.2;
}

.input-help {
    color: rgba(44, 62, 80, 0.7);
    font-size: 11px;
    margin-top: 3px;
    display: block;
}

/* Mensajes de error */
.error-message {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fecaca;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.error-message i {
    margin-right: 8px;
    color: #ef4444;
}

.error-message { /* Redundancia eliminada, esta regla ya tiene el !important */
    color: #bc2d2d !important;
}

.error-message span {
    color: #bc2d2d !important;
}

/* Mensaje de éxito */
.register-success-message {
    background: rgba(212, 237, 218, 0.9);
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(195, 230, 203, 0.8);
    backdrop-filter: blur(10px);
}

.register-success-message i {
    color: #28a745;
}


/* Estados de validación */
.modal-form input:invalid {
    border-color: rgba(220, 53, 69, 0.6) !important;
}

.modal-form input:valid {
    border-color: rgba(40, 167, 69, 0.6) !important;
}

/* Iconos de inputs */
.modal-form .input-icon {
    color: rgba(0, 123, 255, 0.7) !important;
}

/* Toggle de contraseña */
.modal-form .password-toggle {
    color: rgba(0, 123, 255, 0.7) !important;
}

.modal-form .password-toggle:hover {
    color: #007bff !important;
}

/* Estados de carga de botones */
.login-button .button-text {
    display: inline-block;
}

.login-button .button-loader {
    display: none;
    align-items: center;
    justify-content: center;
}

.login-button .button-loader i {
    margin-right: 8px;
}

.login-button.loading .button-text {
    display: none;
}

.login-button.loading .button-loader {
    display: flex;
}

.modal-submit-button.loading .button-text {
    opacity: 0;
}

.modal-submit-button.loading .button-loader {
    opacity: 1;
}

.modal-submit-button .button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ========================================================================== */
/* =========================== 10. Media Queries ============================ */
/* ========================================================================== */

@media (min-width: 1024px) {
    .left-panel {
        display: flex; /* Visible en pantallas grandes */
    }

    .right-panel {
        width: 50%; /* Ocupa la mitad en pantallas grandes */
    }

    .mobile-background {
        display: none; /* Oculto en pantallas grandes */
    }
}

@media (max-width: 768px) {
    .content {
        padding: 24px;
    }

    .main-title {
        font-size: 28px;
    }

    .description {
        font-size: 16px;
    }

    .trust-badges {
        flex-direction: column;
        gap: 16px;
    }

    .login-card {
        padding: 24px;
    }

    .modal-container {
        width: 95%;
        max-width: none;
        background: rgba(240, 248, 255, 0.95);
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-subtitle {
        font-size: 12px;
    }
}