/* ============================================================
   EROSIONCALC — Premium Dark Design System
   Compound Inflation Erosion Calculator for Freelancers
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- Custom Properties --- */
:root {
  /* Backgrounds */
  --bg-body: #06060b;
  --bg-surface: #0c0c14;
  --bg-card: #101018;
  --bg-elevated: #16161f;
  --bg-input: #0e0e16;

  /* Accent */
  --accent: #00e5a0;
  --accent-dim: #00b87f;
  --accent-glow: rgba(0, 229, 160, 0.15);
  --accent-glow-strong: rgba(0, 229, 160, 0.3);
  --accent-gradient: linear-gradient(135deg, #00e5a0 0%, #00b4d8 100%);
  --accent-secondary: #6c5ce7;
  --accent-danger: #ff6b6b;
  --accent-warning: #ffd93d;

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #9898b0;
  --text-muted: #5a5a72;
  --text-accent: var(--accent);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(0, 229, 160, 0.3);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-bg-hover: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.06);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 0 30px rgba(0, 229, 160, 0.08);
  --shadow-accent-strong: 0 0 60px rgba(0, 229, 160, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-dim);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section--tight {
  padding: var(--space-3xl) 0;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(6, 6, 11, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-normal) var(--ease-out);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header__logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #06060b;
  font-weight: 800;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.header__nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-out);
  position: relative;
}

.header__nav a:hover,
.header__nav a.active {
  color: var(--text-primary);
}

.header__nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.header__menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
}

.header__close-btn {
  display: none;
}

/* --- Hero --- */
.hero {
  padding-top: calc(var(--header-height) + var(--space-4xl));
  padding-bottom: var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(0, 229, 160, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-weight: 500;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero__title-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

/* --- Calculator Card --- */
.calc {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg), var(--shadow-accent);
  position: relative;
  overflow: hidden;
}

.calc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent-gradient);
  opacity: 0.5;
}

.calc__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.calc__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.calc__desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.calc__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.calc__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.calc__group--full {
  grid-column: 1 / -1;
}

.calc__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calc__input,
.calc__select {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  width: 100%;
}

.calc__input:focus,
.calc__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.calc__input::placeholder {
  color: var(--text-muted);
}

.calc__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239898b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.calc__select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Range Slider */
.calc__range-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.calc__range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc__range-value {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
}

.calc__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.calc__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow-strong);
  transition: transform var(--duration-fast) var(--ease-spring);
}

.calc__range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.calc__range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px var(--accent-glow-strong);
}

/* Rate Type Toggle */
.calc__toggle-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calc__toggle-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.calc__toggle-btn.active {
  background: var(--accent);
  color: var(--bg-body);
  font-weight: 600;
}

.calc__toggle-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

/* Calculate Button */
.calc__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md) var(--space-xl);
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--bg-body);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-accent);
}

.calc__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent-strong);
}

.calc__btn:active {
  transform: translateY(0);
}

/* --- Results --- */
.results {
  display: none;
  margin-top: var(--space-2xl);
  animation: fadeInUp 0.5s var(--ease-out);
}

.results.visible {
  display: block;
}

.results__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.result-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.result-card:hover {
  border-color: var(--border-hover);
}

.result-card--danger {
  border-color: rgba(255, 107, 107, 0.2);
}

.result-card--danger:hover {
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.08);
}

.result-card--success {
  border-color: rgba(0, 229, 160, 0.2);
}

.result-card--success:hover {
  box-shadow: 0 0 20px rgba(0, 229, 160, 0.08);
}

.result-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.result-card__value {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
}

.result-card__value--danger {
  color: var(--accent-danger);
}

.result-card__value--success {
  color: var(--accent);
}

.result-card__value--warning {
  color: var(--accent-warning);
}

.result-card__sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* --- Chart --- */
.chart-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.chart-wrap__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.chart-wrap canvas {
  width: 100% !important;
  max-height: 320px;
}

/* --- Breakdown Table --- */
.breakdown {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.breakdown__title {
  padding: var(--space-lg);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.breakdown__table {
  width: 100%;
  border-collapse: collapse;
}

.breakdown__table th,
.breakdown__table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
}

.breakdown__table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.6875rem;
  background: var(--bg-card);
}

