/* ============================================================================
   TaxComputer — design system
   ============================================================================ */

:root {
  --bg: #060b18;
  --bg-2: #0a1226;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #0e1730;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --muted: #93a0bd;
  --brand: #2f6bff;
  --brand-deep: #0635a1;
  --brand-soft: rgba(47, 107, 255, 0.16);
  --teal: #0e9aa7;
  --green: #34c77b;
  --red: #ff6b6b;
  --gold: #e8b64c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(2, 6, 18, 0.55);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ambient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(47, 107, 255, 0.20), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(14, 154, 167, 0.12), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(6, 53, 161, 0.18), transparent 60%),
    var(--bg);
}

::selection { background: rgba(47, 107, 255, 0.4); }

a { color: var(--brand); text-decoration: none; }
a:hover { color: #7ea2ff; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.02em; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------------- header / nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(6, 11, 24, 0.93);
  border-bottom: 1px solid var(--border);
}
.wrap { position: relative; }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 66px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand img { height: 34px; width: auto; display: block; }
.brand .brand-word { color: var(--text); }
.brand .brand-word em { font-style: normal; color: var(--brand); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links > a, .nav-dd > button {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: 9px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font);
  transition: color .15s, background .15s;
}
.nav-links > a:hover, .nav-dd > button:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-links > a.active { color: var(--text); background: var(--brand-soft); }

/* countries dropdown */
.nav-dd { position: relative; }
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 520px;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
}
.nav-dd.open .nav-dd-menu { display: grid; }
.nav-dd-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
}
.nav-dd-menu a:hover { background: rgba(255,255,255,0.07); }
.nav-dd-menu a .flag { font-size: 17px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 17px;
  cursor: pointer;
  margin-left: auto;
}

/* ---------------- hero ---------------- */
.hero { padding: 64px 0 10px; text-align: center; }
.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9db4ff;
  background: var(--brand-soft);
  border: 1px solid rgba(47, 107, 255, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
}
.hero h1 .grad {
  background: linear-gradient(92deg, #6f9bff 0%, #2f6bff 45%, #0e9aa7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--muted); font-size: 17.5px; max-width: 720px; margin: 0 auto 26px; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.hero-stats .stat span { color: var(--muted); font-size: 13px; }

/* ---------------- panels / cards ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.panel-pad { padding: 26px; }

.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; margin: 0; }
.section-head p { color: var(--muted); margin: 0; font-size: 14.5px; }

/* ---------------- controls ---------------- */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.select, .input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.select:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.25); }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393a0bd' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; cursor: pointer; }
.select option { background: var(--panel-solid); color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2f6bff, #0635a1);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, filter .12s;
  box-shadow: 0 8px 22px rgba(6, 53, 161, 0.45);
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* segmented control */
.seg { display: inline-flex; background: rgba(255,255,255,0.05); border: 1px solid var(--border-strong); border-radius: 11px; padding: 4px; gap: 3px; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; color: var(--muted); font-family: var(--font);
  font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--brand); color: #fff; }

/* country chip picker */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: #cfe0ff; }
.chip .flag { font-size: 15px; }

/* ---------------- chart ---------------- */
.chart-shell { position: relative; height: 520px; }
.chart-shell.tall { height: 560px; }

.fx-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}
.fx-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.fx-pill.live .dot { background: var(--green); box-shadow: 0 0 8px rgba(52,199,123,.8); }

