:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --error-color: #ef4444;
    --success-color: #10b981;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --bg-primary: rgba(30, 41, 59, 0.7);
    --bg-secondary: rgba(51, 65, 85, 0.5);
    --border-color: rgba(148, 163, 184, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: var(--bg-primary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: slideUp 0.5s ease-out;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

.logo svg circle,
.logo svg path {
    stroke: var(--primary-light);
    fill: var(--primary-light);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

h1 {
    font-size: 28px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
    backdrop-filter: blur(8px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-left: 4px solid var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-left: 4px solid var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.input-group {
    margin-bottom: 24px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: var(--bg-secondary);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
}

.input-group input::placeholder {
    color: #64748b;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(51, 65, 85, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-group input:invalid:not(:placeholder-shown) {
    border-color: var(--text-primary);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 16px;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
}

.input-icon svg path {
    fill: #94a3b8;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
    z-index: 5;
}

.toggle-password svg path {
    fill: #94a3b8;
    transition: fill 0.2s ease;
}

.toggle-password:hover svg path {
    fill: var(--primary-light);
}

.toggle-password:hover {
    transform: translateY(-50%) scale(1.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.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;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.footer {
    margin-top: 32px;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Animación de fondo */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 350px;
    height: 350px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
}

.circle-2 {
    width: 450px;
    height: 450px;
    bottom: -200px;
    right: -200px;
    animation-delay: 7s;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
}

.circle-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    left: 50%;
    animation-delay: 14s;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.05) 0%, transparent 70%);
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .container {
        max-width: 100%;
    }
}

/* Animación de shake para errores */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}