:root {
    /* LIGHT THEME (Default) */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #f59e0b;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(148, 163, 184, 0.3);
    --input-bg: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glow: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(248, 250, 252, 0) 70%);
}

[data-theme="dark"] {
    /* DARK THEME */
    --bg-main: #020617;
    --bg-card: rgba(15, 23, 42, 0.7);
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --accent: #fbbf24;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(51, 65, 85, 0.5);
    --input-bg: rgba(15, 23, 42, 0.8);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --glow: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(2, 6, 23, 0) 70%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* Glow Background */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.glow-bg {
    position: absolute;
    width: 800px;
    height: 800px;
    background: var(--glow);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    transition: background 0.3s ease;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
}

.logo-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    color: white;
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.logo-circle:hover {
    transform: rotate(0deg) scale(1.05);
}

.brand h1 {
    font-weight: 800;
    font-size: 32px;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.brand h1 span {
    color: var(--primary);
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 36px;
    font-weight: 400;
}

.input-group {
    margin-bottom: 24px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.input-group input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 16px 16px 16px 48px;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.input-icon {
    position: absolute;
    bottom: 16px;
    left: 16px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.input-group input:focus + .input-icon {
    color: var(--primary);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 20px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.1);
    padding: 8px;
    border-radius: 8px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-footer {
    margin-top: 36px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.quick-login-container {
    margin-top: 28px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.quick-login-container p {
    font-size: 11px;
    margin-bottom: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.btn-secondary {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

.loader {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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