/* ═════════════════════════════════════════════════════════════════════════════
   SYLVA — Design System
   ═════════════════════════════════════════════════════════════════════════════ */

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

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --purple-50:  #f3f0ff;
  --purple-100: #e6dfff;
  --purple-300: #a994ff;
  --purple-400: #8b6fff;
  --purple-500: #6c47ff;
  --purple-600: #5a37e6;
  --purple-700: #4626bf;
  --purple-glow: rgba(108, 71, 255, 0.4);

  /* Neutrals */
  --bg:        #08080f;
  --bg-elev:   #0c0c16;
  --card:      #11111d;
  --card-hover:#15152a;
  --border:    #1d1d2e;
  --border-strong: #2a2a40;

  /* Text */
  --text:      #ededf5;
  --text-soft: #b8b8d0;
  --muted:     #75759a;
  --dim:       #4a4a66;

  /* Status */
  --green:  #4ade80;
  --green-bg: rgba(74, 222, 128, 0.1);
  --red:    #f87171;
  --red-bg: rgba(248, 113, 113, 0.1);
  --orange: #fbbf24;
  --orange-bg: rgba(251, 191, 36, 0.1);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.6);
  --shadow-purple: 0 8px 32px var(--purple-glow);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  letter-spacing: -0.011em;
}
a { color: var(--purple-500); text-decoration: none; transition: color .15s; }
a:hover { color: var(--purple-400); }
p { line-height: 1.7; }
::selection { background: var(--purple-500); color: #fff; }

/* ── Site Header (public) ─────────────────────────────────────────────────── */
.site-header {
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  background: rgba(8, 8, 15, 0.72);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  transition: border-color .2s, background .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header nav { display: flex; gap: 28px; align-items: center; }
.site-header nav a { color: var(--text-soft); font-size: 14px; font-weight: 500; }
.site-header nav a:hover { color: var(--text); }
.site-header .header-actions { display: flex; gap: 8px; align-items: center; }

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(108, 71, 255, .3);
}
.logo-mark:hover { color: #fff; box-shadow: 0 0 28px rgba(108, 71, 255, .5); }

.logo-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-wordmark .mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 14px rgba(108, 71, 255, 0.4);
}
.logo-wordmark .name {
  color: var(--text);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 56px 32px 32px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand-block { max-width: 320px; }
.footer-brand-block p { color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.7; }
.footer-col h4 { font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-col a { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--dim);
  font-size: 13px;
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all .18s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-primary {
  background: var(--purple-500);
  color: #fff;
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.1) inset, 0 4px 12px var(--purple-glow);
}
.btn-primary:hover {
  background: var(--purple-400);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.15) inset, 0 8px 24px var(--purple-glow);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--purple-500);
}
.btn-white { background: #fff; color: #000; }
.btn-white:hover { background: #f0f0f0; color: #000; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card-hover { cursor: pointer; }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-accent {
  background: linear-gradient(180deg, rgba(108,71,255,0.08), transparent 60%), var(--card);
  border-color: rgba(108,71,255,0.25);
}
.card-sm { padding: 20px; border-radius: var(--radius); }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-muted  { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-purple { background: rgba(108,71,255,0.15); color: var(--purple-300); }

/* Pulse dot */
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dot-pulse {
  position: relative;
}
.dot-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%      { transform: scale(1.6); opacity: 0; }
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--radius); font-size: 14px; border: 1px solid; }
.alert-success { background: var(--green-bg);  border-color: rgba(74,222,128,0.3);  color: var(--green); }
.alert-error   { background: var(--red-bg);    border-color: rgba(248,113,113,0.3); color: var(--red); }
.alert-info    { background: rgba(108,71,255,0.06); border-color: rgba(108,71,255,0.25); color: var(--purple-300); }

/* ── Form ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-soft); margin-bottom: 6px; }
.form-input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.15);
}
.form-input::placeholder { color: var(--dim); }

/* ── Section utilities ────────────────────────────────────────────────────── */
.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--purple-400);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text);
}
.section-subtitle {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: 56px;
}

/* ── Portal header (logged-in) ────────────────────────────────────────────── */
.portal-header {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}
.portal-header .portal-tagline { color: var(--muted); font-size: 13px; }
.portal-header .portal-user { display: flex; align-items: center; gap: 12px; }
.portal-header .user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.portal-header .user-email { font-size: 13px; color: var(--text-soft); }

