:root {
    /* Colores base */
    --primary: #003366;          /* Azul oscuro */
    --primary-light: #335288;    /* Azul medio */
    --primary-lighter: #6680AA;  /* Azul claro */
    --primary-dark: #001933;     /* Azul muy oscuro */

    --secondary: #fe4d39;        /* Rojo-naranja */
    --secondary-light: #ff7b63;  /* Rojo-anaranjado claro */
    --secondary-dark: #b33326;   /* Rojo-anaranjado oscuro */

    /* Estados */
    --success: #00CC66;           /* Verde */
    --success-light: #66E0A3;     /* Verde suave */
    --warning: #f28503;           /* Naranja */
    --warning-light: #f7b347;     /* Naranja suave */
    --danger: #FF3333;            /* Rojo fuerte */
    --danger-light: #FF7F7F;      /* Rojo suave */

    /* Neutrales y textos */
    --text: #4D4D4D;             /* Gris oscuro */
    --text-light: #7A7A7A;       /* Gris medio */
    --text-lighter: #B3B3B3;     /* Gris claro */
    --white: #FFFFFF;
    --gray-light: #F5F5F5;       /* Fondo suave */
    --gray-medium: #CCCCCC;      /* Bordes */
    --gray-dark: #999999;        /* Subtext */

    /* Accentos y resaltados */
    --info: #3399FF;             /* Azul brillante */
    --info-light: #80C0FF;       /* Azul claro */
    --highlight: #FFDD57;        /* Amarillo suave para detalles */

    --light: #F4F4F4;           /* Gris claro / fondos y separadores */
    --dark: #003366;            /* Azul oscuro – fondos oscuros */
    --muted: #A0A0A0;           /* Texto secundario / gris */
    --success-light: #7CE39B;   /* Verde claro */
    --warning-light: #f28503;   /* Amarillo claro */
    --danger-light: #FF6B7D;    /* Rojo claro */
    --accent: #fe4d39;          /* Rosa / highlights */
}

/* Reset mejorado */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

/* Layout principal */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sección del formulario (35%) */
.form-section {
    width: 35%;
    min-width: 400px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

/* Sección visual (65%) */
.visual-section {
    width: 65%;
    position: relative;
    overflow: hidden;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 51, 102, 0.7) 0%,
        rgba(254, 77, 57, 0.5) 100%
    );
    z-index: 2;
}

/* Estilos del formulario */
.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* Logo centrado */
.nav-brand-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700;
    font-size: 2rem;
    color: #0f172a;
    margin-bottom: 2rem;
}

.nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotate 8s linear infinite;
}

.nav-logo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
}

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

.login-card h2 {
    margin-bottom: 1.8rem;
    font-size: 1.6rem;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-lighter);
    z-index: 2;
    font-size: 1rem;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    border: 1px solid var(--gray-medium);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--light);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
    background-color: var(--white);
}

.error-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: "⚠";
    margin-right: 0.3rem;
    font-size: 0.7rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    margin-right: 0.5rem;
    accent-color: var(--primary);
}

.remember-me label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0;
    white-space: nowrap;
}

.forgot a {
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--primary);
    transition: color 0.2s;
    font-weight: 500;
}

.forgot a:hover {
    color: var(--secondary);
}

.btn-submit {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2);
}

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

.btn-submit::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-submit:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.8rem 0;
    color: var(--text-lighter);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--gray-medium);
}

.divider::before {
    margin-right: 0.5rem;
}

.divider::after {
    margin-left: 0.5rem;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--light);
    border: 1px solid var(--gray-medium);
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.register-link {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.register-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    color: var(--secondary);
}

/* Alert para errores de Google */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: rgba(255, 51, 51, 0.1);
    border: 1px solid var(--danger-light);
    color: var(--danger);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .form-section {
        width: 100%;
        min-width: auto;
        padding: 2rem 1.5rem;
        height: auto;
        min-height: 60vh;
        justify-content: flex-start;
        padding-top: 3rem;
    }

    .visual-section {
        width: 100%;
        height: 40vh;
    }

    .nav-brand-login {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .login-card h2 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
}

/* Móvil grande (576px - 768px) */
@media (max-width: 768px) {
    .form-section {
        padding: 1.5rem 1rem;
        min-height: 65vh;
    }

    .visual-section {
        height: 35vh;
    }

    .nav-brand-login {
        font-size: 1.6rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .nav-logo {
        width: 35px;
        height: 35px;
    }

    .login-card {
        max-width: 100%;
    }

    .login-card h2 {
        font-size: 1.3rem;
        margin-bottom: 1.3rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .forgot {
        width: 100%;
        text-align: left;
    }

    .divider {
        margin: 1.5rem 0;
    }
}

/* Móvil pequeño (menos de 576px) */
@media (max-width: 576px) {
    body, html {
        font-size: 14px;
    }

    .form-section {
        padding: 1rem;
        min-height: 70vh;
        justify-content: center;
    }

    .visual-section {
        height: 30vh;
    }

    .nav-brand-login {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }

    .nav-logo {
        width: 30px;
        height: 30px;
    }

    .login-card h2 {
        font-size: 1.2rem;
        margin-bottom: 1.2rem;
    }

    input[type="email"],
    input[type="password"] {
        padding: 0.8rem 0.8rem 0.8rem 2.5rem;
        font-size: 0.95rem;
    }

    .input-icon {
        left: 0.8rem;
        font-size: 0.9rem;
    }

    .btn-submit {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .social-btn {
        width: 40px;
        height: 40px;
    }

    .register-link {
        font-size: 0.85rem;
    }
}

/* Pantallas muy pequeñas (menos de 360px) */
@media (max-width: 360px) {
    .nav-brand-login {
        font-size: 1.2rem;
    }

    .nav-logo {
        width: 25px;
        height: 25px;
    }

    .login-card h2 {
        font-size: 1.1rem;
    }

    input[type="email"],
    input[type="password"] {
        padding: 0.7rem 0.7rem 0.7rem 2.2rem;
    }

    .btn-submit {
        padding: 0.7rem;
    }

    .social-login {
        gap: 0.5rem;
    }

    .social-btn {
        width: 35px;
        height: 35px;
    }

    .social-btn img {
        width: 16px;
        height: 16px;
    }
}

/* Orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        flex-direction: row;
    }

    .form-section {
        width: 50%;
        min-height: 100vh;
        padding: 1rem;
        overflow-y: auto;
    }

    .visual-section {
        width: 50%;
        height: 100vh;
    }

    .nav-brand-login {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .nav-logo {
        width: 25px;
        height: 25px;
    }

    .login-card h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

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

/* Pantallas muy altas */
@media (min-height: 900px) {
    .form-section {
        padding: 3rem 2rem;
    }

    .login-card {
        max-width: 450px;
    }
}