* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #494949;
    --secondary: #131313;
    --dark: #121212;
    --darker: #0a0a0a;
    --light: #f8f9fa;
    --gray: #e0e0e0;
    --text: #111827;
    --text-light: #6b7280;
    --card-bg: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(249, 250, 251, 0.8);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.split-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* =========================================
   PANEL IZQUIERDO (ESCRITORIO)
   ========================================= */
.left-panel {
    flex: 0 0 50%;
    background: var(--darker);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%);
    z-index: 1;
    padding: 2rem;
    height: 100vh;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(2px);
    animation: float 8s ease-in-out infinite;
}

.shape--1 { width: 220px; height: 220px; top: 15%; left: 10%; animation-delay: 0s; }
.shape--2 { width: 160px; height: 160px; bottom: 20%; right: 20%; animation-delay: 2s; }
.shape--3 { width: 100px; height: 100px; top: 70%; left: 25%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
}

.logo--main {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: scale(1.45);
    filter: drop-shadow(0 15px 40px rgba(0,0,0,0.6));
    transition: var(--transition);
}

/* =========================================
   PANEL DERECHO (ESCRITORIO)
   ========================================= */
.right-panel {
    flex: 0 0 50%;
    background-color: var(--dark);
    position: relative;
    z-index: 2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.right-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 5rem;
    padding-left: 3rem;
    padding-right: 3rem;
    padding-bottom: 2rem;
}

.login-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

.login-card {
    width: 100%;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 480px;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
}

.login-header h1::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 3px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.125rem;
    margin-top: 1.5rem;
    font-weight: 400;
}

/* --- Inputs --- */
.input-field {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-light);
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 1;
}

.input {
    width: 100%;
    padding: 1.125rem 1.125rem 1.125rem 3.125rem;
    font-size: 1.0625rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: var(--input-bg);
    transition: var(--transition);
    font-family: inherit;
    height: 3.5rem;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(73, 73, 73, 0.2);
    background: white;
}

.password-toggle {
    position: absolute;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.125rem;
    z-index: 2;
    padding: 0.25rem;
    border-radius: 6px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--text);
    background: rgba(0,0,0,0.03);
}

/* --- Botón principal --- */
.btn-login {
    width: 100%;
    padding: 1.125rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    height: 3.75rem;
    font-family: inherit;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.btn-login::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.7s;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(73, 73, 73, 0.3);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

/* Logo secundario (Aparece abajo del formulario en escritorio) */
.secondary-logo-container {
    width: 280px;
    height: 280px;
    margin-top: auto;
    padding-bottom: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo--secondary {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: var(--transition);
}

.logo--secondary:hover {
    opacity: 1;
    transform: scale(1.02);
}

.curve-separator {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.curve-separator svg {
    width: 100%;
    height: 100%;
}

/* =========================================
   MEDIA QUERIES - RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 1200px) {
    .logo--main {
        max-width: 90%;
        max-height: 90vh;
    }
    
    .right-content {
        padding-top: 4rem;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* TABLETS Y MÓVILES - LOGOS LADO A LADO ARRIBA, LUEGO FORMULARIO */
@media (max-width: 1024px) {
    body {
        overflow-y: auto;
        background: var(--dark); 
    }

    .split-layout {
        display: flex;
        flex-direction: row; /* Convertimos la pantalla móvil en filas horizontales */
        flex-wrap: wrap; /* Permitimos que los elementos caigan hacia abajo si no caben */
        align-content: flex-start;
        height: auto;
        min-height: 100vh;
        padding: 2rem 1.5rem 4rem 1.5rem; 
        background: var(--dark);
    }
    
    /* ¡MAGIA!: Desempaquetamos todos los contenedores para ordenar su contenido libremente */
    .left-panel, 
    .right-panel, 
    .right-content {
        display: contents; 
    }
    
    /* 1. PRIMERA IMAGEN (Mitad izquierda) */
    .logo-container {
        order: 1;
        width: 50%; /* Ocupa la mitad del ancho */
        height: 110px; /* Altura fija para que ambos lados sean parejos */
        padding: 0 0.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo--main {
        max-width: 100%; 
        max-height: 100%;
        transform: scale(1);
    }
    
    /* 2. SEGUNDA IMAGEN (Mitad derecha) */
    .secondary-logo-container {
        order: 2; 
        width: 50%; /* Ocupa la otra mitad del ancho */
        height: 110px; /* Misma altura */
        margin: 0;
        padding: 0 0.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
        position: static;
    }

    .logo--secondary {
        max-width: 100%; 
        max-height: 100%;
        width: auto;
        object-fit: contain; 
    }

    /* 3. EL FORMULARIO VA ABAJO DE LOS DOS LOGOS */
    .login-container {
        order: 3;
        width: 100%;
        max-width: 500px;
        margin: 2rem auto 0 auto; /* Separación entre los logos de arriba y el cuadro */
    }

    /* Ocultamos elementos decorativos que rompen el diseño móvil */
    .curve-separator, .shape {
        display: none; 
    }

    .login-card {
        min-height: auto;
    }
}

/* MÓVILES MEDIANOS */
@media (max-width: 768px) {
    .login-card {
        padding: 2.25rem 1.75rem;
    }
    
    .login-header h1 {
        font-size: 2.25rem;
    }
}

/* MÓVILES PEQUEÑOS */
@media (max-width: 480px) {
    .split-layout {
        padding: 1.5rem 1rem 3rem 1rem;
    }

    /* Hacemos los logos un poco más compactos */
    .logo-container {
        
        height: 160px;
        width: 160px;
    }
    .secondary-logo-container {
      
        height: 160px;
        width: 190px;
    }

    .login-header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input {
        padding: 1rem 1rem 1rem 2.75rem;
        height: 3.25rem;
        font-size: 1rem;
    }
    
    .btn-login {
        height: 3.5rem;
        font-size: 1.0625rem;
    }
    
    .login-card {
        padding: 1.5rem 1rem;
    }
    
    .input-field {
        margin-bottom: 1.5rem;
    }
}