/* ==========================================================================
   FlowVista — Shared Guide Stylesheet
   Used by every /guides/* page. Mirrors the design system in privacy.html,
   terms.html, and landing.html (CSS variables, fonts, theme toggle).
   ========================================================================== */

/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root, [data-theme="light"] {
  --surface:          #f6f8fb;
  --surface-mid:      #eef1f6;
  --surface-card:     #ffffff;
  --surface-card-alt: #f9fafb;
  --on-surface:       #0d1117;
  --on-surface-sec:   #4b5563;
  --on-surface-muted: #6b7280;
  --border:           rgba(0,0,0,0.08);
  --border-light:     rgba(0,0,0,0.05);
  --primary:          #059669;
  --primary-dark:     #047857;
  --primary-light:    #ecfdf5;
  --primary-glow:     rgba(5,150,105,0.06);
  --warning-bg:       #fef3c7;
  --warning-border:   rgba(217,119,6,0.28);
  --warning-text:     #92400e;
  --info-bg:          #eff6ff;
  --info-border:      rgba(37,99,235,0.22);
  --info-text:        #1e40af;
  --shadow-sm:        0 1px 3px rgba(13,17,23,0.05), 0 4px 16px -2px rgba(13,17,23,0.04);
  --shadow-md:        0 2px 8px rgba(13,17,23,0.07), 0 12px 32px -4px rgba(13,17,23,0.06);
  --shadow-step:      0 1px 2px rgba(13,17,23,0.04), 0 8px 24px -6px rgba(13,17,23,0.06);
}
[data-theme="dark"] {
  --surface:          #0b0f1a;
  --surface-mid:      #111827;
  --surface-card:     #151d2e;
  --surface-card-alt: #1a2234;
  --on-surface:       #f3f4f6;
  --on-surface-sec:   #d1d5db;
  --on-surface-muted: #9ca3af;
  --border:           rgba(255,255,255,0.08);
  --border-light:     rgba(255,255,255,0.05);
  --primary:          #34d399;
  --primary-dark:     #10b981;
  --primary-light:    rgba(52,211,153,0.12);
  --primary-glow:     rgba(52,211,153,0.18);
  --warning-bg:       rgba(217,119,6,0.13);
  --warning-border:   rgba(217,119,6,0.32);
  --warning-text:     #fbbf24;
  --info-bg:          rgba(37,99,235,0.13);
  --info-border:      rgba(96,165,250,0.30);
  --info-text:        #93c5fd;
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.3), 0 4px 16px -2px rgba(0,0,0,0.2);
  --shadow-md:        0 4px 16px rgba(0,0,0,0.35), 0 12px 40px -4px rgba(0,0,0,0.3);
  --shadow-step:      0 1px 3px rgba(0,0,0,0.3), 0 12px 32px -8px rgba(0,0,0,0.35);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 300ms ease, color 300ms ease;
}

/* ─── Top Navigation ────────────────────────────────────────────────────── */
.guide-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  transition: background 240ms ease, border-color 240ms ease;
}
[data-theme="dark"] .guide-nav {
  background: rgba(11,15,26,0.82);
}
.guide-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 17px; letter-spacing: -0.3px;
  color: var(--on-surface); text-decoration: none;
}
.guide-logo img { width: 26px; height: 26px; border-radius: 6px; }
.guide-logo span { color: var(--primary); }
.guide-nav-actions { display: flex; align-items: center; gap: 6px; }
.guide-back {
  font-size: 13px; font-weight: 500;
  color: var(--on-surface-sec); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  transition: background 140ms ease, color 140ms ease;
}
.guide-back:hover { background: var(--surface-mid); color: var(--on-surface); }
.guide-theme-toggle {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px;
  color: var(--on-surface-sec);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.guide-theme-toggle:hover {
  background: var(--surface-mid);
  color: var(--on-surface);
  border-color: var(--border);
}
.guide-theme-toggle svg { width: 18px; height: 18px; }
.guide-theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .guide-theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .guide-theme-toggle .moon-icon { display: none; }

/* ─── Main Container ────────────────────────────────────────────────────── */
main.guide {
  max-width: 820px;
  margin: 40px auto 0;
  padding: 0 24px 96px;
}

/* ─── Breadcrumbs ───────────────────────────────────────────────────────── */
.guide-breadcrumb {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--on-surface-muted);
  margin-bottom: 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.guide-breadcrumb a {
  color: var(--on-surface-muted);
  text-decoration: none;
  transition: color 140ms ease;
}
.guide-breadcrumb a:hover { color: var(--primary); }
.guide-breadcrumb-sep { opacity: 0.6; }
.guide-breadcrumb-current { color: var(--on-surface-sec); }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.guide-hero { margin-bottom: 40px; }
.guide-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(5,150,105,0.20);
  margin-bottom: 18px;
}
[data-theme="dark"] .guide-tag { color: var(--primary); border-color: rgba(52,211,153,0.25); }
.guide-tag svg { width: 12px; height: 12px; }
.guide h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 44px; font-weight: 700;
  letter-spacing: -1.3px; line-height: 1.08;
  margin: 0 0 18px;
  color: var(--on-surface);
}
.guide-lede {
  font-size: 17px;
  color: var(--on-surface-sec);
  margin: 0 0 26px;
  max-width: 680px;
}
.guide-meta-chips {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 0 0 8px;
}
.guide-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--on-surface-sec);
  box-shadow: var(--shadow-sm);
}
.guide-chip svg { width: 13px; height: 13px; color: var(--primary); flex-shrink: 0; }
.guide-chip strong { color: var(--on-surface); font-weight: 600; }

