:root {
  --navy: #0B1426;
  --navy-mid: #152038;
  --navy-light: #1E2F4D;
  --gold: #C9963A;
  --gold-light: #E8B84B;
  --cream: #FAF7F2;
  --white: #FFFFFF;
  --text-dark: #0B1426;
  --text-muted: #5A6478;
  --border: #E2DDD4;
  --error: #e74c3c;
  --success: #22c55e;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 40px 0;
}

/* Background decoration */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(201,150,58,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,150,58,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,150,58,0.06) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}

/* Back to home */
.back-btn {
  position: fixed; top: 24px; left: 24px;
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.5);
  text-decoration: none; font-size: 13px;
  transition: color 0.2s;
  z-index: 10;
}
.back-btn:hover { color: var(--gold); }

/* Main card */
.auth-card {
  background: var(--white);
  border-radius: 24px;
  width: 100%; max-width: 460px;
  padding: 40px;
  margin: 20px 16px;
  position: relative; z-index: 1;
  animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Logo */
.auth-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}

.logo-box {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700; font-size: 17px;
  color: var(--navy);
}

.logo-text span:first-child {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 600;
  color: var(--text-dark);
}

.logo-text span:last-child {
  font-size: 11px; color: var(--gold);
  letter-spacing: 1.5px; text-transform: uppercase;
}

/* Tabs */
.auth-tabs {
  display: flex; gap: 4px;
  background: var(--cream);
  padding: 4px; border-radius: 10px;
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1; padding: 10px;
  border: none; border-radius: 7px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  background: transparent; color: var(--text-muted);
}

.tab-btn.active {
  background: var(--white);
  color: var(--navy); font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form */
.form-section { display: none; }
.form-section.active { display: block; }

.form-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 700;
  color: var(--text-dark); margin-bottom: 6px;
}

.form-sub {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 24px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block; font-size: 13px;
  font-weight: 500; color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark); background: var(--cream);
  outline: none; transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(201,150,58,0.1);
}

.form-group input.error   { border-color: var(--error); }
.form-group input.success { border-color: var(--success); }

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

/* Password toggle */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }

.toggle-pass {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 16px;
  color: var(--text-muted); padding: 0;
}

/* Submit button */
.submit-btn {
  width: 100%; padding: 14px;
  background: var(--gold); color: var(--navy);
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.25s;
  font-family: 'DM Sans', sans-serif;
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.submit-btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,150,58,0.3);
}

.submit-btn:disabled {
  opacity: 0.6; cursor: not-allowed;
  transform: none; box-shadow: none;
}

/* Loading spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(11,20,38,0.2);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

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

/* Alert box */
.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 13px; margin-bottom: 16px;
  display: none; align-items: center; gap: 8px;
}

.alert.error {
  background: #fef2f2; color: #991b1b;
  border: 1px solid #fecaca; display: flex;
}

.alert.success {
  background: #f0fdf4; color: #166534;
  border: 1px solid #bbf7d0; display: flex;
}

/* Divider */
.or-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted); font-size: 12px;
}

.or-divider::before,
.or-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* Google button */
.google-btn {
  width: 100%; padding: 12px;
  background: var(--white); color: var(--text-dark);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.google-btn:hover { border-color: var(--gold); background: var(--cream); }

/* Terms */
.terms {
  font-size: 12px; color: var(--text-muted);
  text-align: center; margin-top: 16px;
  line-height: 1.6;
}

.terms a { color: var(--gold); text-decoration: none; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--navy); color: white;
  padding: 14px 20px; border-radius: 10px;
  font-size: 14px; border-left: 3px solid var(--gold);
  transform: translateX(200px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
}

.toast.show { transform: translateX(0); opacity: 1; }

/* Responsive */
@media (max-width: 500px) {
  body {
    padding: 20px 0;
    align-items: flex-start;
  }

  .auth-card {
    margin: 16px;
    padding: 28px 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}