:root {
  --bg: #0e1117;
  --surface: rgba(22, 26, 36, 0.8);
  --surface-strong: rgba(32, 36, 48, 0.85);
  --text: #e9ecf5;
  --muted: #98a3b8;
  --primary: #6ad1ff;
  --primary-strong: #3fa3ff;
  --danger: #ff7b7b;
  --warning: #f3c969;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --blur: 18px;
  --radius: 18px;
  --transition: all 180ms ease;
}

[data-theme="light"] {
  --bg: #eef2f7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --text: #1b2435;
  --muted: #4b5567;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --danger: #e11d48;
  --warning: #ca8a04;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a { color: var(--primary); }

.gradient-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(106, 209, 255, 0.25), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(63, 163, 255, 0.18), transparent 25%),
              radial-gradient(circle at 50% 90%, rgba(111, 255, 203, 0.2), transparent 30%),
              linear-gradient(135deg, rgba(26, 31, 45, 0.85), rgba(10, 12, 18, 0.95));
  filter: blur(0px) saturate(1.1);
  z-index: 0;
}

.top-brand {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  backdrop-filter: blur(var(--blur));
  background: linear-gradient(120deg, rgba(14,17,23,0.8), rgba(26,31,45,0.7));
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 2;
}

.logo {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.brand-text { font-weight: 700; letter-spacing: 0.02em; }

.theme-toggle {
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.auth-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 72px;
}

.card {
  width: min(960px, 100%);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
  padding: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  margin: 0 0 8px 0;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 32px);
}

.subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
  max-width: 560px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #6fffcb 0%, #2dd4bf 60%, rgba(45, 212, 191, 0.1) 100%);
  box-shadow: 0 0 0 8px rgba(45, 212, 191, 0.15), 0 0 18px rgba(111, 255, 203, 0.5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.9; }
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 8px 0 14px;
  font-weight: 600;
}

.alert-error { background: rgba(255, 123, 123, 0.12); color: #ffc6c6; border: 1px solid rgba(255,123,123,0.4); }
.alert-warning { background: rgba(243, 201, 105, 0.16); color: #fce7b2; border: 1px solid rgba(243,201,105,0.5); }

.auth-form { display: grid; gap: 16px; margin-top: 12px; }
.form-group { display: grid; gap: 8px; }

label { font-weight: 600; color: var(--text); }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-strong);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition);
}

.input-wrapper:hover { border-color: rgba(255,255,255,0.12); }

.input-wrapper input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 14px 14px;
  font-size: 16px;
  outline: none;
}

.input-wrapper:focus-within { box-shadow: 0 8px 24px rgba(0,0,0,0.35); transform: translateY(-1px); }

.password-wrapper { gap: 6px; }
.toggle-password {
  margin-right: 8px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-password:hover { background: rgba(255,255,255,0.12); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  transition: var(--transition);
}

.btn.primary {
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  color: #0b1220;
  box-shadow: 0 10px 30px rgba(58, 140, 255, 0.35);
}

.btn.primary:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 12px 34px rgba(58, 140, 255, 0.5); }

.form-actions { display: grid; gap: 8px; }
.hint { margin: 0; color: var(--muted); }

.footer-note {
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 768px) {
  .card { padding: 24px; }
  .card-header { flex-direction: column; align-items: flex-start; }
  .top-brand { padding: 14px 16px; }
  .logo { height: 40px; }
}
