/* ==============================================
   VARIABLES Y BASE
   ============================================== */
:root {
    --primary: #0056b3;
    --primary-light: #3b82f6;
    --primary-dark: #003d82;
    --accent: #06b6d4;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--white);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ==============================================
   CONTENEDOR PRINCIPAL
   ============================================== */
.split-screen-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* ==============================================
   LADO IZQUIERDO — FORMULARIO
   ============================================== */
.left-side {
    width: 42%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Línea decorativa sutil arriba */
.left-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0.8;
}

/* ==============================================
   LOGIN WRAPPER
   ============================================== */
.login-wrapper {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: auto;
    animation: fadeSlideUp 0.8s ease both;
}

/* ==============================================
   LOGO
   ============================================== */
.login-logo {
    width: 190px;
    height: auto;
    margin: 0 auto 1rem auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 86, 179, 0.15));
    animation: logoReveal 1s ease 0.2s both;
}

@keyframes logoReveal {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
        filter: drop-shadow(0 4px 12px rgba(0, 86, 179, 0));
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 4px 12px rgba(0, 86, 179, 0.15));
    }
}

/* ==============================================
   TÍTULO Y SUBTÍTULO
   ============================================== */
.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
    text-align: center;
    width: 100%;
    animation: fadeSlideUp 0.6s ease 0.3s both;
}

.login-subtitle {
    font-size: 0.88rem;
    color: var(--gray-400);
    margin-bottom: 1.8rem;
    text-align: center;
    width: 100%;
    animation: fadeSlideUp 0.6s ease 0.35s both;
}

/* ==============================================
   INPUT GROUPS
   ============================================== */
.input-group {
    margin-bottom: 1.2rem;
    animation: fadeSlideUp 0.6s ease var(--delay, 0s) both;
}

.input-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.45rem;
    display: block;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
    transition: transform var(--transition);
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--gray-50);
    outline: none;
    transition: all var(--transition);
}

.login-input::placeholder {
    color: var(--gray-300);
    font-weight: 400;
}

.login-input:hover {
    border-color: var(--gray-300);
    background: var(--white);
}

.login-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.08);
}

.login-input:focus ~ .input-icon,
.login-input:focus + .input-icon {
    transform: scale(1.15);
}

/* Botón de mostrar/ocultar contraseña */
.toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: background var(--transition);
    z-index: 2;
    line-height: 1;
}

.toggle-password:hover {
    background: var(--gray-100);
}

#eye-icon {
    display: block;
    transition: transform 0.2s ease;
}

.toggle-password:active #eye-icon {
    transform: scale(0.85);
}

/* ==============================================
   CHECKBOX CUSTOM
   ============================================== */
.login-options {
    animation: fadeSlideUp 0.6s ease var(--delay, 0s) both;
    margin-bottom: 0.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 1.6rem;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    transition: all var(--transition);
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 0.5px;
    width: 5px;
    height: 9px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.checkbox-wrapper input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input:checked ~ .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.checkbox-wrapper:hover .checkmark {
    border-color: var(--primary);
}

/* ==============================================
   BOTÓN LOGIN
   ============================================== */
.login-btn {
    width: 100%;
    padding: 0.95rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 0.8rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.08em;
    animation: fadeSlideUp 0.6s ease var(--delay, 0s) both;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 86, 179, 0.35);
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
}

.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
    transform: none !important;
    box-shadow: none !important;
}

.btn-text {
    position: relative;
    z-index: 1;
    transition: opacity 0.2s;
}

.login-btn:disabled .btn-text {
    opacity: 0;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    animation: none;
}

