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

:root {
  --primary: #1a56db;
  --primary-dark: #1345b7;
  --primary-light: #e8f0fe;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --success: #10b981;
  --danger: #ef4444;
  --bg: #f8faff;
  --bg-white: #ffffff;
  --surface: #f1f5fd;
  --border: #e2e8f8;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(26,86,219,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(26,86,219,0.10), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 60px rgba(26,86,219,0.14), 0 8px 24px rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --font: 'Poppins', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --max-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(1rem,4vw,2rem);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 800; font-size: 1.15rem;
  color: var(--text); white-space: nowrap;
}
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 900; font-size: 1rem; color: #fff;
  box-shadow: 0 4px 12px rgba(26,86,219,0.3);
}
.logo span { color: var(--primary); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--text-muted); text-decoration: none;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition);
}
.site-nav a:hover { color: var(--primary); background: var(--primary-light); }
.site-nav a.active { color: var(--primary); background: var(--primary-light); }
.btn-cta-sm {
  background: var(--primary); color: #fff;
  padding: 8px 18px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 600;
  text-decoration: none; transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(26,86,219,0.25);
}
.btn-cta-sm:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,86,219,0.35); }

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 12px clamp(1rem,4vw,2rem);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-muted);
}
.breadcrumb-inner { max-width: var(--max-w); margin: 0 auto; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

/* ── FOOTER ── */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem clamp(1rem,4vw,2rem) 1.5rem;
  margin-top: 4rem;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 2fr repeat(3,1fr);
  gap: 2.5rem; padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 1.5rem;
}
@media(max-width:768px){ .footer-top { grid-template-columns: 1fr 1fr; } }
@media(max-width:480px){ .footer-top { grid-template-columns: 1fr; } }
.footer-brand .logo { color: #fff; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.82rem; line-height: 1.7; max-width: 240px; }
.footer-col h4 { font-size: 0.78rem; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.85rem; }
.footer-col a { display: block; color: #94a3b8; text-decoration: none; font-size: 0.82rem; margin-bottom: 6px; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.78rem; }
.footer-bottom a { color: #64748b; text-decoration: none; }
.footer-bottom a:hover { color: #94a3b8; }

/* ── CALCULATOR WIDGET ── */
.calc-widget {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.calc-widget-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 1.75rem 2rem;
  color: #fff;
}
.calc-widget-header h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.calc-widget-header p { font-size: 0.85rem; opacity: 0.85; }
.calc-body { display: grid; grid-template-columns: 1fr 1fr; }
@media(max-width:600px){ .calc-body { grid-template-columns: 1fr; } }
.calc-inputs-col { padding: 2rem; border-right: 1px solid var(--border); }
@media(max-width:600px){ .calc-inputs-col { border-right: none; border-bottom: 1px solid var(--border); } }
.calc-output-col {
  padding: 2rem;
  background: linear-gradient(160deg, #f8faff 0%, #eef3ff 100%);
  display: flex; flex-direction: column; justify-content: center; min-height: 280px;
}

/* Form */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.02em; }
.form-input {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; font-weight: 500;
  outline: none; transition: all var(--transition);
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(26,86,219,0.08); }
.form-input::placeholder { color: var(--text-light); font-weight: 400; }

/* Result */
.result-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light); color: var(--primary); font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.result-number { font-size: clamp(2.2rem,5vw,3.5rem); font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.result-number.positive { color: var(--success); }
.result-number.negative { color: var(--danger); }
.result-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.formula-box { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.5; }
.formula-box strong { color: var(--primary); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 100px; font-family: var(--font); font-size: 0.8rem; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(26,86,219,0.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,86,219,0.3); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: #94a3b8; }

/* ── CONTENT SECTIONS ── */
.page-container { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem); }
.content-section { margin: 3.5rem 0; }
.section-title { font-size: clamp(1.5rem,3vw,2rem); font-weight: 800; color: var(--text); margin-bottom: 0.75rem; letter-spacing: -0.02em; line-height: 1.2; }
.section-title span { color: var(--primary); }
.section-subtitle { color: var(--text-muted); font-size: 1rem; max-width: 640px; margin-bottom: 2rem; }

/* Prose */
.prose { color: var(--text-muted); line-height: 1.85; font-size: 0.97rem; }
.prose p { margin-bottom: 1rem; }
.prose h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 1.75rem 0 0.6rem; }
.prose h4 { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 1.25rem 0 0.5rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose .highlight-box { background: var(--primary-light); border-left: 3px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.prose .highlight-box p { margin: 0; color: var(--primary-dark); font-weight: 500; font-size: 0.9rem; }

/* Info cards */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 1rem; margin: 1.5rem 0; }
.info-card { background: var(--bg-white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: all var(--transition); }
.info-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.info-card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-size: 1.1rem; margin-bottom: 0.85rem; }
.info-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.4rem; }
.info-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* Example table */
.example-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin: 1.25rem 0; }
.example-table th { background: var(--primary); color: #fff; padding: 10px 16px; text-align: left; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em; }
.example-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.example-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.example-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.example-table tr:last-child td { border-bottom: none; }
.example-table tr:nth-child(even) td { background: var(--bg); }
.example-table td:first-child { font-weight: 600; color: var(--text); }
.example-table td strong { color: var(--primary); font-family: var(--mono); }

/* FAQ */
.faq-list { border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-btn { width: 100%; background: none; border: none; padding: 1.1rem 1.5rem; text-align: left; font-family: var(--font); font-size: 0.95rem; font-weight: 600; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; transition: background var(--transition); }
.faq-btn:hover { background: var(--primary-light); color: var(--primary); }
.faq-icon { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; font-size: 1rem; color: var(--text-muted); transition: all var(--transition); }
.faq-item.open .faq-btn { color: var(--primary); background: var(--primary-light); }
.faq-item.open .faq-icon { transform: rotate(45deg); border-color: var(--primary); color: var(--primary); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; background: var(--bg); }
.faq-answer-inner { padding: 0 1.5rem 1.25rem; font-size: 0.88rem; color: var(--text-muted); line-height: 1.8; }
.faq-item.open .faq-answer { max-height: 500px; }

/* Related tools */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 10px; }
.related-card { background: var(--bg-white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 10px; transition: all var(--transition); font-size: 0.85rem; font-weight: 500; }
.related-card:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.related-card .icon { font-size: 1.1rem; flex-shrink: 0; }

/* Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; z-index: 999; background: var(--text); color: #fff; font-family: var(--font); font-size: 0.82rem; font-weight: 500; padding: 10px 20px; border-radius: 100px; transform: translateY(20px); opacity: 0; transition: all 0.3s; pointer-events: none; box-shadow: var(--shadow); }
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Utility ── */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--primary-light); color: var(--primary); font-size: 0.72rem; font-weight: 700; padding: 4px 12px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.06em; }
.chip.green { background: #d1fae5; color: #059669; }
.chip.amber { background: #fef3c7; color: #d97706; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

@media(max-width:768px){
  .site-nav { display: none; }
}
