/* ====================================================
   DECOUPY DESIGN SYSTEM — CSS Custom Properties
   ==================================================== */
:root {
  /* Brand */
  --color-brand: #0057FF;
  --color-brand-dark: #003EC4;
  --color-brand-light: #E8EEFF;
  --color-brand-glow: rgba(0, 87, 255, 0.15);

  /* Surfaces (Light) */
  --color-surface: #FFFFFF;
  --color-surface-subtle: #F7F8FF;
  --color-surface-muted: #EEEFFE;
  --color-surface-raised: #FFFFFF;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-strong: rgba(0, 0, 0, 0.15);

  /* Text */
  --color-text: #0F1117;
  --color-text-muted: #5A5F72;
  --color-text-faint: #9096AA;
  --color-text-inverse: #FFFFFF;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #0057FF 0%, #2979FF 100%);
  --gradient-hero-glow: radial-gradient(ellipse 80% 60% at 50% -5%, rgba(0, 87, 255, 0.10), transparent 70%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-brand: 0 8px 32px rgba(0, 87, 255, 0.28);
  --shadow-brand-sm: 0 4px 16px rgba(0, 87, 255, 0.20);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;
}

html.dark {
  --color-brand: #5B9BFF;
  --color-brand-dark: #4080FF;
  --color-brand-light: rgba(91, 155, 255, 0.12);
  --color-brand-glow: rgba(91, 155, 255, 0.20);

  --color-surface: #0C0D14;
  --color-surface-subtle: #13151F;
  --color-surface-muted: #1A1D2B;
  --color-surface-raised: #1E2235;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);

  --color-text: #E8EAFF;
  --color-text-muted: #9096AA;
  --color-text-faint: #5A5F72;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.25);
  --shadow-brand: 0 8px 32px rgba(91, 155, 255, 0.22);
  --shadow-brand-sm: 0 4px 16px rgba(91, 155, 255, 0.16);
}

/* ====================================================
   ANIMATIONS
   ==================================================== */
.screen { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====================================================
   SCROLLBAR
   ==================================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f2f3ff; }
::-webkit-scrollbar-thumb { background: #c2c6d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #737687; }
::selection { background: #dbe1ff; color: #00174b; }
html.dark ::selection { background: #1b2a55; color: #dbe1ff; }
html.dark ::-webkit-scrollbar-track { background: #1a1d27; }
html.dark ::-webkit-scrollbar-thumb { background: #424656; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #737687; }

/* ====================================================
   SMOOTH TRANSITIONS
   ==================================================== */
html {
  transition: background-color .25s ease, color .25s ease;
}
button, a, input, nav, footer {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, opacity .15s ease, transform .15s ease;
}

/* ====================================================
   DARK MODE OVERRIDES
   ==================================================== */
html.dark body { background: #0f1117; color: #e7e7f4; }

html.dark .bg-surface,
html.dark .bg-background { background-color: #0f1117 !important; }
html.dark .bg-surface-container-lowest { background-color: #15171f !important; }
html.dark .bg-surface-container-low { background-color: #1a1d27 !important; }
html.dark .bg-surface-container { background-color: #1f2230 !important; }
html.dark .bg-surface-container-high { background-color: #272b3a !important; }
html.dark .bg-surface-container-highest { background-color: #2f3346 !important; }
html.dark .bg-secondary-container { background-color: #2a3447 !important; }
html.dark .bg-white { background-color: #1a1d27 !important; }
html.dark .text-on-surface,
html.dark .text-on-background { color: #e7e7f4 !important; }
html.dark .text-on-surface-variant,
html.dark .text-slate-600 { color: #a8acc0 !important; }
html.dark .text-slate-700 { color: #c2c6d9 !important; }
html.dark .text-primary { color: #8bb0ff !important; }
html.dark .text-tertiary { color: #ffb59d !important; }
html.dark .bg-secondary-fixed { background-color: #2a3447 !important; }
html.dark .text-on-secondary-fixed { color: #b8c5dc !important; }
html.dark .bg-primary\/10 { background-color: rgba(139, 176, 255, 0.12) !important; }
html.dark .bg-primary\/5 { background-color: rgba(139, 176, 255, 0.06) !important; }
html.dark .border-outline-variant\/20,
html.dark .border-outline-variant\/30 { border-color: rgba(168, 172, 192, 0.18) !important; }
html.dark .glass-header {
  background: rgba(15, 17, 23, 0.9) !important;
  border-bottom: 1px solid rgba(168, 172, 192, 0.1);
}
html.dark .soft-shadow { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important; }
html.dark .transparent-pattern {
  background-image:
    linear-gradient(45deg, #272b3a 25%, transparent 25%),
    linear-gradient(-45deg, #272b3a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #272b3a 75%),
    linear-gradient(-45deg, transparent 75%, #272b3a 75%) !important;
  background-color: #1a1d27 !important;
}
html.dark .dashed-outline {
  background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='8' ry='8' stroke='%238bb0ff' stroke-width='2' stroke-dasharray='8%2c 12' stroke-linecap='square'/%3e%3c/svg%3e") !important;
}

/* Dropdowns in dark */
html.dark #account-menu { background-color: #1f2230 !important; }

/* Auth modal in dark */
html.dark #auth-modal > div { background-color: #1a1d27 !important; }
html.dark #auth-modal input { background-color: #272b3a !important; color: #e7e7f4 !important; }
html.dark footer.bg-white { background-color: #0f1117 !important; }
html.dark .prose h2 { color: #e7e7f4 !important; }
html.dark .prose p,
html.dark .prose li { color: #a8acc0 !important; }
html.dark .text-on-secondary-container { color: #b8c5dc !important; }
html.dark .bg-on-surface { background-color: #e7e7f4 !important; }

/* ====================================================
   DROP ZONE FEEDBACK
   ==================================================== */
#drop-zone.is-dragging {
  background-color: rgba(0, 87, 255, 0.08) !important;
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(0, 87, 255, 0.20);
}
html.dark #drop-zone.is-dragging {
  background-color: rgba(139, 176, 255, 0.12) !important;
  box-shadow: 0 0 0 4px rgba(139, 176, 255, 0.30);
}

/* ====================================================
   MATERIAL SYMBOLS — FOIT MITIGATION
   ==================================================== */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  visibility: hidden;
}
.fonts-loaded .material-symbols-outlined { visibility: visible; }

/* ====================================================
   HERO GLOW
   ==================================================== */
.hero-glow-bg { position: relative; }
.hero-glow-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero-glow);
  pointer-events: none;
  z-index: 0;
}
.hero-glow-bg > * { position: relative; z-index: 1; }

/* ====================================================
   GLASS CARD
   ==================================================== */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
}
html.dark .glass-card {
  background: rgba(30, 34, 53, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ====================================================
   PRIMARY BUTTONS
   ==================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--gradient-brand);
  color: white;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-brand-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-brand); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--color-brand-light);
  color: var(--color-brand);
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--color-brand); }

/* ====================================================
   FAQ ACCORDION
   ==================================================== */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item:last-child { border-bottom: none; }

.faq-question {
  width: 100%;
  text-align: left;
  padding: 22px 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  gap: 16px;
}
html.dark .faq-question { color: #e7e7f4; }

.faq-icon {
  transition: transform 0.25s ease;
  flex-shrink: 0;
  color: var(--color-brand);
  font-size: 20px !important;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding-bottom 0.3s ease;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}
html.dark .faq-answer { color: #a8acc0; }
.faq-item.open .faq-answer {
  max-height: 200px;
  padding-bottom: 22px;
}

/* ====================================================
   PRICING CARD FEATURED (gradient border wrapper)
   ==================================================== */
.pricing-card-featured {
  background: var(--gradient-brand);
  border-radius: var(--radius-xl);
  padding: 2px;
  box-shadow: var(--shadow-brand);
}
html.dark .pricing-card-featured { box-shadow: var(--shadow-brand); }

/* ====================================================
   BILLING TOGGLE
   ==================================================== */
.billing-toggle-track {
  background: #e7e7f4;
  transition: background 0.2s ease;
}
.billing-toggle-track.active { background: rgba(0, 87, 255, 0.15); }
html.dark .billing-toggle-track { background: #272b3a; }
html.dark .billing-toggle-track.active { background: rgba(91, 155, 255, 0.2); }

.billing-toggle-thumb {
  width: 20px; height: 20px;
  background: var(--color-brand);
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.billing-toggle-track.active .billing-toggle-thumb {
  transform: translateX(24px);
}

/* ====================================================
   SOCIAL PROOF STATS
   ==================================================== */
.stat-card {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
html.dark .stat-card {
  background: #15171f;
  border-color: rgba(168, 172, 192, 0.12);
}

/* ====================================================
   ANIMATIONS: SPIN
   ==================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