/* ─── "Before you begin" Callout ────────────────────────────────────────── */
.guide-needs {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface-card) 100%);
  border: 1px solid rgba(5,150,105,0.22);
  border-radius: 16px;
  padding: 24px 26px;
  margin: 36px 0 48px;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .guide-needs {
  background: linear-gradient(135deg, rgba(52,211,153,0.10) 0%, var(--surface-card) 100%);
  border-color: rgba(52,211,153,0.22);
}
.guide-needs::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}
.guide-needs-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 13px;
  color: var(--primary-dark);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  position: relative;
}
[data-theme="dark"] .guide-needs-title { color: var(--primary); }
.guide-needs-title svg { width: 16px; height: 16px; }
.guide-needs ul {
  margin: 0; padding: 0;
  list-style: none;
  position: relative;
}
.guide-needs li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 15px;
  color: var(--on-surface);
  margin-bottom: 8px;
  line-height: 1.5;
}
.guide-needs li:last-child { margin-bottom: 0; }
.guide-needs li svg {
  width: 18px; height: 18px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ─── Section Intro ─────────────────────────────────────────────────────── */
.guide-section-intro {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 12px;
  color: var(--on-surface-muted);
  text-transform: uppercase; letter-spacing: 1.4px;
  margin: 0 0 8px;
}
.guide h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.6px; line-height: 1.2;
  margin: 56px 0 20px;
  color: var(--on-surface);
}
.guide h2:first-of-type { margin-top: 16px; }

/* ─── Step Cards ────────────────────────────────────────────────────────── */
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.guide-step {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 30px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-step);
  transition: border-color 180ms ease, transform 180ms ease;
  position: relative;
}
.guide-step:hover {
  border-color: rgba(5,150,105,0.25);
}
[data-theme="dark"] .guide-step:hover { border-color: rgba(52,211,153,0.28); }
.guide-step-header {
  display: flex; align-items: flex-start; gap: 18px;
  margin-bottom: 14px;
}
.guide-step-num {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px -2px rgba(5,150,105,0.40);
}
[data-theme="dark"] .guide-step-num {
  box-shadow: 0 4px 14px -2px rgba(52,211,153,0.35);
  color: #0b0f1a;
}
.guide-step h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.4px; line-height: 1.3;
  margin: 7px 0 0;
  color: var(--on-surface);
}
.guide-step-body {
  padding-left: 64px;
}
.guide-step-body p {
  margin: 0 0 12px;
  font-size: 15.5px;
  color: var(--on-surface-sec);
  line-height: 1.65;
}
.guide-step-body p:last-child { margin-bottom: 0; }
.guide-step-body strong { color: var(--on-surface); font-weight: 600; }
.guide-step-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px;
  background: var(--surface-mid);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--on-surface);
  border: 1px solid var(--border-light);
}
.guide-step-body a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 2.5px;
  text-decoration-thickness: 1px;
}
[data-theme="dark"] .guide-step-body a { color: var(--primary); }

/* ─── Step Figure (SVG illustration) ────────────────────────────────────── */
.guide-figure {
  margin: 18px 0 4px;
  background: var(--surface-card-alt);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.guide-figure svg {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
}

/* ─── Inline Tip / Warn Callouts (inside steps) ─────────────────────────── */
.guide-tip, .guide-warn {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
  margin: 14px 0 0;
}
.guide-tip {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--on-surface);
}
.guide-warn {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--on-surface);
}
.guide-tip svg, .guide-warn svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}
.guide-tip svg { color: var(--info-text); }
.guide-warn svg { color: var(--warning-text); }
.guide-tip-label, .guide-warn-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-right: 4px;
}
.guide-tip-label { color: var(--info-text); }
.guide-warn-label { color: var(--warning-text); }
.guide-tip a, .guide-warn a {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
}

/* ─── Standalone Callout (between sections) ─────────────────────────────── */
.guide-callout {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 32px 0;
}
.guide-callout-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 13px;
  color: var(--warning-text);
  text-transform: uppercase; letter-spacing: 1.1px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.guide-callout-title svg { width: 16px; height: 16px; }
.guide-callout p {
  margin: 0 0 8px;
  font-size: 14.5px;
  color: var(--on-surface);
  line-height: 1.6;
}
.guide-callout p:last-child { margin-bottom: 0; }
.guide-callout a {
  color: var(--warning-text);
  text-decoration: underline;
  font-weight: 600;
}

