/* ============================================================
   TAX-SIM Theme — Bloomberg/trader-style dark UI
   Applied to all simulators + root landing page.
   ============================================================ */

:root {
  --bg: #0b0e13;
  --bg-elevated: #11161d;
  --surface: #161c25;
  --surface-2: #1c232e;
  --surface-3: #232b38;
  --border: #2a3340;
  --border-strong: #3a4555;
  --border-soft: #1c232e;

  --text: #e6edf3;
  --text-strong: #ffffff;
  --text-muted: #8b96a5;
  --text-dim: #5b6573;

  --accent: #ff6b35;
  --accent-hover: #ff8552;
  --accent-soft: rgba(255, 107, 53, 0.1);
  --accent-border: rgba(255, 107, 53, 0.4);
  --accent-text: #ff6b35;

  --cyan: #38d4cf;
  --cyan-soft: rgba(56, 212, 207, 0.12);
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.12);
  --red: #f85149;
  --red-soft: rgba(248, 81, 73, 0.1);
  --amber: #e3b341;
  --amber-soft: rgba(227, 179, 65, 0.12);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Helvetica Neue",
               sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas",
               "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(255, 107, 53, 0.04) 0%, transparent 50%),
    radial-gradient(at 100% 0%, rgba(56, 212, 207, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 19, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #0a0d12;
  font-family: var(--font-mono);
  font-weight: 900;
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: -0.04em;
}
.brand-name {
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 13px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 4px;
  transition: color 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

@media (max-width: 720px) {
  .header-inner { gap: 10px; padding: 0 12px; }
  .nav-link { padding: 6px 8px; font-size: 11px; }
  .brand-name { font-size: 12px; }
}

/* ============================================================
   Container, Cards
   ============================================================ */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 12px;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
h1 { font-size: 24px; }
h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 18px;
  letter-spacing: 0;
}

.card > h1:first-child,
.card > h2:first-child { margin-top: 0; }

.card p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: #c9d1d9;
}
.card ul {
  margin: 0 0 12px 18px;
  padding: 0;
  font-size: 13.5px;
  color: #c9d1d9;
}
.card ul li { margin-bottom: 4px; }
.lead {
  margin: 0 0 14px;
  font-size: 14px;
  color: #c9d1d9;
}
.lead strong { color: var(--text-strong); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

strong { color: var(--text-strong); font-weight: 700; }

/* ============================================================
   Notice / alerts
   ============================================================ */
.notice {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--amber);
  padding: 10px 14px;
  border-radius: 4px;
  line-height: 1.6;
}

/* ============================================================
   Forms
   ============================================================ */
.field { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
  transition: border-color 0.12s ease;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}
.field select {
  font-family: var(--font-sans);
  font-weight: 600;
}
.help {
  font-size: 11px;
  color: var(--text-dim);
  margin: 4px 0 0;
}

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Buttons
   ============================================================ */
.actions { margin-top: 16px; }

.btn {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0a0d12;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn:active { transform: translateY(1px); }

.btn-secondary {
  width: auto;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.btn-secondary:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn-link:hover { color: var(--accent-hover); text-decoration: underline; }

/* ============================================================
   Result tiles (data dashboard look)
   ============================================================ */
.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.result-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  position: relative;
}
.result-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.result-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
  line-height: 1.2;
}
.result-value.negative { color: var(--red); }
.result-value.result-text {
  font-family: var(--font-sans);
  font-size: 15px;
}

.strong-box {
  background:
    linear-gradient(180deg, rgba(255, 107, 53, 0.08), rgba(255, 107, 53, 0.02)),
    var(--bg-elevated);
  border-color: var(--accent-border);
}
.strong-box .result-value {
  color: var(--accent);
  font-size: 26px;
}

.result-note {
  font-size: 11px;
  color: var(--text-muted);
  margin: 14px 0 0;
  line-height: 1.6;
}

.error {
  color: var(--red);
  font-size: 12px;
  margin: 8px 0 0;
  font-weight: 600;
  min-height: 1.4em;
  font-family: var(--font-mono);
}

/* ============================================================
   Related tools
   ============================================================ */
.related-tools {
  background: var(--surface);
}
.related-tools a {
  color: var(--cyan);
  font-weight: 600;
}
.related-tools a:hover { color: #5ce8e3; }

/* ============================================================
   Affiliate cards (multi-brand)
   ============================================================ */
.affiliate-lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.aff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 768px) {
  .aff-grid { grid-template-columns: 1fr 1fr; }
}
.aff-card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease;
}
.aff-card:hover { border-color: var(--border-strong); }
div.aff-card { cursor: default; }
div.aff-card:hover { border-color: var(--border); }

