@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: #020617;
    color: #e0e7ff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== BACKGROUND LAYERS ===== */
.bg-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #020617 0%, #0a0f1f 50%, #1a1033 100%);
    z-index: -5;
}

/* Aurora blobs */
.aurora-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -4; pointer-events: none; overflow: hidden;
}

.aurora-blob {
    position: absolute; border-radius: 50%; filter: blur(140px); opacity: 0.45;
    animation: auroraFloat 28s infinite ease-in-out;
}

.blob-1 {
    width: 900px; height: 900px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5) 0%, rgba(99, 102, 241, 0.25) 50%, transparent 70%);
    top: -25%; right: -15%; animation-delay: 0s;
}

.blob-2 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.45) 0%, rgba(236, 72, 153, 0.15) 50%, transparent 70%);
    bottom: -25%; left: -15%; animation-delay: -9s;
}

.blob-3 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(239, 68, 68, 0.1) 50%, transparent 70%);
    top: 40%; left: 25%; animation-delay: -18s;
}

@keyframes auroraFloat {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(70px, -50px) scale(1.18) rotate(120deg); }
    66% { transform: translate(-50px, 60px) scale(0.88) rotate(240deg); }
}

/* City lights */
.city-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -3; pointer-events: none; overflow: hidden;
}

.city-bg::before {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 35%;
    background: 
        linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.7) 40%, transparent 100%),
        repeating-linear-gradient(90deg, transparent 0px, rgba(59, 130, 246, 0.15) 1px, transparent 3px, transparent 40px);
    opacity: 0.6;
}

.city-bg::after {
    content: ''; position: absolute; bottom: 15%; left: 0; width: 100%; height: 200px;
    background: 
        radial-gradient(circle at 15% 50%, rgba(245, 158, 11, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 45% 60%, rgba(239, 68, 68, 0.2) 0%, transparent 35%),
        radial-gradient(circle at 75% 45%, rgba(59, 130, 246, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 90% 70%, rgba(236, 72, 153, 0.2) 0%, transparent 35%);
    filter: blur(30px);
    animation: cityPulse 12s ease-in-out infinite;
}

@keyframes cityPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Fog */
.fog-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 30% 70%, rgba(15, 23, 42, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(30, 27, 75, 0.4) 0%, transparent 50%);
    z-index: -2; pointer-events: none;
    animation: fogDrift 20s ease-in-out infinite alternate;
}

@keyframes fogDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-30px); }
}

/* Rain */
.rain-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: -1; overflow: hidden;
}

.rain-drop {
    position: absolute; width: 1px; height: 50px;
    background: linear-gradient(to bottom, transparent, rgba(147, 197, 253, 0.4));
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    0% { transform: translateY(-100vh); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.7; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* ===== LOADER ===== */
.loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #020617; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 2rem;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-spinner { position: relative; width: 80px; height: 80px; }

.loader-ring {
    position: absolute; width: 100%; height: 100%;
    border: 3px solid transparent; border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-ring:nth-child(1) { border-top-color: #3b82f6; animation-delay: 0s; }
.loader-ring:nth-child(2) {
    width: 60px; height: 60px; top: 10px; left: 10px;
    border-right-color: #6366f1; animation-delay: -0.5s;
}
.loader-ring:nth-child(3) {
    width: 40px; height: 40px; top: 20px; left: 20px;
    border-bottom-color: #8b5cf6; animation-delay: -1s;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem; color: #93c5fd;
    letter-spacing: 3px; text-transform: uppercase;
    animation: loaderPulse 2s ease-in-out infinite;
}

@keyframes loaderPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ===== MAIN CONTAINER ===== */
.main-container {
    position: relative; z-index: 10; min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 4vh 2rem;
}

.project-logo {
    display: flex; align-items: center; justify-content: center;
    gap: 1rem; margin-bottom: 1.5rem;
}

.logo-placeholder {
    width: 72px; height: 72px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(147, 197, 253, 0.35);
    border-radius: 18px;
    flex-shrink: 0;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3), inset 0 0 20px rgba(147, 197, 253, 0.1);
}

.logo-placeholder svg {
    width: 36px; height: 36px;
    fill: #93c5fd;
    filter: drop-shadow(0 0 10px rgba(147, 197, 253, 0.6));
}

.main-title {
    font-size: 2.75rem; font-weight: 800;
    text-align: center; letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #93c5fd 40%, #60a5fa 70%, #c4b5fd 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(147, 197, 253, 0.4);
    text-transform: uppercase;
}

/* ===== AUTH CARD ===== */
.auth-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.75) 0%, rgba(30, 27, 75, 0.65) 100%);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(147, 197, 253, 0.2);
    border-radius: 24px;
    padding: 3rem; width: 100%; max-width: 460px;
    position: relative; overflow: hidden;
    box-shadow: 
        0 30px 60px -15px rgba(2, 6, 23, 0.8),
        0 0 0 1px rgba(147, 197, 253, 0.05),
        inset 0 1px 0 rgba(147, 197, 253, 0.15);
    animation: cardAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.6), transparent);
}

