:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
  --panel-bg: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --input-bg: rgba(15, 23, 42, 0.6);
  --input-border: rgba(255, 255, 255, 0.15);
  --error: #ef4444;
  --success: #10b981;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 50%, #f1f5f9 100%);
  --panel-bg: rgba(255, 255, 255, 0.75);
  --panel-border: rgba(255, 255, 255, 0.6);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --input-bg: rgba(255, 255, 255, 0.8);
  --input-border: rgba(203, 213, 225, 0.8);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 1.5rem;
}

/* Floating Background Shapes */
.shape {
  position: absolute;
  filter: blur(90px);
  border-radius: 50%;
  z-index: 0;
  animation: float 10s infinite alternate ease-in-out;
}
.shape-1 { width: 300px; height: 300px; background: #6366f1; top: -50px; left: -50px; opacity: 0.4; }
.shape-2 { width: 350px; height: 350px; background: #ec4899; bottom: -50px; right: -50px; opacity: 0.3; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.1); }
}

/* Theme Toggle Button */
.theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 30px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}

/* Main Container Glassmorphism */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* OAuth Buttons */
.oauth-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.2s, background 0.2s;
}

.btn-oauth:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--input-border);
}
.divider span { padding: 0 0.75rem; }

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
}

.input-wrapper i.icon-left {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.form-actions a {
  color: var(--primary);
  text-decoration: none;
}
.form-actions a:hover { text-decoration: underline; }

/* Main Button */
.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Notification Banner */
.notification {
  padding: 0.85rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.notification.error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--error); color: #fca5a5; }
.notification.success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--success); color: #6ee7b7; }

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* Dashboard CSS */
.dashboard-card {
  max-width: 600px;
  text-align: center;
}
.avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  margin: 0 auto 1.5rem;
}
.user-details {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: left;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--panel-border);
}
.detail-row:last-child { border-bottom: none; }