/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --border: #e2e8f8;
  --indigo: #4f6ef7;
  --indigo-dark: #3a56e0;
  --indigo-light: #eef1ff;
  --emerald: #10b981;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(79,110,247,0.10), 0 1px 4px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 40px rgba(79,110,247,0.14), 0 4px 12px rgba(15,23,42,0.08);
}

* { font-family: 'Inter', 'DM Sans', sans-serif; }

body {
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* ===== LAYOUT ===== */
.gradient-bg {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
  background:
    radial-gradient(ellipse 800px 600px at 10% 0%, rgba(79,110,247,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 90% 100%, rgba(16,185,129,0.06) 0%, transparent 70%),
    #f0f4ff;
  position: relative;
}

.ambient { display: none; }

/* ===== AUTH CARD ===== */
.auth-shell {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: visible;
  animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

/* ===== HEADER ===== */
.brand-chip {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--indigo) 0%, #6c8cfa 100%);
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(79,110,247,0.28);
  margin-bottom: 16px;
}

.brand-chip i { color: #fff; font-size: 26px; }

.brand-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ===== PILLS ===== */
.mini-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--indigo-light);
  color: var(--indigo);
  border: 1px solid rgba(79,110,247,0.16);
}

/* ===== THEME TOGGLE (hidden) ===== */
.theme-toggle { display: none !important; }

/* ===== AUTH SWITCH ===== */
.switch-track {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  display: inline-flex;
}

.auth-switch {
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  background: transparent;
}

.auth-switch.bg-white {
  background: var(--surface) !important;
  color: var(--indigo) !important;
  box-shadow: var(--shadow-sm);
}

.switch-btn-inactive { color: var(--text-secondary); }

/* ===== AUTH PANEL ===== */
.auth-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ===== AUTH NOTE ===== */
.auth-note { color: var(--text-secondary); font-size: 0.875rem; }

/* ===== FIELD ===== */
.field-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  min-height: 44px;
}

.field-input::placeholder { color: var(--text-muted); }
.field-input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}

.field-icon { color: var(--text-muted); }

/* ===== HEADING ===== */
.heading-light { color: var(--text-primary); }
.panel-copy { color: var(--text-secondary); line-height: 1.6; }

/* ===== BUTTONS ===== */
.btn-animate {
  display: flex; align-items: center; justify-content: center;
  width: 100%; border: none; cursor: pointer;
  font-weight: 600; border-radius: var(--radius-sm);
  transition: all 0.2s ease; position: relative; overflow: hidden;
  min-height: 44px;
}

.btn-animate:active { transform: scale(0.98); }
.btn-animate:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.btn-animate::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
  transform: translateX(-130%);
  transition: transform 0.5s ease;
}
.btn-animate:hover::after { transform: translateX(130%); }

.btn-lux-login {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79,110,247,0.35);
}
.btn-lux-login:hover { box-shadow: 0 6px 20px rgba(79,110,247,0.45); transform: translateY(-1px); }

.btn-lux-register {
  background: linear-gradient(135deg, var(--emerald) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,0.30);
}
.btn-lux-register:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.40); transform: translateY(-1px); }

/* ===== REVEAL ===== */
.reveal-item {
  opacity: 0;
  animation: revealUp 0.5s ease forwards;
  animation-delay: var(--d, 0s);
}

/* ===== AUTH VIEW ===== */
.auth-view { transition: opacity 0.2s ease; }
.auth-view-hidden { display: none; }
.card-hover { transition: box-shadow 0.2s ease; }
.card-hover:hover { box-shadow: var(--shadow-md); }

/* ===== INPUT FOCUS ===== */
.input-focus { transition: all 0.2s ease; }
.input-focus:focus {
  outline: none;
  border-color: var(--indigo) !important;
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12) !important;
}

/* ===== TOAST ===== */
#toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; }

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .gradient-bg { padding: 16px 12px 32px; }
  .auth-shell { border-radius: var(--radius-lg); }
  .card-hover:hover { box-shadow: none; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
