*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #eff6ff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

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

/* ── Header ─────────────────────────────── */
header {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  padding: 22px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}

.logo svg {
  opacity: 0.95;
  flex-shrink: 0;
}

.tagline {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.875rem;
  margin-top: 3px;
}

/* ── Site nav ────────────────────────────── */
.site-nav {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* ── Content pages ───────────────────────── */
.content-hero {
  padding: 40px 0 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.content-hero h1 {
  max-width: 700px;
}

.content-hero .intro {
  max-width: 640px;
  margin-bottom: 0;
}

.content-layout {
  max-width: 740px;
}

.content-layout h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-top: 44px;
  margin-bottom: 12px;
  display: block;
  color: var(--text);
}

.content-layout h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.content-layout p {
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.75;
}

.content-layout ul,
.content-layout ol {
  color: var(--muted);
  padding-left: 20px;
  margin-bottom: 16px;
  line-height: 1.75;
}

.content-layout li {
  margin-bottom: 5px;
}

.content-layout strong {
  color: var(--text);
}

.content-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.content-table th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.content-table td {
  padding: 11px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.content-table tbody tr:last-child td {
  border-bottom: none;
}

.content-table tbody tr:hover td {
  background: var(--accent-light);
}

.rate-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.rate-category h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--text);
}

.rate-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.rate-badges span {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}

.badge-junior  { background: #fef3c7; color: #92400e; }
.badge-mid     { background: #dbeafe; color: #1e40af; }
.badge-senior  { background: #d1fae5; color: #065f46; }

.rate-category p {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.step-card {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  align-items: flex-start;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

.step-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 6px;
  color: var(--text);
}

.step-card p {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.mistake-card {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.mistake-num {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 4px;
}

.mistake-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text);
}

.mistake-card p {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.mistake-card .fix {
  margin-top: 8px;
  font-size: 0.835rem;
  background: var(--accent-light);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--accent-dark);
}

.formula-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
}

.formula-box .result {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
  font-weight: 700;
  color: var(--accent);
}

.cta-card {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
  margin-top: 52px;
  margin-bottom: 56px;
}

.cta-card h2 {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 8px;
  display: block;
}

.cta-card p {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 20px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.cta-btn {
  display: inline-block;
  background: white;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ── Main ────────────────────────────────── */
main {
  padding: 48px 0 64px;
}

/* ── Calculator section ──────────────────── */
.calculator-section {
  margin-bottom: 56px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.intro {
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 32px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 660px) {
  .calculator-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.results-card {
  border-left: 4px solid var(--accent);
}

/* ── h2 with icon ────────────────────────── */
h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.h2-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent-light);
  border-radius: 6px;
  color: var(--accent);
  flex-shrink: 0;
}

.h2-icon.accent {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Form elements ───────────────────────── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text);
}

label svg {
  color: var(--muted);
  flex-shrink: 0;
}

.label-sub {
  color: var(--muted);
  font-weight: 400;
}

input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper input {
  border: none;
  border-radius: 0;
  flex: 1;
  background: transparent;
  min-width: 0;
  box-shadow: none !important;
}

.input-wrapper input:focus {
  background: transparent;
}

.prefix,
.suffix {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--border);
  white-space: nowrap;
  display: flex;
  align-items: center;
  user-select: none;
}

.hint {
  font-size: 0.775rem;
  color: var(--muted);
  margin-top: 4px;
  display: block;
  line-height: 1.4;
}

/* ── Results card ────────────────────────── */
.rate-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.rate-value {
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -2px;
  line-height: 1;
  transition: color 0.2s;
}

.rate-label {
  font-size: 1.1rem;
  color: var(--muted);
}

.breakdown {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-bottom: 20px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  padding: 5px 0;
  color: var(--muted);
  gap: 12px;
}

.breakdown-row span:last-child {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.recommendation {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.recommendation h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--accent);
  margin-bottom: 6px;
}

.recommended-rate {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 5px;
}

.rec-note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Market position indicator ───────────── */
.market-position {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.mp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.mp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.mp-badge[data-level="below"]   { background: #fee2e2; color: #991b1b; }
.mp-badge[data-level="entry"]   { background: #fef3c7; color: #92400e; }
.mp-badge[data-level="mid"]     { background: #dbeafe; color: #1e40af; }
.mp-badge[data-level="senior"]  { background: #d1fae5; color: #065f46; }
.mp-badge[data-level="premium"] { background: #ede9fe; color: #5b21b6; }

.mp-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.mp-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #fbbf24 0%, #2563eb 38%, #059669 68%, #7c3aed 100%);
  position: relative;
  margin-bottom: 6px;
}

.mp-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: white;
  border: 3px solid var(--text);
  border-radius: 50%;
  transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.mp-track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Ad slots ────────────────────────────── */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 56px;
  background: var(--surface);
}

.ad-slot--horizontal {
  height: 90px;
}

.ad-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
  opacity: 0.5;
}

/* ── Market section ──────────────────────── */
.market-section {
  margin-bottom: 56px;
}

.market-section > h2,
.faq-section > h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.market-section > p {
  color: var(--muted);
  margin-bottom: 24px;
}

.filters {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
}

.filter-group label {
  font-size: 0.85rem;
  display: block;
}

select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.rates-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.rates-table th {
  background: var(--bg);
  padding: 11px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.rates-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.rates-table tbody tr:last-child td {
  border-bottom: none;
}

.rates-table tbody tr:hover td {
  background: var(--accent-light);
}

.rate-range {
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent-dark);
}

.source-tag {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.data-note {
  font-size: 0.775rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ── FAQ section ─────────────────────────── */
.faq-section {
  margin-bottom: 20px;
}

.faq-section > h2 {
  margin-bottom: 24px;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 660px) {
  .faq-grid { grid-template-columns: 1fr; }
}

.faq-item {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  align-items: flex-start;
}

.faq-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--accent-light);
  border-radius: 8px;
  color: var(--accent);
}

.faq-item h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1.3;
}

.faq-item p {
  font-size: 0.855rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}

footer p {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-note {
  font-size: 0.775rem;
  margin-top: 4px;
}
