:root {
    --primary: #8b5cf6;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --dark-3: #334155;
    --light: #f1f5f9;
    --muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-alt: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

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

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.8), transparent);
}

.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.form-group { margin-bottom: 20px; position: relative; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--light);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-control::placeholder { color: var(--muted); }

.input-wrapper { position: relative; }

.input-wrapper .toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.input-wrapper .toggle-pass:hover { color: var(--light); }

.password-strength {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak { width: 33%; background: var(--danger); }
.strength-medium { width: 66%; background: var(--warning); }
.strength-strong { width: 100%; background: var(--success); }

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.5);
}

.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-google {
    background: #fff;
    color: #1f2937;
    margin-top: 12px;
}

.btn-google:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,255,255,0.1); }

.btn-loader {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn.loading .btn-text { opacity: 0; }
.btn.loading .btn-loader { display: block; position: absolute; }

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

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.divider span { padding: 0 16px; }

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover { color: var(--secondary); }

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    border-left: 3px solid;
}

.alert.show { display: block; animation: slideDown 0.3s; }

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

.alert-error { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border-color: var(--danger); }
.alert-success { background: rgba(16, 185, 129, 0.1); color: #6ee7b7; border-color: var(--success); }
.alert-info { background: rgba(6, 182, 212, 0.1); color: #67e8f9; border-color: var(--accent); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 480px) {
    .auth-card { padding: 32px 24px; }
    .form-row { grid-template-columns: 1fr; }
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 24px;
}

.sidebar .logo { text-align: left; margin-bottom: 40px; }
.sidebar .logo-icon { width: 44px; height: 44px; font-size: 20px; margin-bottom: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--light);
}

.nav-item.active { background: var(--gradient); color: #fff; }

.main-content { padding: 32px 40px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s;
}

.stat-card:hover { transform: translateY(-4px); border-color: rgba(139, 92, 246, 0.3); }

.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

@media (max-width: 768px) {
    .dashboard { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-content { padding: 20px; }
}

/* Profile Page Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--muted);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.tab:hover { color: var(--light); }

.tab.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--light);
}

.card-desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--muted);
    font-size: 14px;
}

.form-readonly {
    background: rgba(15, 23, 42, 0.3) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.info-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

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

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