/* Login screen - fondo decorado, card centrada */

:root {
    --brand-primary-500: #6366F1;
    --brand-primary-600: #4F46E5;
    --brand-accent-500: #8B5CF6;
    --brand-accent-400: #A78BFA;
    --brand-surface-0:   #FFFFFF;
    --brand-surface-50:  #F9FAFB;
    --brand-surface-100: #F3F4F6;
    --brand-surface-edge:#E5E7EB;
    --brand-text-primary:   #111827;
    --brand-text-secondary: #4B5563;
    --brand-text-muted:     #9CA3AF;
    --brand-danger:  #EF4444;
    --grad-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #EEF2FF 0%, #F3E8FF 50%, #FDF4FF 100%);
    color: var(--brand-text-primary);
    overflow: hidden;
    position: relative;
}

/* Orbes de fondo */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}
.bg-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6366F1 0%, transparent 70%);
    top: -100px;
    left: -100px;
}
.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8B5CF6 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}
.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #A78BFA 0%, transparent 70%);
    top: 50%;
    right: 20%;
    animation-delay: -14s;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Card del login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
    animation: cardIn 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--grad-primary);
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}
.login-subtitle {
    color: var(--brand-text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Alertas */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: shake 400ms ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}
.alert-icon { font-size: 18px; line-height: 1; }
.alert ul { margin: 0; padding-left: 18px; }

/* Form */
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-text-secondary);
}
.form-input {
    width: 100%;
    height: 44px;
    padding: 12px 16px;
    border: 1.5px solid var(--brand-surface-edge);
    border-radius: 10px;
    background: var(--brand-surface-0);
    color: var(--brand-text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 150ms;
}
.form-input:focus {
    outline: none;
    border-color: var(--brand-primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.form-input::placeholder { color: var(--brand-text-muted); }

/* Botón */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms;
    margin-top: 8px;
    position: relative;
}
.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading .btn-text { opacity: 0.5; }
.btn.loading .btn-spinner { display: inline-block; }

/* Footer del card */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--brand-surface-100);
}
.login-footer p { margin: 0 0 6px; font-size: 13px; color: var(--brand-text-secondary); }
.login-footer a { color: var(--brand-primary-600); font-weight: 500; }
.login-version {
    color: var(--brand-text-muted);
    font-size: 11px;
    margin-top: 12px !important;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card { padding: 32px 24px; }
    .login-logo { width: 60px; height: 60px; }
    .login-header h1 { font-size: 24px; }
}