/* ---------------- tables ---------------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th {
  text-align: left; padding: 12px 14px; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.035); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .rank { color: var(--muted); width: 34px; }
.tbl .cname { display: flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; }
.tbl .cname .flag { font-size: 17px; }

.bar-cell { min-width: 160px; }
.bar-track { height: 8px; background: rgba(255,255,255,0.07); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2f6bff, #0e9aa7); }

/* ---------------- country grid cards ---------------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }
.country-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: transform .15s, border .15s, box-shadow .15s;
}
.country-card:hover { transform: translateY(-3px); border-color: rgba(47,107,255,.5); box-shadow: var(--shadow); color: var(--text); }
.country-card .cc-top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.country-card .flag { font-size: 26px; }
.country-card h3 { margin: 0; font-size: 16.5px; }
.country-card .cc-cur { color: var(--muted); font-size: 12.5px; }
.country-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; min-height: 40px; }
.country-card .cc-etr { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); padding-top: 12px; }
.country-card .cc-etr b { font-size: 21px; font-weight: 800; }
.country-card .cc-etr span { color: var(--muted); font-size: 12px; }

/* ---------------- country profile ---------------- */
.profile-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 36px 0 8px; }
.profile-hero .flag { font-size: 58px; line-height: 1; }
.profile-hero h1 { font-size: clamp(30px, 4vw, 44px); margin: 0; }
.profile-hero .sub { color: var(--muted); font-size: 15px; }
.profile-hero .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge {
  font-size: 12px; font-weight: 600; color: #9db4ff;
  background: var(--brand-soft); border: 1px solid rgba(47,107,255,.35);
  padding: 4px 11px; border-radius: 999px;
}
.badge.neutral { color: var(--muted); background: rgba(255,255,255,.05); border-color: var(--border-strong); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 22px 0; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.stat-card .k { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.stat-card .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card .v small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* stacked composition bar */
.comp-bar { display: flex; height: 34px; border-radius: 9px; overflow: hidden; margin: 10px 0 18px; }
.comp-bar > div { height: 100%; transition: width .3s; }
.comp-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.comp-legend .li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.comp-legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.comp-legend b { color: var(--text); font-variant-numeric: tabular-nums; }

.notes-list { margin: 0; padding-left: 0; list-style: none; }
.notes-list li { position: relative; padding: 7px 0 7px 26px; color: #c6cfe4; font-size: 14.5px; border-bottom: 1px dashed var(--border); }
.notes-list li:last-child { border-bottom: 0; }
.notes-list li::before { content: '→'; position: absolute; left: 2px; color: var(--brand); }

/* ---------------- compare page ---------------- */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .cmp-grid { grid-template-columns: 1fr; } }

.cmp-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--panel); }
.cmp-card.win { border-color: rgba(52,199,123,.55); box-shadow: 0 0 0 1px rgba(52,199,123,.25), 0 14px 40px rgba(52,199,123,.08); }
.cmp-card .cc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cmp-card .cc-head .flag { font-size: 24px; }
.cmp-card h3 { margin: 0; font-size: 18px; }
.cmp-card .cc-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.cmp-rows { display: grid; gap: 9px; }
.cmp-row { display: flex; justify-content: space-between; font-size: 14.5px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .k { color: var(--muted); }
.cmp-row .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp-row.big .v { font-size: 20px; }
.cmp-row .v.good { color: var(--green); }
.cmp-row .v.bad { color: var(--red); }

.verdict {
  margin-top: 18px; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(47,107,255,.16), rgba(14,154,167,.10));
  border: 1px solid rgba(47,107,255,.4);
  font-size: 15.5px;
}
.verdict b { color: #9db4ff; }

.swap-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-strong);
  color: var(--text); cursor: pointer; font-size: 17px;
  transition: background .15s, transform .2s;
}
.swap-btn:hover { background: var(--brand-soft); transform: rotate(180deg); }

/* ---------------- footer ---------------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 70px; padding: 40px 0 30px; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-grid .fbrand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer-grid .fbrand img { height: 26px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-legal { color: var(--muted); font-size: 12.5px; margin-top: 26px; line-height: 1.7; }

/* ---------------- misc ---------------- */
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

.tooltip-caret { color: var(--muted); cursor: help; border-bottom: 1px dotted var(--muted); }

/* responsive nav */
@media (max-width: 860px) {
  .nav { flex-wrap: wrap; height: auto; padding: 12px 20px; gap: 10px; }
  .nav-toggle { display: block; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; margin: 6px 0 4px; }
  .nav-links.open { display: flex; }
  .nav-links > a, .nav-dd > button { width: 100%; text-align: left; padding: 11px 13px; }
  .nav-dd-menu { position: static; min-width: 0; grid-template-columns: 1fr 1fr; box-shadow: none; border: 1px solid var(--border); margin-top: 6px; }
  .nav-dd { width: 100%; }
  .chart-shell { height: 420px; }
  .hero { padding-top: 44px; }
}

@media (max-width: 560px) {
  .nav-dd-menu { grid-template-columns: 1fr; }
  .chart-shell { height: 340px; }
  .hero-stats { gap: 24px; }
}