/* ── Dashboard layout ─────────────────────────────────────────────────────── */
.dash-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar .nav-section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--dim);
  text-transform: uppercase;
  padding: 6px 14px;
  margin: 8px 0 4px;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1px;
  transition: background .15s, color .15s;
}
.sidebar a:hover { background: var(--card); color: var(--text); text-decoration: none; }
.sidebar a.active {
  background: rgba(108,71,255,0.12);
  color: var(--purple-300);
}
.sidebar .sidebar-spacer { flex: 1; min-height: 24px; }
.dash-main { padding: 36px 40px; overflow-y: auto; }

/* ── Divider ──────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Prose (legal pages) ──────────────────────────────────────────────────── */
.prose h2 { font-size: 19px; font-weight: 700; color: var(--text); margin: 36px 0 12px; letter-spacing: -0.3px; }
.prose p { color: var(--text-soft); line-height: 1.75; margin-bottom: 16px; font-size: 15px; }
.prose ul, .prose ol { color: var(--text-soft); line-height: 1.75; padding-left: 22px; margin-bottom: 16px; font-size: 15px; }
.prose li { margin-bottom: 8px; }
.prose .info-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 20px 0;
}
.prose a { color: var(--purple-400); }
.prose strong { color: var(--text); font-weight: 600; }

/* ── Platform row (dashboard) ─────────────────────────────────────────────── */
.platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.platform-row:last-child { border-bottom: none; }
.platform-info { display: flex; align-items: center; gap: 12px; }
.platform-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.platform-name { font-size: 15px; font-weight: 600; }
.platform-status { font-size: 13px; margin-top: 1px; color: var(--muted); }
.platform-status.connected { color: var(--green); }
.platform-status.pending   { color: var(--orange); }

/* ── Hero gradient mesh ───────────────────────────────────────────────────── */
.mesh-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.mesh-bg::before, .mesh-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.mesh-bg::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--purple-500), transparent 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  animation: float 15s ease-in-out infinite;
}
.mesh-bg::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #4626bf, transparent 70%);
  top: 100px;
  right: -100px;
  opacity: 0.25;
  animation: float 18s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(40px); }
}

/* ── Subtle grid background ───────────────────────────────────────────────── */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* ── FAQ details ──────────────────────────────────────────────────────────── */
details.faq {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s;
}
details.faq:hover { border-color: var(--border-strong); }
details.faq[open] { border-color: rgba(108,71,255,0.3); background: var(--card-hover); }
details.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '+';
  font-size: 22px;
  color: var(--muted);
  transition: transform .2s;
  font-weight: 300;
}
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq p { color: var(--text-soft); margin-top: 12px; font-size: 14px; line-height: 1.7; }

/* ── Pricing card ─────────────────────────────────────────────────────────── */
.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color .2s, transform .2s;
}
.pricing-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.pricing-card.featured {
  background: linear-gradient(180deg, rgba(108,71,255,0.12), transparent 50%), var(--card);
  border-color: var(--purple-500);
  box-shadow: 0 0 40px rgba(108,71,255,0.15);
  position: relative;
}
.pricing-card.featured::before {
  content: 'Most popular';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
}
.pricing-card .price {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
}
.pricing-card .price-period { color: var(--muted); font-size: 14px; font-weight: 500; }
.pricing-card ul { list-style: none; padding: 0; margin: 16px 0 0; }
.pricing-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}
.pricing-card li::before {
  content: '✓';
  color: var(--green);
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Logo cloud ───────────────────────────────────────────────────────────── */
.logo-cloud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  align-items: center;
}
.logo-cloud .placeholder {
  text-align: center;
  padding: 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  letter-spacing: 0.5px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-header { padding: 14px 20px; }
  .site-header nav { display: none; }
  .section-title { font-size: 32px; }
}
@media (max-width: 768px) {
  .dash-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dash-main { padding: 24px 20px; }
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; width: 100%; }
.container-sm { max-width: 880px; margin: 0 auto; padding: 0 32px; width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-soft { color: var(--text-soft); }
.text-gradient { background: linear-gradient(135deg, var(--purple-300), #fff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fade-in { animation: fadeIn .8s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