.auth-header {
    text-align: center; margin-bottom: 2.25rem;
    position: relative; z-index: 1;
}

.auth-header h2 {
    font-size: 1.35rem; font-weight: 700;
    color: #f0f9ff; letter-spacing: 0.05em;
    margin-bottom: 0.6rem; text-transform: uppercase;
}

.auth-subtitle {
    font-size: 0.95rem; color: #94a3b8;
    font-weight: 400;
}

/* ===== DISCORD BUTTON ===== */
.discord-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 0.85rem; width: 100%; padding: 1.1rem 1.75rem;
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    border: 1px solid rgba(88, 101, 242, 0.6);
    border-radius: 14px;
    color: #ffffff; font-size: 1.05rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
    margin-bottom: 1.75rem;
    position: relative; overflow: hidden; z-index: 1;
}

.discord-btn::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.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.discord-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(88, 101, 242, 0.6), 0 0 0 1px rgba(88, 101, 242, 0.9);
}

.discord-btn:hover::before { left: 100%; }
.discord-btn:active { transform: translateY(-1px); }
.discord-btn svg { width: 24px; height: 24px; flex-shrink: 0; }

/* Ripple effect */
.ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0); animation: ripple 0.7s linear;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ===== INFO BLOCK ===== */
.info-block {
    display: flex; align-items: flex-start;
    gap: 1.1rem; padding: 1.25rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 27, 75, 0.4) 100%);
    border: 1px solid rgba(147, 197, 253, 0.18);
    border-radius: 14px;
    position: relative; z-index: 1;
}

.info-icon-wrapper {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(147, 197, 253, 0.3);
    border-radius: 11px; flex-shrink: 0;
}

.info-icon-wrapper svg { width: 20px; height: 20px; fill: #60a5fa; }

.info-text { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }

.info-line {
    font-size: 0.9rem; font-weight: 500;
    color: #cbd5e1; line-height: 1.55;
}

/* ===== ERROR TOAST ===== */
.error-toast {
    position: fixed; top: 2rem; right: 2rem;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.2) 0%, rgba(225, 29, 72, 0.15) 100%);
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(244, 63, 94, 0.4);
    border-radius: 16px; padding: 1.25rem 1.5rem;
    color: #f43f5e; z-index: 200; max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px -10px rgba(2, 6, 23, 0.9), 0 0 40px rgba(244, 63, 94, 0.25);
}

.error-toast.show { transform: translateX(0); }

.error-title {
    font-weight: 600; font-size: 0.95rem;
    margin-bottom: 0.4rem;
    display: flex; align-items: center; gap: 0.5rem;
}

.error-msg {
    font-size: 0.875rem; color: #fda4af;
    line-height: 1.55;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .main-title { font-size: 1.85rem; }
    .auth-card { padding: 2rem 1.5rem; }
    .error-toast { left: 1rem; right: 1rem; max-width: none; top: 1rem; }
    .main-container { padding: 4vh 1.25rem 1.5rem; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}