:root {
  --primary: #1E3A8A;
  --primary-light: #3B82F6;
  --accent: #FBBF24;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --danger: #EF4444;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--primary); font-size: 1.25rem; }
.logo img { height: 36px; width: auto; }

.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { color: var(--text); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--primary-light); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-light); text-decoration: none; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

.btn-accent {
  background: var(--accent);
  color: var(--text);
}
.btn-accent:hover { filter: brightness(1.05); }

/* Hero */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.025em;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Features */
.features { padding: 4rem 0; }
.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-icon {
  width: 48px; height: 48px;
  background: #EFF6FF;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  color: var(--primary-light);
  font-size: 1.5rem;
}

.feature-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; color: var(--primary); }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* How it works */
.steps { padding: 4rem 0; background: var(--surface); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  counter-reset: step;
}
.step {
  text-align: center;
  position: relative;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  margin: 0 auto 1rem;
}

/* Footer */
.footer {
  background: var(--primary);
  color: #E0E7FF;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer h4 { color: white; margin-bottom: 1rem; font-size: 1rem; }
.footer a { color: #BFDBFE; display: block; margin-bottom: 0.5rem; font-size: 0.9rem; }
.footer a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #93C5FD;
}

/* Auth forms */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
}
.auth-card h1 { font-size: 1.5rem; color: var(--primary); margin-bottom: 0.5rem; text-align: center; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.otp-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.otp-inputs input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 8px;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }

/* Dashboard */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--primary);
  color: white;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .logo { color: white; margin-bottom: 2rem; padding: 0 0.5rem; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #BFDBFE;
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(255,255,255,0.12);
  color: white;
  text-decoration: none;
}
.main-content { padding: 2rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; color: var(--primary); }
.page-header p { color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 0.85rem; color: var(--text-muted); }
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* Legal pages */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.legal-content h1 { font-size: 2rem; color: var(--primary); margin-bottom: 0.5rem; }
.legal-content .meta { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9rem; }
.legal-content h2 { font-size: 1.35rem; color: var(--primary); margin: 2rem 0 0.75rem; }
.legal-content h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.legal-content p, .legal-content li { margin-bottom: 0.75rem; color: var(--text); }
.legal-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -100%; transition: left 0.3s; z-index: 200; width: 260px; }
  .sidebar.open { left: 0; }
  .nav { display: none; }
  .hero { padding: 3rem 0; }
}

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
