/* ==========================================================================
   BudgetScan - Modern Aesthetics CSS & Design Tokens
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color System */
  --bg-dark: #07090e;
  --bg-card: rgba(15, 20, 32, 0.7);
  --bg-card-hover: rgba(22, 30, 48, 0.85);
  --bg-dark-section: #0b0f19;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(99, 102, 241, 0.4);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.25);
  --shadow-cyan-glow: 0 0 30px rgba(6, 182, 212, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* Background Effects */
.bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.bg-glow-1 {
  top: -100px;
  left: 20%;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.bg-glow-2 {
  top: 400px;
  right: 10%;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Typography & Helpers */
.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.code-tag {
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.9em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(7, 9, 14, 0.75);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-v {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  gap: 12px;
}

/* Hero Section */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-light);
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 60px;
}

/* Syntax Grid Section */
.syntax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.syntax-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.syntax-card.highlighted {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
  background: rgba(22, 28, 45, 0.9);
}

.syntax-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.syntax-badge.recommended {
  color: var(--primary-light);
}

.syntax-code {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  background: #090d16;
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: inline-block;
}

.syntax-card.highlighted .syntax-code {
  color: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(15, 23, 42, 0.9);
}

.syntax-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.syntax-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.syntax-foot {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.syntax-foot strong {
  color: var(--accent-emerald);
}

/* Honesty notes */
.status-note {
  max-width: 900px;
  margin: 28px auto 16px;
  padding: 12px 18px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  text-align: center;
}

.calc-note {
  max-width: 900px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: #f59e0b;
  font-style: italic;
}

.feature-card a {
  color: var(--primary-light);
}

/* Terminal Window Preview */
.example-label {
  max-width: 900px;
  margin: 0 auto 10px;
  text-align: center;
  font-size: 0.85rem;
  color: #f59e0b;
  font-style: italic;
}

.terminal-window {
  max-width: 900px;
  margin: 0 auto;
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  text-align: left;
}

.terminal-header {
  background: #161b22;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.window-controls {
  display: flex;
  gap: 8px;
}

.control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.close { background: #ff5f56; }
.minimize { background: #ffbd2e; }
.maximize { background: #27c93f; }

.window-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.window-badge {
  font-size: 0.75rem;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-sans);
}

.comment-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.user-avatar {
  background: #374151;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.highlight-mention {
  color: var(--accent-cyan);
  font-weight: 700;
}

.terminal-divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

.bot-card {
  background: rgba(22, 27, 34, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
}

.scan-result-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.status-icon.danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.scan-result-header h4 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.scan-result-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-link {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Bot cost summary box */
.bot-cost-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.cost-box-title {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 12px;
}

.cost-total {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.cost-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-item {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 1.5fr;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

.cost-item.winner {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.cost-provider { font-weight: 600; }
.cost-specs { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8em; }
.cost-price { font-family: var(--font-mono); font-weight: 700; color: var(--accent-cyan); }
.cost-status { font-size: 0.75em; text-align: right; color: var(--text-dim); }
.cost-item.winner .cost-status { color: var(--accent-emerald); font-weight: 700; }
.cost-status.ready { color: var(--primary-light); font-weight: 700; }

/* Sections */
.section {
  padding: 90px 0;
}

.section-dark {
  background-color: var(--bg-dark-section);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
}

.feature-card.highlight-border {
  border-color: var(--border-color-glow);
  box-shadow: var(--shadow-glow);
}

.feature-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.icon-purple { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.icon-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.icon-indigo { background: rgba(129, 140, 248, 0.15); color: #a5b4fc; }

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Workflow Steps */
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
}

.step-num {
  font-size: 2.5rem;
  font-weight: 900;
  color: rgba(99, 102, 241, 0.2);
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.step-mock {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mock-tag {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.text-success { color: var(--accent-emerald); }
.text-accent { color: var(--accent-cyan); }

/* Interactive Demo Card */
.interactive-demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-glow);
}

.demo-controls-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.demo-controls-panel label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  flex-grow: 1;
  max-width: 450px;
}

.demo-output-terminal {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 200px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
}

.term-line { margin-bottom: 8px; }
.term-line.prompt { color: var(--text-dim); }
.term-line.info { color: var(--accent-cyan); }
.term-line.warning { color: var(--accent-amber); }
.term-line.danger { color: var(--accent-rose); }
.term-line.success { color: var(--accent-emerald); }

/* Calculator */
.calculator-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
}

@media (max-width: 900px) {
  .calculator-wrapper {
    grid-template-columns: 1fr;
  }
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.calc-field label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.calc-val {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 1.1em;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.calc-results {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.primary-result {
  margin-bottom: 24px;
}

.result-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.result-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent-emerald);
  letter-spacing: -1px;
  display: block;
}

.result-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.sub-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.sub-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  align-items: center;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pricing-card.featured {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
  background: rgba(22, 28, 45, 0.9);
  transform: scale(1.03);
}

.popular-tag {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-full);
}

.plan-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.plan-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 30px;
}

.plan-price .currency { font-size: 1.5rem; vertical-align: top; }
.plan-price .period { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }

.plan-features {
  list-style: none;
  margin-bottom: 36px;
  flex-grow: 1;
}

.plan-features li {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.plan-features li strong {
  color: var(--text-main);
}

/* Footer */
.footer {
  background: #040609;
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 340px;
  margin-top: 12px;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title { font-size: 2.4rem; }
  .nav-links { display: none; }
  .cost-item { grid-template-columns: 1fr 1fr; gap: 8px; }
  .results-grid { grid-template-columns: 1fr; }

  /* Header must fit a phone: drop the badge and the secondary button, tighten the rest */
  .nav-container { gap: 10px; }
  .badge-v { display: none; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn { padding: 8px 12px; font-size: 0.85rem; white-space: nowrap; }
  .nav-actions .btn-secondary:not(.lang-btn) { display: none; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .nav-actions .btn-primary { display: none; }
}

/* ==========================================================================
   Guide pages (how-to)
   ========================================================================== */
.howto-link {
  margin-top: 28px;
  text-align: center;
  color: var(--text-muted);
}

.howto-link a,
.doc a {
  color: var(--primary-light);
}

.doc {
  padding: 56px 0 96px;
  position: relative;
  z-index: 1;
}

.doc-container {
  max-width: 860px;
}

.doc h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 16px;
}

.doc h2 {
  scroll-margin-top: 88px;
  font-size: 1.5rem;
  margin: 48px 0 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.doc h3 {
  font-size: 1.1rem;
  margin: 26px 0 8px;
}

.doc p,
.doc li {
  color: var(--text-muted);
}

.doc p {
  margin: 0 0 14px;
}

.doc ul,
.doc ol {
  margin: 0 0 16px 22px;
}

.doc li {
  margin-bottom: 6px;
}

.doc .toc {
  margin: 20px 0 8px;
  padding: 16px 20px 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.doc pre {
  margin: 0 0 18px;
  padding: 14px 16px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-main);
}

.doc-table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.doc th,
.doc td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.doc th {
  color: var(--text-main);
  font-weight: 600;
}

.tag-status {
  display: inline-block;
  padding: 1px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tag-available { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); }
.tag-untested  { color: var(--accent-amber);   background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.tag-draft     { color: var(--accent-amber);   background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.tag-planned   { color: var(--primary-light);  background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.4); }

/* Success stories */
.story-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.story-card h3 {
  font-size: 1.35rem;
  margin: 12px 0;
}

.story-card p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.story-card a {
  color: var(--primary-light);
}

.story-badge {
  display: inline-block;
  padding: 2px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.story-timeline {
  list-style: none;
  margin: 0 0 18px 6px;
  padding: 0;
  border-left: 2px solid var(--border-color-glow);
}

.story-timeline li {
  position: relative;
  padding: 0 0 14px 20px;
  color: var(--text-muted);
}

.story-timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.story-timeline strong {
  color: var(--text-main);
}

.story-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.story-card .story-caveat {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

@media (max-width: 480px) {
  .story-card { padding: 20px 16px; }
}

.story-card h3 a {
  color: var(--text-main);
  text-decoration: none;
}

.story-card h3 a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .nav-actions .btn-primary { display: none; }
}

/* Login-flow sketch on story pages */
.flow {
  max-width: 480px;
  margin: 26px auto;
}

.flow svg {
  display: block;
  width: 100%;
  height: auto;
}

.flow-box { fill: rgba(15, 20, 32, 0.85); stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.5; }
.flow-new { fill: rgba(16, 185, 129, 0.13); stroke: #10b981; }
.flow-t { fill: #f3f4f6; font: 600 15px Inter, -apple-system, sans-serif; text-anchor: middle; }
.flow-t-new { fill: #34d399; }
.flow-s { fill: #9ca3af; font: 400 13px Inter, -apple-system, sans-serif; text-anchor: middle; }
.flow-arrow { stroke: #818cf8; stroke-width: 2; fill: none; }
.flow-bypass { stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
.flow-note { fill: #f59e0b; font: 600 12.5px Inter, -apple-system, sans-serif; text-anchor: middle; }

.flow figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Illustration / screenshot figures on story pages */
.shot {
  max-width: 900px;
  margin: 26px auto;
}

.shot-scroll {
  overflow-x: auto;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.shot figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .shot img { width: 760px; max-width: none; }
}
