@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #48bb78;
    --error: #fc8181;
    --error-bg: rgba(252, 129, 129, 0.1);
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --bg-light: #f7fafc;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --shadow-xl: 0 25px 50px rgba(0,0,0,0.25);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Fondo animado */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.sphere-1 {
    width: 600px;
    height: 600px;
    background: var(--gradient-primary);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.sphere-2 {
    width: 500px;
    height: 500px;
    background: var(--gradient-accent);
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.sphere-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }
    75% {
        transform: translate(40px, 40px) scale(1.05);
    }
}

/* Contenedor principal */
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Panel de branding (izquierdo) */
.branding-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.branding-content {
    max-width: 450px;
    color: var(--white);
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.branding-content.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.logo-container {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: var(--white);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 25px 60px rgba(102, 126, 234, 0.6);
    }
}

.logo-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-badge {
    display: inline-block;
    background: var(--gradient-accent);
    color: var(--white);
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

/* Lista de características */
.features-list {
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 1.25rem;
    color: var(--white);
}

.feature-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-text p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.branding-footer {
    margin-top: 3rem;
    text-align: center;
}

.branding-footer p {
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.7;
}

/* Panel de login (derecho) */
.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-container.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.welcome-icon {
    font-size: 4rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Formulario */
.login-form {
    margin-top: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    transition: all 0.3s ease;
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-light);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.input-group.focused .input-icon {
    color: var(--primary);
}

.input-highlight {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.input-group input:focus ~ .input-highlight {
    width: calc(100% - 4px);
}

/* Toggle password */
.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Mensaje de error */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--error-bg);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--error);
    animation: shake 0.5s ease-in-out;
}

.error-message i {
    color: #e53e3e;
    font-size: 1.1rem;
}

.error-message span {
    color: #c53030;
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Botón de login */
.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.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.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
    transform: translateX(5px);
}

/* Footer del login */
.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.secure-badge i {
    color: var(--success);
}

/* Logo móvil */
.mobile-logo {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
    z-index: 10;
    align-items: center;
    gap: 0.5rem;
}

.mobile-logo i {
    font-size: 1.5rem;
}

.mobile-logo small {
    background: var(--gradient-accent);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .branding-panel {
        display: none;
    }
    
    .login-panel {
        flex: none;
        width: 100%;
    }
    
    .mobile-logo {
        display: flex;
    }
    
    .login-container {
        margin-top: 4rem;
    }
}

@media (max-width: 480px) {
    .login-panel {
        padding: 1rem;
    }
    
    .login-container {
        padding: 2rem 1.5rem;
        border-radius: 20px;
        margin-top: 5rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .welcome-icon {
        font-size: 3rem;
    }
    
    .input-group input {
        padding: 0.9rem 0.9rem 0.9rem 3rem;
        font-size: 0.95rem;
    }
    
    .btn-login {
        padding: 0.9rem 1.5rem;
    }
    
    .mobile-logo {
        font-size: 1.1rem;
    }
}

@media (max-width: 350px) {
    .login-container {
        padding: 1.5rem 1rem;
    }
    
    .login-header h2 {
        font-size: 1.25rem;
    }
    
    .welcome-icon {
        font-size: 2.5rem;
    }
}

/* Animaciones de entrada escalonadas */
.login-container.animate-in .login-header {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.login-container.animate-in .login-form {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.login-container.animate-in .login-footer {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto de hover en feature items con delay */
.feature-item:nth-child(1) { transition-delay: 0.1s; }
.feature-item:nth-child(2) { transition-delay: 0.2s; }
.feature-item:nth-child(3) { transition-delay: 0.3s; }