.login-btn:disabled .btn-loader {
    opacity: 1;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==============================================
   MENSAJE DE ERROR
   ============================================== */
.text-danger {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    border-left: 4px solid var(--danger);
    text-align: center;
    margin-top: 0.8rem;
    display: none;
    animation: shakeIn 0.5s ease;
}

@keyframes shakeIn {
    0% { transform: translateX(-10px); opacity: 0; }
    25% { transform: translateX(8px); }
    50% { transform: translateX(-4px); }
    75% { transform: translateX(2px); }
    100% { transform: translateX(0); opacity: 1; }
}

/* ==============================================
   COPYRIGHT
   ============================================== */
.copyright {
    position: absolute;
    bottom: 20px;
    font-size: 0.72rem;
    color: var(--gray-300);
    letter-spacing: 0.01em;
    animation: fadeSlideUp 0.6s ease 0.6s both;
}

/* ==============================================
   LADO DERECHO — FONDO E IMAGEN
   ============================================== */
.right-side {
    width: 58%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0a1628;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 3.5rem;
    position: relative;
    overflow: hidden;
}

/* Capa de gradiente oscura para legibilidad */
.right-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 20, 60, 0.3) 0%,
        rgba(0, 15, 50, 0.5) 40%,
        rgba(0, 10, 40, 0.85) 100%
    );
    z-index: 1;
}

/* Capa con pattern sutil */
.right-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    z-index: 1;
    animation: pulseOverlay 8s ease-in-out infinite alternate;
}

@keyframes pulseOverlay {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* ==============================================
   FORMAS FLOTANTES (Geometría)
   ============================================== */
.floating-shapes {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.07;
    background: var(--white);
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -60px;
    animation: floatShape1 12s ease-in-out infinite;
}

.shape-2 {
    width: 180px;
    height: 180px;
    bottom: 15%;
    left: -40px;
    animation: floatShape2 10s ease-in-out infinite;
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 15%;
    animation: floatShape3 8s ease-in-out infinite;
}

.shape-4 {
    width: 60px;
    height: 60px;
    bottom: 35%;
    right: 25%;
    opacity: 0.05;
    animation: floatShape2 14s ease-in-out infinite reverse;
}

.shape-5 {
    width: 140px;
    height: 140px;
    top: 15%;
    left: 20%;
    opacity: 0.04;
    animation: floatShape1 16s ease-in-out infinite reverse;
}

@keyframes floatShape1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.05); }
    66% { transform: translate(-15px, 15px) scale(0.95); }
}

@keyframes floatShape2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(25px, -20px) rotate(10deg); }
}

@keyframes floatShape3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-15px, 20px); }
    75% { transform: translate(10px, -15px); }
}

/* ==============================================
   TARJETA FLOTANTE (Imagen de oficina)
   ============================================== */
.floating-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 380px;
    z-index: 5;
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: cardEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
}

/* Borde de cristal sutil */
.floating-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
    z-index: 6;
}

/* Resplandor detrás de la tarjeta */
.card-glow {
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.2), transparent 70%);
    z-index: -1;
    animation: glowPulse 4s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from { opacity: 0.5; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1.05); }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.85) rotate(-2deg);
        filter: blur(8px) brightness(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -55%) scale(1) rotate(0deg);
        filter: blur(0px) brightness(1);
    }
}

.floating-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-xl);
}

/* Flotación suave de la tarjeta */
.floating-card {
    animation: cardEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both,
               cardFloat 6s ease-in-out 1.7s infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translate(-50%, -55%) rotate(0deg); }
    50% { transform: translate(-50%, -57%) rotate(0.5deg); }
}

/* ==============================================
   TEXTO SOBRE IMAGEN
   ============================================== */
.art-text {
    position: relative;
    z-index: 10;
    color: var(--white);
    text-align: center;
    max-width: 75%;
    animation: textReveal 1s ease 0.8s both;
}

.art-text h2 {
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.01em;
}

.art-divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    margin: 0 auto 0.8rem;
    border-radius: 2px;
}

.art-text p {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.75;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   ANIMACIONES GENERALES
   ============================================== */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 950px) {
    .right-side {
        display: none;
    }

    .left-side {
        width: 100%;
        padding: 2rem 1.5rem;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-logo {
        width: 180px;
        margin-bottom: 1.5rem;
    }

    .left-side::before {
        height: 3px;
    }
}

@media (max-width: 480px) {
    .left-side {
        padding: 1.5rem 1.2rem;
    }

    .login-title {
        font-size: 1.35rem;
    }

    .login-input {
        padding: 0.75rem 0.9rem 0.75rem 2.6rem;
        font-size: 0.88rem;
    }

    .login-btn {
        padding: 0.85rem;
        font-size: 0.9rem;
    }
}