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

:root {
  --bg: #0a0f1e;
  --surface: #111827;
  --surface2: #1a2235;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --accent: #00e5a0;
  --accent-dim: rgba(0,229,160,0.12);
  --accent-hover: #00ffb3;
  --text: #f0f4ff;
  --text-muted: #8892a4;
  --text-faint: #4a5568;
  --danger: #ff5c5c;
  --danger-dim: rgba(255,92,92,0.12);
  --radius: 14px;
  --radius-sm: 8px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Animated background */
.bg-shapes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 12s ease-in-out infinite;
}
.s1 { width: 500px; height: 500px; background: #00e5a0; top: -150px; right: -150px; animation-delay: 0s; }
.s2 { width: 400px; height: 400px; background: #6366f1; bottom: -100px; left: -100px; animation-delay: 4s; }
.s3 { width: 300px; height: 300px; background: #ec4899; top: 40%; left: 40%; animation-delay: 8s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.auth-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  padding: 20px;
  animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Brand */
.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px; justify-content: center;
}
.logo-mark {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #0a0f1e;
}
.brand-name {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

/* Tabs */
.tabs {
  display: flex; position: relative;
  border-bottom: 1px solid var(--border);
  padding: 6px;
  gap: 4px;
}
.tab {
  flex: 1; padding: 9px;
  background: none; border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; border-radius: var(--radius-sm);
  position: relative; z-index: 1;
  transition: color 0.2s;
}
.tab.active { color: var(--text); }
.tab-slider {
  position: absolute;
  top: 6px; left: 6px;
  width: calc(50% - 5px); height: calc(100% - 12px);
  background: var(--surface2);
  border-radius: var(--radius-sm);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  border: 1px solid var(--border-hover);
}
.tab-slider.right { transform: translateX(calc(100% + 4px)); }

/* Form */
.auth-form { padding: 28px 24px 24px; }
.auth-form.hidden { display: none; }

.form-heading { margin-bottom: 24px; }
.form-heading h1 {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
}
.form-heading p { font-size: 13px; color: var(--text-muted); }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-muted); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.field input {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14px;
  color: var(--text); font-family: 'DM Sans', sans-serif;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 42px; }
.eye-btn {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); padding: 4px;
  display: flex; align-items: center;
  transition: color 0.2s;
}
.eye-btn:hover { color: var(--text-muted); }

/* Password strength */
.strength-bar {
  height: 3px; background: var(--surface2);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.strength-fill {
  height: 100%; width: 0;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}
.strength-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

.forgot-row { text-align: right; margin-bottom: 18px; margin-top: -6px; }
.forgot-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.forgot-link:hover { color: var(--accent-hover); }

/* Buttons */
.btn-primary {
  width: 100%; padding: 13px;
  background: var(--accent);
  border: none; border-radius: var(--radius-sm);
  font-family: 'Syne', sans-serif;
  font-size: 15px; font-weight: 600;
  color: #0a0f1e; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s, transform 0.1s;
  position: relative; overflow: hidden;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-loader {
  width: 16px; height: 16px;
  border: 2px solid rgba(10,15,30,0.3);
  border-top-color: #0a0f1e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-loader.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--text-faint); font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.btn-google {
  width: 100%; padding: 11px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.btn-google:hover { border-color: var(--border-hover); background: #1f2d45; }

/* Error */
.error-msg {
  margin-top: 14px; padding: 10px 12px;
  background: var(--danger-dim);
  border: 1px solid rgba(255,92,92,0.25);
  border-radius: var(--radius-sm);
  color: var(--danger); font-size: 13px;
  animation: fadeIn 0.2s ease;
}
.error-msg.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.footer-note {
  text-align: center; margin-top: 20px;
  font-size: 12px; color: var(--text-faint);
}
.footer-note a { color: var(--text-muted); }
.footer-note a:hover { color: var(--accent); }

.hidden { display: none !important; }

/* ─── Mobile responsive ──────────────────────────────────── */
@media (max-width: 480px) {
  body { align-items: flex-start; padding-top: 20px; overflow-y: auto; }
  .auth-container { padding: 16px; }
  .brand { margin-bottom: 20px; }
  .card { border-radius: 16px; }
  .auth-form { padding: 22px 18px 18px; }
  .form-heading h1 { font-size: 20px; }
  .btn-primary, .btn-google { padding: 14px; font-size: 15px; }
  .field input { padding: 13px 14px; font-size: 15px; }
}
