:root {
    --bg-dark: #09090b;
    --panel-bg: rgba(24, 24, 27, 0.4);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #5865F2;
    --primary-hover: #4752C4;
    --primary-glow: rgba(88, 101, 242, 0.5);
    --accent-cyan: #22d3ee;
    --accent-emerald: #10b981;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(-45deg, #09090b, #111115, #171822, #0b0f19);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Stunning Ambient Background */
.ambient-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    /* Eliminamos el fondo estático para dejar ver el body animado */
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 15s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(88,101,242,0.4) 0%, transparent 70%);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(34,211,238,0.2) 0%, transparent 70%);
    animation-delay: -5s;
    animation-duration: 25s;
}

.orb-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 70%);
    animation-delay: -10s;
    animation-duration: 30s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* Main Container & Glass Panel */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    perspective: 1000px;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.1);
    animation: panelEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
}

@keyframes panelEnter {
    0% { opacity: 0; transform: translateY(40px) rotateX(10deg); }
    100% { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* Header */
.panel-header {
    text-align: center;
    margin-bottom: 32px;
}

.shield-glow {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(88,101,242,0.2), rgba(34,211,238,0.1));
    border: 1px solid rgba(88,101,242,0.4);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    position: relative;
}

.shield-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
    animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.05); }
}

.shield-icon {
    width: 32px;
    height: 32px;
}

.title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
}

/* Body & User Profile */
.auth-body {
    margin-bottom: 32px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
}

.avatar-ring {
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
}

.avatar-placeholder {
    width: 48px;
    height: 48px;
    background: #1e1f24;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
}

.avatar-placeholder svg {
    width: 24px;
    height: 24px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.user-details .user-id {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    font-family: monospace;
}

/* Action Area */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary::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-primary:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 30px var(--primary-glow);
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: #272a38;
    color: #646a82;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status Message */
.status-message {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.status-message.show {
    opacity: 1;
    transform: translateY(0);
}

.status-message.success { color: var(--accent-emerald); }
.status-message.error { color: var(--danger); }

/* Footer */
.panel-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.security-badge svg {
    width: 16px;
    height: 16px;
    color: var(--accent-emerald);
}

.security-badge strong {
    color: #fff;
    font-weight: 600;
}

.disclaimer {
    font-size: 11px;
    color: #646a82;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
