@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --purple: #8b5cf6;
  --bg-dark: #0f0f23;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-bg-light: rgba(255, 255, 255, 0.95);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── GLASS ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
}

.glass-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
}
.glass-input::placeholder { color: rgba(255,255,255,0.4); }
.glass-input:focus {
  border-color: rgba(99, 102, 241, 0.7);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ── DARK GRADIENT BG ── */
.bg-dark-gradient {
  background: linear-gradient(135deg, #0f0f23 0%, #1a1040 40%, #0f1a40 100%);
  min-height: 100vh;
}

/* ── GLOW ORBS ── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
}
.orb-1 { width: 500px; height: 500px; background: #6366f1; top: -150px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; left: -100px; }
.orb-3 { width: 300px; height: 300px; background: #3b82f6; top: 40%; left: 40%; }

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
  display: inline-block;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.5);
}

.btn-glass {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-glass:hover { background: rgba(255,255,255,0.18); }

/* ── APP NAV (white pages) ── */
.app-nav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
@media (min-width: 640px) {
  .app-nav { padding: 0 32px; }
}

/* ── LOGO ── */
.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  text-decoration: none;
}

/* ── BADGES ── */
.badge-free {
  font-size: 11px;
  background: #f1f5f9;
  color: #64748b;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.badge-pro {
  font-size: 11px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}

/* ── ALERTS (inline, auth pages) ── */
.alert-success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 1px solid #6ee7b7;
  color: #065f46;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}
.alert-error {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}

/* ── TOAST (fixed top-right) ── */
.app-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.app-toast-success {
  background: #fff;
  border: 1px solid #bbf7d0;
  color: #065f46;
}
.app-toast-success::before { content: '✓'; font-weight: 900; color: #10b981; font-size: 16px; }
.app-toast-error {
  background: #fff;
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.app-toast-error::before { content: '✕'; font-weight: 900; color: #ef4444; font-size: 16px; }
html.dark .app-toast-success { background: #1e293b; border-color: #065f46; color: #86efac; }
html.dark .app-toast-error   { background: #1e293b; border-color: #7f1d1d; color: #fca5a5; }
.app-toast.hiding { opacity: 0; transform: translateX(20px); }

/* ── APP CARD ── */
.app-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.app-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 20px rgba(99,102,241,0.08);
}

/* ── APP INPUT ── */
.app-input {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 100%;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.app-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.app-input::placeholder { color: #94a3b8; }

/* ── GRADIENT TEXT ── */
.gradient-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }

/* ── DARK MODE ── */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: inline-flex; }
html.dark .theme-icon-sun { display: inline-flex; }
html.dark .theme-icon-moon { display: none; }

html.dark body,
html.dark .bg-slate-50 { background-color: #0f172a !important; }
html.dark .bg-white    { background-color: #1e293b !important; }
html.dark .bg-slate-100 { background-color: #1e293b !important; }
html.dark .bg-indigo-50 { background-color: #1e1b4b !important; }
html.dark .bg-amber-50  { background-color: #1c1407 !important; }
html.dark .bg-red-50    { background-color: #1c0a0a !important; }
html.dark .bg-orange-50 { background-color: #1c1207 !important; }
html.dark .bg-emerald-50 { background-color: #052e16 !important; }

html.dark .app-nav {
  background: rgba(15,23,42,0.97);
  border-bottom-color: #1e293b;
}
html.dark .app-card { background: #1e293b; border-color: #334155; }
html.dark .app-card:hover { border-color: #818cf8; box-shadow: 0 4px 20px rgba(99,102,241,0.12); }

html.dark .app-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .app-input::placeholder { color: #475569; }
html.dark .app-input:focus { border-color: #6366f1; background: #1e293b; }

html.dark .badge-free { background: #1e293b; color: #94a3b8; }
html.dark .badge-pro  { background: #064e3b; color: #6ee7b7; }
html.dark .alert-success { background: #052e16; border-color: #065f46; color: #86efac; }
html.dark .alert-error   { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }

html.dark .text-slate-900 { color: #f1f5f9; }
html.dark .text-slate-800 { color: #e2e8f0; }
html.dark .text-slate-700 { color: #cbd5e1; }
html.dark .text-slate-600 { color: #94a3b8; }
html.dark .text-slate-500 { color: #64748b; }
html.dark .text-slate-400 { color: #475569; }
html.dark .text-slate-300 { color: #334155; }
html.dark .text-indigo-600 { color: #818cf8; }
html.dark .text-indigo-500 { color: #a5b4fc; }
html.dark .text-emerald-700 { color: #34d399; }

html.dark .border-slate-200 { border-color: #334155; }
html.dark .border-slate-100 { border-color: #1e293b; }
html.dark .border-slate-50  { border-color: #1e293b; }
html.dark .border-b { border-bottom-color: #1e293b; }

html.dark .hover\:bg-slate-50:hover  { background-color: #1e293b !important; }
html.dark .hover\:bg-slate-200:hover { background-color: #334155 !important; }
html.dark .hover\:bg-slate-100:hover { background-color: #1e293b !important; }
html.dark .hover\:bg-indigo-100:hover { background-color: #1e1b4b !important; }
html.dark .hover\:bg-amber-100:hover  { background-color: #292210 !important; }
html.dark .hover\:bg-red-100:hover    { background-color: #2a0a0a !important; }
html.dark .hover\:bg-orange-100:hover { background-color: #1c1207 !important; }
html.dark .hover\:bg-emerald-100:hover { background-color: #052e16 !important; }
html.dark .hover\:bg-slate-50\/50:hover { background-color: rgba(30,41,59,0.5) !important; }

html.dark ::-webkit-scrollbar-thumb { background: #475569; }

html.dark input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.dark textarea,
html.dark select {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #475569 !important; }

/* Countdown banner dark mode — slate-based, consistent with other cards */
html.dark .launch-cd-wrap {
  background-color: #1e293b !important;
  border-color: #4338ca !important;
}
html.dark .launch-cd-box {
  background-color: #0f172a !important;
  border-color: #4338ca !important;
}
html.dark .launch-notified-wrap {
  background-color: #1e293b !important;
  border-color: #166534 !important;
}
html.dark .launch-notified-wrap .bg-green-100 {
  background-color: #14532d !important;
}

/* Generic dark overrides still needed for other uses */
html.dark .bg-indigo-50  { background-color: #1e1b4b !important; }
html.dark .bg-green-50   { background-color: #052e16 !important; }
html.dark .border-indigo-200 { border-color: #3730a3 !important; }
html.dark .border-green-200  { border-color: #166534 !important; }
html.dark .border-indigo-100 { border-color: #312e81 !important; }
html.dark .bg-indigo-100 { background-color: #312e81 !important; }
html.dark .bg-green-100  { background-color: #14532d !important; }
html.dark .text-indigo-400 { color: #818cf8 !important; }
html.dark .text-green-600  { color: #4ade80 !important; }
html.dark .text-indigo-300 { color: #a5b4fc !important; }
html.dark .border-t { border-top-color: #1e293b !important; }

/* ── HAMBURGER NAV ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #94a3b8;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hamburger:hover { color: #64748b; }
html.dark .hamburger { color: #64748b; }
html.dark .hamburger:hover { color: #94a3b8; }

@media (max-width: 639px) {
  .hamburger { display: flex; }
  #main-nav { height: auto !important; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  #main-nav .nav-items {
    display: none;
    order: 10;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
  }
  #main-nav.nav-open .nav-items { display: flex; }
  html.dark #main-nav .nav-items { border-top-color: #1e293b; }
}
