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

:root {
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --c-bg: #f4f5f9;
  --c-surface: #ffffff;
  --c-surface2: #eef0f6;
  --c-border: #e2e5ef;
  --c-border-strong: #c8ccdb;

  --c-text: #0d1526;
  --c-text-muted: #5a6278;
  --c-text-faint: #9aa0b4;

  --c-green: #059669;
  --c-green-light: #ecfdf5;
  --c-amber: #d97706;
  --c-red: #dc2626;
  --c-red-light: #fef2f2;
  --c-purple: #7c3aed;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.2; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ── */
.nav {
  background: rgba(244,245,249,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800;
  color: var(--c-text);
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.02em;
}
.nav-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.nav-logo .accent { color: #818cf8; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  font-size: 13px; font-weight: 600;
  color: var(--c-text-muted); padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.nav-links a:hover { background: var(--c-surface2); color: var(--c-text); text-decoration: none; }

/* ── Hero ── */
.hero { padding: 80px 0 56px; text-align: center; position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #4f46e5;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 6px 16px; border-radius: 20px; margin-bottom: 24px;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #6366f1; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.hero h1 {
  font-size: clamp(36px, 5.5vw, 64px); font-weight: 900;
  letter-spacing: -0.04em; margin-bottom: 18px;
  line-height: 1.05;
}
.hero h1 .line1 { display: block; color: #0d1526; }
.hero h1 .line2 {
  display: block;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 17px; color: var(--c-text-muted); max-width: 500px; margin: 0 auto 36px; line-height: 1.7; }
.hero-pills { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero-pill {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--c-text-muted);
  background: var(--c-surface); border: 1px solid var(--c-border);
  padding: 7px 16px; border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.hero-pill svg { color: var(--c-green); flex-shrink: 0; }

/* ── Country Grid ── */
.country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px; padding: 48px 0 64px;
}
@media (max-width: 720px) { .country-grid { grid-template-columns: 1fr; } }

.country-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: block; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  border: 1px solid var(--c-border);
}
.country-card:hover { transform: translateY(-5px); text-decoration: none; }

.country-card-bg {
  padding: 32px;
  position: relative;
  min-height: 200px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.country-card.uk .country-card-bg { background: linear-gradient(135deg, #0a0e2e 0%, #1a0a1e 60%, #2d0a0a 100%); }
.country-card.us .country-card-bg { background: linear-gradient(135deg, #0d0d2b 0%, #1a0a14 60%, #2d0808 100%); }
.country-card.ca .country-card-bg { background: linear-gradient(135deg, #1a0808 0%, #2d0808 100%); }
.country-card.au .country-card-bg { background: linear-gradient(135deg, #030b1a 0%, #021206 100%); }

.country-card:hover.uk .country-card-bg { box-shadow: 0 20px 60px rgba(10,14,46,0.8); }
.country-card:hover.us .country-card-bg { box-shadow: 0 20px 60px rgba(45,8,8,0.8); }
.country-card:hover.ca .country-card-bg { box-shadow: 0 20px 60px rgba(45,8,8,0.8); }
.country-card:hover.au .country-card-bg { box-shadow: 0 20px 60px rgba(3,11,26,0.8); }

/* Glow orb background */
.country-card-bg::before {
  content: ''; position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%; filter: blur(60px);
  top: -40px; right: -40px; opacity: 0.5;
  pointer-events: none;
}
.country-card.uk .country-card-bg::before { background: #C8102E; }
.country-card.us .country-card-bg::before { background: #B22234; }
.country-card.ca .country-card-bg::before { background: #FF0000; }
.country-card.au .country-card-bg::before { background: #00843D; }

.country-card-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.country-flag-img { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.country-flag-img svg { width: 100%; height: 100%; display: block; }
.country-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 3px; }
.country-subtitle { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.country-desc { font-size: 14px; color: rgba(255,255,255,0.6); line-height: 1.6; margin-bottom: 24px; }
.country-footer { display: flex; align-items: center; justify-content: space-between; }
.country-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  padding: 9px 18px; border-radius: 10px;
  transition: opacity 0.15s;
}
.country-card.uk .country-cta-btn { background: rgba(200,16,46,0.25); color: #ff6b7a; border: 1px solid rgba(200,16,46,0.4); }
.country-card.us .country-cta-btn { background: rgba(60,59,110,0.4); color: #a5b4fc; border: 1px solid rgba(60,59,110,0.6); }
.country-card.ca .country-cta-btn { background: rgba(255,0,0,0.2); color: #fca5a5; border: 1px solid rgba(255,0,0,0.35); }
.country-card.au .country-cta-btn { background: rgba(0,132,61,0.25); color: #6ee7b7; border: 1px solid rgba(0,132,61,0.4); }
.country-cta-btn:hover { opacity: 0.85; }
.country-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.45);
}

/* ── Why section ── */
.why-section { padding: 0 0 80px; }
.why-section h2 { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.why-section p { color: var(--c-text-muted); font-size: 16px; max-width: 500px; margin-bottom: 28px; line-height: 1.6; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.why-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 24px; transition: border-color 0.15s; }
.why-card:hover { border-color: var(--c-border-strong); }
.why-icon { font-size: 28px; margin-bottom: 14px; }
.why-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.why-desc { font-size: 13px; color: var(--c-text-muted); line-height: 1.6; }

/* ── Calculator page ── */
.calc-page { padding: 28px 0 80px; }
.calc-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
@media (max-width: 880px) { .calc-grid { grid-template-columns: 1fr; } }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb-sep { color: var(--c-text-faint); }

/* ── Card ── */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 24px; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--c-border); color: var(--c-text); }

/* ── Calc hero ── */
.calc-hero {
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 18px;
  position: relative; overflow: hidden;
}
.calc-hero::before {
  content: ''; position: absolute; width: 160px; height: 160px;
  border-radius: 50%; filter: blur(50px); top: -40px; right: -20px; opacity: 0.5; pointer-events: none;
}
.calc-hero.uk { background: linear-gradient(135deg, #0a0e2e, #2d0a14); }
.calc-hero.uk::before { background: #C8102E; }
.calc-hero.us { background: linear-gradient(135deg, #0d0d2b, #2d0808); }
.calc-hero.us::before { background: #B22234; }
.calc-hero.ca { background: linear-gradient(135deg, #1a0505, #2d0a0a); }
.calc-hero.ca::before { background: #FF0000; }
.calc-hero.au { background: linear-gradient(135deg, #030b1a, #021206); }
.calc-hero.au::before { background: #00843D; }
.calc-hero-flag { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
.calc-hero-flag svg { width: 100%; height: 100%; display: block; }
.calc-hero-text h2 { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 2px; letter-spacing: -0.02em; }
.calc-hero-text p { font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Form ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--c-text-muted); margin-bottom: 7px; letter-spacing: 0.02em; text-transform: uppercase; }
.field input, .field select {
  width: 100%; padding: 11px 14px;
  background: #f8f9fc;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font-body);
  color: var(--c-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.field input::placeholder { color: #b0b7c8; }
.field input:focus, .field select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-prefix { position: relative; }
.input-prefix .prefix-sym { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--c-text-faint); font-size: 15px; font-weight: 600; pointer-events: none; }
.input-prefix input { padding-left: 30px; }

.calc-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; font-family: var(--font-display);
  cursor: pointer; transition: opacity 0.15s, transform 0.1s;
  margin-top: 8px; letter-spacing: -0.01em;
}
.calc-btn:hover { opacity: 0.88; }
.calc-btn:active { transform: scale(0.99); }

/* ── Results ── */
.results { display: none; margin-top: 20px; }
.results.visible { display: block; }

.result-hero {
  border-radius: var(--radius-lg);
  padding: 28px; color: white; margin-bottom: 20px; text-align: center;
  position: relative; overflow: hidden;
}
.result-hero.uk { background: linear-gradient(135deg, #0a0e2e 0%, #2d0a14 100%); }
.result-hero.us { background: linear-gradient(135deg, #0d0d2b 0%, #2d0808 100%); }
.result-hero.ca { background: linear-gradient(135deg, #1a0505 0%, #4d0000 100%); }
.result-hero.au { background: linear-gradient(135deg, #030b1a 0%, #021206 100%); }
.result-hero::before {
  content: ''; position: absolute; width: 200px; height: 200px;
  border-radius: 50%; filter: blur(60px); top: -60px; right: -40px; opacity: 0.4; pointer-events: none;
}
.result-hero.uk::before { background: #C8102E; }
.result-hero.us::before { background: #B22234; }
.result-hero.ca::before { background: #FF0000; }
.result-hero.au::before { background: #00843D; }
.result-hero-label { font-size: 11px; font-weight: 700; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.result-hero-amount { font-family: var(--font-display); font-size: 48px; font-weight: 900; letter-spacing: -0.04em; }
.result-hero-period { font-size: 13px; opacity: 0.55; margin-top: 8px; }

.result-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: var(--c-surface2); padding: 4px; border-radius: var(--radius-sm);
}
.result-tab {
  flex: 1; padding: 8px; text-align: center;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 6px; border: none; background: none;
  color: var(--c-text-muted); font-family: var(--font-body);
  transition: all 0.15s;
}
.result-tab.active { background: var(--c-surface); color: var(--c-text); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.breakdown-rows { display: none; }
.breakdown-rows.active { display: block; }
.breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--c-border); font-size: 14px; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-label { color: var(--c-text-muted); }
.breakdown-value { font-weight: 700; font-family: var(--font-display); letter-spacing: -0.01em; }
.breakdown-value.deduction { color: var(--c-red); }
.breakdown-value.takehome { color: var(--c-green); font-size: 17px; }
.breakdown-value.gross { color: var(--c-text); }

/* ── Rate bar ── */
.rate-bar-wrap { margin-top: 20px; }
.rate-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--c-text-muted); margin-bottom: 8px; font-weight: 500; }
.rate-bar-track { height: 10px; background: var(--c-surface2); border-radius: 5px; overflow: hidden; display: flex; }
.rate-bar-seg { height: 100%; transition: width 0.6s cubic-bezier(.4,0,.2,1); }
.rate-bar-seg.seg-tax { background: #ef4444; }
.rate-bar-seg.seg-ni  { background: #f59e0b; }
.rate-bar-seg.seg-other { background: #8b5cf6; }
.rate-bar-seg.seg-take { background: var(--c-green); }
.rate-bar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.rate-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--c-text-muted); font-weight: 500; }
.rate-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ── Bracket table ── */
.bracket-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.bracket-table th { text-align: left; padding: 8px 10px; background: var(--c-surface2); color: var(--c-text-faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.bracket-table th:last-child, .bracket-table td:last-child { text-align: right; }
.bracket-table td { padding: 10px 10px; border-bottom: 1px solid var(--c-border); color: var(--c-text-muted); }
.bracket-table tr:last-child td { border-bottom: none; }

/* ── Info box sidebar ── */
.info-box { background: var(--c-surface2); border-radius: var(--radius); padding: 16px 18px; margin-top: 14px; border: 1px solid var(--c-border); }
.info-box h4 { font-size: 12px; font-weight: 700; margin-bottom: 10px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.info-box p, .info-box li { font-size: 13px; color: var(--c-text-muted); line-height: 1.7; }
.info-box ul { padding-left: 16px; }
.info-box li { margin-bottom: 3px; }

/* ── Related ── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.related-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px; transition: border-color 0.15s, transform 0.15s; display: block; }
.related-card:hover { border-color: var(--c-border-strong); transform: translateY(-2px); text-decoration: none; }
.related-flag { width: 32px; height: 32px; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.related-flag svg { width: 100%; height: 100%; display: block; }
.related-card .name { font-size: 13px; font-weight: 600; color: var(--c-text); font-family: var(--font-display); }
.related-card .desc { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }

/* ── SEO content ── */
.seo-content { padding: 32px 0 0; }
.seo-content h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.seo-content h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 20px 0 8px; }
.seo-content p { font-size: 14px; color: var(--c-text-muted); margin-bottom: 12px; line-height: 1.7; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--c-border); padding: 36px 0; margin-top: 60px; background: #ffffff; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--c-text-muted); font-weight: 500; }
.footer-links a:hover { color: var(--c-text); text-decoration: none; }
.footer-copy { font-size: 13px; color: var(--c-text-faint); }
.disclaimer { font-size: 12px; color: var(--c-text-faint); text-align: center; padding: 16px 0 0; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 48px 0 36px; }
  .card { padding: 18px; }
  .result-hero-amount { font-size: 36px; }
  .field-row { grid-template-columns: 1fr; }
}

/* ── Nav flags & links (updated) ── */
.nav-link {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600;
  color: var(--c-text-muted); padding: 7px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--c-surface2); color: var(--c-text); text-decoration: none; }

.nav-flag {
  display: inline-block;
  width: 28px; height: 18px;
  border-radius: 4px; overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  line-height: 0;
}
.nav-flag svg { width: 100%; height: 100%; display: block; }

.nav-flag-lg {
  width: 36px; height: 23px;
  border-radius: 5px;
}

/* ── Hamburger ── */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 8px;
  background: none; border: 1.5px solid var(--c-border);
  border-radius: 8px; cursor: pointer;
}
.nav-hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--c-text-muted); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile drawer ── */
.nav-mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--c-border);
  padding: 8px 16px 16px;
  background: var(--c-surface);
}
.nav-mobile.open { display: flex; }

.nav-mobile-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 12px;
  font-size: 15px; font-weight: 600;
  color: var(--c-text);
  border-radius: 8px;
  transition: background 0.15s;
}
.nav-mobile-link:hover { background: var(--c-surface2); text-decoration: none; }
.nav-mobile-link + .nav-mobile-link { border-top: 1px solid var(--c-border); border-radius: 0; }
.nav-mobile-link + .nav-mobile-link:last-child { border-radius: 0 0 8px 8px; }

/* ── Responsive override ── */
@media (max-width: 740px) {
  .nav-links { display: none !important; }
  .nav-hamburger { display: flex; }
}

/* ── Real flag images (flagcdn.com) ── */
.nav-flag-img {
  width: 28px; height: 18px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  flex-shrink: 0;
  display: block;
}
.nav-flag-img-lg {
  width: 40px; height: 26px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  flex-shrink: 0;
  display: block;
}
.country-flag-real {
  width: 72px; height: auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.calc-hero-flag-img {
  width: 64px; height: auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  flex-shrink: 0;
}
