/* KinetixRate v3 SaaS Design System */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #059669;
  --warn: #d97706;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --accent: #10b981;
  --warn: #f59e0b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.2s, color 0.2s;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px 0;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--primary); }
nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
nav a:hover, nav a.active { color: var(--primary); }
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero { padding: 48px 0 28px; text-align: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); line-height: 1.18; margin-bottom: 12px; letter-spacing: -0.02em; }
.hero p { color: var(--text-muted); max-width: 710px; margin: 0 auto; font-size: 1.05rem; }

/* Preset Pills */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.preset-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.preset-btn:hover {
  border-color: var(--primary);
  background: var(--surface-alt);
}

.grid-2 { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 24px; margin: 16px 0 48px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(295px, 1fr)); gap: 20px; margin: 24px 0; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.22rem;
  margin-bottom: 18px;
}
.card h3 { font-size: 1.08rem; margin-bottom: 8px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

.form-group { margin-bottom: 16px; }
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}
.btn:hover { background: var(--primary-hover); }

.result-highlight {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.result-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.result-value { font-size: 2.35rem; font-weight: 800; color: var(--primary); margin: 4px 0; }

/* Stacked Breakdown Bar */
.bar-wrap { margin: 16px 0 18px; }
.bar-track {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-alt);
}
.bar-net { background: var(--accent); transition: width 0.25s; }
.bar-tax { background: var(--primary); transition: width 0.25s; }
.bar-exp { background: var(--warn); transition: width 0.25s; }
.bar-legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
}
.stat-row:last-child { border-bottom: none; }

.section-title { font-size: 1.5rem; margin: 48px 0 8px; }
.section-sub { color: var(--text-muted); margin-bottom: 20px; }

.article { max-width: 840px; margin: 32px auto 64px; }
.article h2 { font-size: 1.5rem; margin: 32px 0 12px; }
.article h3 { font-size: 1.15rem; margin: 22px 0 8px; }
.article p, .article li { color: var(--text-muted); margin-bottom: 12px; }
.article ul, .article ol { padding-left: 22px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.92rem; background: var(--surface); }
th, td { padding: 12px; border: 1px solid var(--border); text-align: left; }
th { background: var(--surface-alt); font-weight: 700; color: var(--text); }

.tool-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
.tool-link:hover { transform: translateY(-2px); border-color: var(--primary); }
.icon-box {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 12px;
}
.tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq-item h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 6px; }
.faq-item p { margin-bottom: 0; font-size: 0.95rem; }

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 64px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.footer-grid h4 { color: var(--text); margin-bottom: 10px; font-size: 0.95rem; }
.footer-grid a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 6px; }
.footer-grid a:hover { color: var(--primary); }
.copyright { border-top: 1px solid var(--border); padding-top: 18px; text-align: center; font-size: 0.82rem; }