.breakdown__table td {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.breakdown__table tr:hover td {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.breakdown__table .loss {
  color: var(--accent-danger);
}

.breakdown__table .required {
  color: var(--accent);
}

/* --- Insight Box --- */
.insight-box {
  background: linear-gradient(135deg, rgba(0, 229, 160, 0.06), rgba(0, 180, 216, 0.04));
  border: 1px solid rgba(0, 229, 160, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-top: var(--space-2xl);
}

.insight-box__icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.insight-box__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--accent);
}

.insight-box__text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* --- Country Grid --- */
.countries-section {
  padding: var(--space-4xl) 0;
}

.countries-section__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.countries-section__desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.country-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.country-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.country-card__flag {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.country-card__flag img {
  display: block;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.country-card__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.country-card__name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-card__rate {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.country-card__rate .high {
  color: var(--accent-danger);
}

.country-card__rate .low {
  color: var(--accent);
}

/* --- How It Works --- */
.how-it-works {
  padding: var(--space-4xl) 0;
}

.how-it-works__title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2xl);
  letter-spacing: -0.02em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.step {
  text-align: center;
  padding: var(--space-xl);
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--bg-body);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
}

.step__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.step__desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --- FAQ --- */
.faq {
  padding: var(--space-4xl) 0;
}

.faq__title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.faq__list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.faq__item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq__question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: color var(--duration-fast) var(--ease-out);
}

.faq__question:hover {
  color: var(--accent);
}

.faq__icon {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.faq__item.open .faq__icon {
  transform: rotate(45deg);
}

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}

.faq__answer-inner {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3xl) 0 var(--space-2xl);
  background: var(--bg-surface);
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer__brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer__brand-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer__col-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer__links a:hover {
  color: var(--text-primary);
}

.footer__bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Legal Pages --- */
.legal {
  padding-top: calc(var(--header-height) + var(--space-3xl));
  padding-bottom: var(--space-4xl);
}

.legal__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.legal__updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-2xl);
}

.legal__content {
  max-width: 720px;
}

.legal__content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.legal__content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.legal__content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

.legal__content ul,
.legal__content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.legal__content ul {
  list-style: disc;
}

.legal__content ol {
  list-style: decimal;
}

.legal__content li {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.legal__content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Country Page Header --- */
.country-hero {
  padding-top: calc(var(--header-height) + var(--space-3xl));
  padding-bottom: var(--space-xl);
  text-align: center;
}

.country-hero__flag {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: center;
}

.country-hero__flag img {
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.country-hero__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.country-hero__subtitle {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.country-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.country-stat {
  text-align: center;
}

.country-stat__value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.country-stat__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Related Countries --- */
.related {
  padding: var(--space-3xl) 0;
}

.related__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  text-align: center;
}

/* --- Countries Region Page --- */
.countries-region {
  padding: var(--space-xl) 0;
}

.countries-region__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border-default);
  display: inline-block;
}

/* --- Ad Slots --- */
.ad-slot {
  max-width: var(--max-width);
  margin: var(--space-xl) auto;
  padding: 0 var(--space-lg);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot ins {
  width: 100%;
}

/* --- Contact Form --- */
.contact-form {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-form .calc__input,
.contact-form .calc__textarea {
  width: 100%;
}

.calc__textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  min-height: 150px;
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.calc__textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- 404 Page --- */
.error-page {
  padding-top: calc(var(--header-height) + var(--space-4xl));
  text-align: center;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-page__code {
  font-size: 8rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.error-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.error-page__desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in {
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .header__nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 6, 11, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    z-index: 999;
    animation: fadeIn 0.2s ease;
  }

  .header__nav.open {
    display: flex;
  }

  .header__nav a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
  }

  .header__nav a:hover,
  .header__nav a.active {
    color: var(--accent);
    background: var(--accent-glow);
  }

  .header__nav a.active::after {
    display: none;
  }

  .header__close-btn {
    display: flex;
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
  }

  .header__close-btn:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--accent-danger);
  }

  .header__menu-btn {
    display: flex;
  }

  .calc__grid {
    grid-template-columns: 1fr;
  }

  .results__cards {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .country-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .calc {
    padding: var(--space-lg);
  }

  .country-hero__flag img {
    width: 56px;
    height: 42px;
  }
}

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

  .hero__title {
    font-size: 1.75rem;
  }

  .footer__inner {
    grid-template-columns: 1fr;
  }

  .country-stats {
    gap: var(--space-md);
  }

  .header__nav a {
    font-size: 1.25rem;
  }

  .ad-slot {
    min-height: 50px;
  }
}