.aff-label {
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.aff-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 6px;
}
.aff-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 0;
  line-height: 1.5;
}
.aff-note {
  font-size: 10px;
  color: var(--text-dim);
  margin: 14px 0 0;
  letter-spacing: 0.04em;
}

.aff-brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.aff-brand-btn {
  flex: 1 1 auto;
  text-align: center;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}
.aff-brand-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.aff-brand-btn:active { transform: scale(0.98); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #060810;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 32px 0 14px;
  font-size: 12px;
}
.footer-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 20px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.6fr; }
}
.footer-col .brand { margin-bottom: 10px; }
.footer-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 10px;
  text-transform: uppercase;
}
.footer-text {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}
.footer-text-small {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}
.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-list li {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
}
.footer-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
}
.footer-list a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1180px;
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
@media (max-width: 480px) {
  .footer-bottom { flex-direction: column; gap: 4px; }
}

/* ============================================================
   Chart wraps (shared by simulators)
   ============================================================ */
.chart-section-title {
  margin: 20px 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chart-wrap {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 12px;
  margin: 8px 0 0;
}
.chart-wrap canvas { width: 100% !important; height: auto !important; }

.chart-wrap-pie { max-width: 460px; margin-left: auto; margin-right: auto; }
.chart-wrap-bar { padding: 12px 12px 8px; }
.chart-wrap-line { padding: 12px; }

/* ============================================================
   Lead capture forms (shared)
   ============================================================ */
.lead-card {
  background:
    linear-gradient(180deg, rgba(255, 107, 53, 0.08), rgba(255, 107, 53, 0.02)),
    var(--surface);
  border-color: var(--accent-border);
  animation: stepFade 0.35s ease;
}
.lead-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.lead-card h2 {
  border-bottom: none;
  padding-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 18px;
  color: var(--text-strong);
  margin-bottom: 8px;
}
.lead-lead {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 14px;
}
.lead-summary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.lead-summary-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lead-auto-fields {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.lead-auto-fields li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text);
}
.lead-auto-fields .lead-key { color: var(--text-muted); }
.lead-auto-fields .lead-val { color: var(--text-strong); font-variant-numeric: tabular-nums; }

.lead-form { display: grid; gap: 10px; }
.lead-form .lead-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 600px) {
  .lead-form .lead-row { grid-template-columns: 1fr 1fr; }
}
.lead-form input[type="email"],
.lead-form input[type="text"],
.lead-form input[type="tel"],
.lead-form textarea,
.lead-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  border-radius: 4px;
}
.lead-form input:focus,
.lead-form textarea:focus,
.lead-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.lead-form textarea {
  min-height: 80px;
  resize: vertical;
  font-family: var(--font-sans);
}
.lead-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.lead-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.lead-consent input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 2px;
}
.lead-consent label {
  display: inline;
  text-transform: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-muted);
  margin: 0;
}
.lead-consent a { color: var(--accent); }

.lead-status {
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.5;
}
.lead-status-loading { background: var(--surface-2); color: var(--text-muted); }
.lead-status-ok { background: rgba(63, 185, 80, 0.1); color: var(--green); border: 1px solid rgba(63, 185, 80, 0.3); }
.lead-status-warn { background: rgba(227, 179, 65, 0.1); color: var(--amber); border: 1px solid rgba(227, 179, 65, 0.3); }
.lead-status-err { background: rgba(248, 81, 73, 0.1); color: var(--red); border: 1px solid rgba(248, 81, 73, 0.3); }

.lead-fineprint {
  font-size: 10px;
  color: var(--text-dim);
  margin: 8px 0 0;
  line-height: 1.55;
}
.lead-fineprint a { color: var(--text-muted); }

/* ============================================================
   Contextual recommendations (shared by simulators)
   ============================================================ */
.rec-section { animation: stepFade 0.35s ease; }
@keyframes stepFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.rec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 6px;
}
@media (min-width: 720px) {
  .rec-grid { grid-template-columns: 1fr 1fr; }
}
.rec-card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.rec-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}
.rec-tool-flag {
  background:
    linear-gradient(135deg, rgba(255, 107, 53, 0.08), rgba(56, 212, 207, 0.04)),
    var(--bg-elevated);
  border-color: var(--accent-border);
}
.rec-aff {
  border-color: rgba(56, 212, 207, 0.3);
}
.rec-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.rec-tool-flag .rec-label { color: var(--accent); }
.rec-aff .rec-label { color: var(--cyan); }
.rec-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 6px;
}
.rec-tool-flag .rec-title { color: var(--accent); }
.rec-aff .rec-title { color: var(--cyan); }
.rec-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ============================================================
   Tip color tuning for dark theme
   ============================================================ */
.tip {
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

/* ============================================================
   Selection
   ============================================================ */
::selection {
  background: var(--accent);
  color: #0a0d12;
}

/* ============================================================
   Numbers helper class
   ============================================================ */
.num,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