/* ─── CTA Band ──────────────────────────────────────────────────────────── */
.guide-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  padding: 44px 40px;
  margin: 56px 0 40px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px -10px rgba(5,150,105,0.35);
}
.guide-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.16) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,0.10) 0%, transparent 45%);
  pointer-events: none;
}
.guide-cta-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: rgba(255,255,255,0.75);
  margin: 0 0 10px;
  position: relative;
}
.guide-cta h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.6px; line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
  position: relative;
}
.guide-cta p {
  color: rgba(255,255,255,0.92);
  font-size: 15px;
  margin: 0 auto 22px;
  max-width: 520px;
  position: relative;
}
.guide-btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff;
  color: var(--primary-dark);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 15.5px;
  padding: 13px 28px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 16px -2px rgba(0,0,0,0.15);
  transition: transform 160ms ease, box-shadow 160ms ease;
  position: relative;
}
.guide-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.22);
}
.guide-btn-primary svg {
  width: 17px; height: 17px;
  transition: transform 160ms ease;
}
.guide-btn-primary:hover svg { transform: translateX(3px); }

/* ─── FAQ ───────────────────────────────────────────────────────────────── */
.guide-faq { margin-top: 12px; }
.guide-faq-item {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 160ms ease;
}
.guide-faq-item:hover { border-color: rgba(5,150,105,0.2); }
.guide-faq-item[open] { border-color: rgba(5,150,105,0.25); }
.guide-faq-item summary {
  padding: 16px 22px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 15.5px;
  color: var(--on-surface);
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  user-select: none;
}
.guide-faq-item summary::-webkit-details-marker { display: none; }
.guide-faq-item summary::after {
  content: "";
  width: 14px; height: 14px;
  flex-shrink: 0;
  border-right: 2px solid var(--on-surface-muted);
  border-bottom: 2px solid var(--on-surface-muted);
  transform: rotate(45deg);
  transition: transform 200ms ease, border-color 200ms ease;
  margin-right: 4px;
}
.guide-faq-item[open] summary::after {
  transform: rotate(-135deg);
  border-color: var(--primary);
}
.guide-faq-item .guide-faq-body {
  padding: 0 22px 18px;
  font-size: 14.5px;
  color: var(--on-surface-sec);
  line-height: 1.65;
}
.guide-faq-item .guide-faq-body p { margin: 0 0 10px; }
.guide-faq-item .guide-faq-body p:last-child { margin-bottom: 0; }
.guide-faq-item .guide-faq-body a {
  color: var(--primary-dark);
  text-decoration: underline;
}
[data-theme="dark"] .guide-faq-item .guide-faq-body a { color: var(--primary); }
.guide-faq-item .guide-faq-body strong { color: var(--on-surface); font-weight: 600; }

/* ─── Related Guides Grid ───────────────────────────────────────────────── */
.guide-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.guide-bank-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--on-surface);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.guide-bank-card:not(.is-soon):hover {
  border-color: rgba(5,150,105,0.28);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.guide-bank-card-info { display: flex; flex-direction: column; gap: 2px; }
.guide-bank-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 15px;
  color: var(--on-surface);
}
.guide-bank-card-meta {
  font-size: 12px;
  color: var(--on-surface-muted);
}
.guide-bank-card-arrow {
  width: 18px; height: 18px;
  color: var(--on-surface-muted);
  flex-shrink: 0;
  transition: color 160ms ease, transform 160ms ease;
}
.guide-bank-card:not(.is-soon):hover .guide-bank-card-arrow {
  color: var(--primary);
  transform: translateX(3px);
}
.guide-bank-card.is-soon {
  opacity: 0.62;
  cursor: default;
}
.guide-bank-card.is-soon .guide-bank-card-meta { color: var(--on-surface-muted); }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.guide-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--on-surface-muted);
}
.guide-footer a {
  color: var(--on-surface-sec);
  text-decoration: none;
  margin: 0 8px;
  transition: color 140ms ease;
}
.guide-footer a:hover { color: var(--on-surface); }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .guide-nav { padding: 12px 18px; }
  main.guide { margin: 24px auto 0; padding: 0 18px 72px; }
  .guide h1 { font-size: 32px; letter-spacing: -0.8px; }
  .guide-lede { font-size: 15.5px; }
  .guide h2 { font-size: 22px; margin: 40px 0 16px; }
  .guide-needs { padding: 20px; }
  .guide-step { padding: 22px 20px; }
  .guide-step-header { gap: 14px; margin-bottom: 10px; }
  .guide-step-num { width: 40px; height: 40px; font-size: 15px; border-radius: 10px; }
  .guide-step h3 { font-size: 17.5px; margin-top: 5px; }
  .guide-step-body { padding-left: 0; }
  .guide-step-body p { font-size: 15px; }
  .guide-figure { padding: 16px; }
  .guide-cta { padding: 32px 22px; margin: 44px 0 28px; border-radius: 16px; }
  .guide-cta h2 { font-size: 22px; }
  .guide-cta p { font-size: 14.5px; }
  .guide-btn-primary { padding: 12px 22px; font-size: 14.5px; }
  .guide-faq-item summary { padding: 14px 18px; font-size: 14.5px; }
  .guide-faq-item .guide-faq-body { padding: 0 18px 14px; }
  .guide-related-grid { grid-template-columns: 1fr; }
  .guide-back span { display: none; }
}

/* ─── Reduced Motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
