/* ============================================
   LOGIN PAGE — Premium Dark Glassmorphism
   ============================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --glass-bg: rgba(17, 24, 39, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --accent-primary: #818cf8;
    --accent-secondary: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --input-bg: rgba(30, 41, 59, 0.6);
    --input-border: rgba(100, 116, 139, 0.3);
    --input-focus-border: #818cf8;
    --error-color: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --success-color: #4ade80;
    --blob-1: #6366f1;
    --blob-2: #8b5cf6;
    --blob-3: #06b6d4;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Animated Gradient Blobs ---- */
.bg-blobs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.5;
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: float 18s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--blob-1);
    top: -15%;
    left: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--blob-2);
    bottom: -10%;
    right: -5%;
    animation-delay: -6s;
    animation-duration: 22s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: var(--blob-3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -12s;
    animation-duration: 20s;
}

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

/* ---- Login Container ---- */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255,255,255,0.03) inset;
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--blob-2));
    margin-bottom: 16px;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.login-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ---- Error Message ---- */
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: var(--error-color);
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.error-message svg {
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Form ---- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---- Input Group ---- */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    z-index: 2;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition);
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-group label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all var(--transition);
    display: none;
}

.input-group input:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    background: rgba(30, 41, 59, 0.8);
}

.input-group input:focus ~ .input-icon,
.input-group:focus-within .input-icon {
    color: var(--accent-primary);
}

/* ---- Password Toggle ---- */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* ---- Submit Button ---- */
.login-btn {
    position: relative;
    width: 100%;
    padding: 14px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--blob-2));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.login-btn:hover::before {
    opacity: 1;
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---- Footer ---- */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .login-container {
        margin: 16px;
        padding: 32px 24px 24px;
        max-width: none;
    }

    .login-header h1 {
        font-size: 1.2rem;
    }

    .blob-1 { width: 300px; height: 300px; }
    .blob-2 { width: 250px; height: 250px; }
    .blob-3 { width: 200px; height: 200px; }
}

@media (max-width: 360px) {
    .login-container {
        padding: 24px 18px 20px;
    }
}
