:root {
  --bg: #0C0F0A;
  --surface: #141710;
  --surface2: #1C2018;
  --border: #2A2E26;
  --border2: #363B30;
  --text: #EEF0E8;
  --text2: #9EA690;
  --text3: #5C6055;
  --accent: #B8F060;
  --accent2: #7DC422;
  --accent-dim: rgba(184,240,96,0.12);
  --accent-dim2: rgba(184,240,96,0.06);
  --red: #FF6B5B;
  --red-dim: rgba(255,107,91,0.12);
  --yellow: #FFD166;
  --yellow-dim: rgba(255,209,102,0.12);
  --blue: #74C7EC;
  --radius: 12px;
  --radius-lg: 20px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

nav {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 1;
}
.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  border: 1px solid var(--border2);
  padding: 5px 10px;
  border-radius: 100px;
}

.hero {
  padding: 80px 0 60px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(184,240,96,0.25);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 28px;
  animation: fadeUp 0.6s ease both;
}
.hero-eyebrow::before { content: '●'; font-size: 8px; }
.hero h1 {
  font-size: clamp(40px, 4vw, 58px);
  font-weight: 800;
  line-height: 1.1;
  max-width: 1000px;
  letter-spacing: -0.5px;
  margin: 0 auto 20px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  font-size: 18px;
  color: var(--text2);
  max-width: 520px;
  margin: 0 auto 48px;
  font-weight: 300;
  line-height: 1.7;
  animation: fadeUp 0.6s 0.2s ease both;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  animation: fadeUp 0.6s 0.3s ease both;
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), transparent);
}

.form-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 16px;
}

.city-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 28px;
}

.city-input-wrap { position: relative; }
.city-input-wrap input {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.city-input-wrap input:focus { border-color: var(--accent); }
.city-input-wrap input::placeholder { color: var(--text3); }

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}
.autocomplete-dropdown.open { display: block; }
.autocomplete-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--accent-dim);
  color: var(--text);
}
.autocomplete-item .city-country { color: var(--text3); font-size: 11px; }
.autocomplete-loading { padding: 12px 14px; color: var(--text3); font-size: 13px; }

.swap-btn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text2);
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.swap-btn:hover { border-color: var(--accent); color: var(--accent); transform: rotate(180deg); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.5px;
}
.field select, .field input[type="number"] {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
}
.field select:focus, .field input[type="number"]:focus { border-color: var(--accent); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: '↓';
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 12px;
  pointer-events: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.lifestyle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}
.lifestyle-btn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text2);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}
.lifestyle-btn .icon { font-size: 18px; }
.lifestyle-btn:hover { border-color: var(--border); color: var(--text); }
.lifestyle-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.calc-btn {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 15px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.calc-btn:hover { background: #CEFF7A; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(184,240,96,0.25); }
.calc-btn:active { transform: translateY(0); }
.calc-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.loading { display: none; text-align: center; padding: 48px 0; }
.loading-spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
.loading p { color: var(--text3); font-size: 13px; }

#results { display: none; margin-top: 40px; animation: fadeUp 0.5s ease both; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.verdict-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  letter-spacing: 0.5px;
}
.verdict-cheaper { background: var(--accent-dim); border: 1px solid rgba(184,240,96,0.3); color: var(--accent); }
.verdict-pricier { background: var(--red-dim); border: 1px solid rgba(255,107,91,0.3); color: var(--red); }
.verdict-similar { background: var(--yellow-dim); border: 1px solid rgba(255,209,102,0.3); color: var(--yellow); }

.cost-headline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.cost-headline::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(184,240,96,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.cost-city { text-align: center; }
.cost-city-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.cost-city-country { font-size: 11px; color: var(--text3); margin-bottom: 8px; }
.cost-amount {
  font-family: 'DM Sans', sans-serif;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}
.cost-amount.from { color: var(--text2); }
.cost-amount.to { color: var(--accent); }
.cost-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }
.cost-arrow-col { text-align: center; }
.cost-arrow { font-size: 24px; color: var(--text3); }
.diff-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.breakdown-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breakdown-header-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.breakdown-cols { display: flex; gap: 16px; }
.col-header { font-size: 11px; color: var(--text3); font-weight: 500; }
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.breakdown-row:last-child { border-bottom: none; }
.total-row { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border2) !important; }
.breakdown-row .item { color: var(--text2); }
.breakdown-row .values { display: flex; gap: 16px; font-weight: 500; }
.breakdown-row .from-val { color: var(--text3); }
.breakdown-row .to-val { color: var(--text); }
.breakdown-row .to-val.up { color: var(--red); }
.breakdown-row .to-val.down { color: var(--accent); }

.salary-insight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.insight-icon {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.insight-body { flex: 1; }
.insight-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.insight-text { font-size: 13px; color: var(--text2); line-height: 1.6; }
.insight-text strong { color: var(--accent); font-weight: 600; }
.insight-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text3);
  text-decoration: none;
  border-bottom: 1px solid var(--border2);
  transition: color 0.2s;
}
.insight-link:hover { color: var(--accent); border-color: var(--accent); }

.tax-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.tax-col {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.tax-col-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.tax-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}
.tax-row:last-child { border-bottom: none; }
.tax-row .tax-val { font-weight: 500; white-space: nowrap; }
.tax-row .tax-pct { font-size: 10px; color: var(--text3); margin-left: 3px; }
.tax-row-total { padding-top: 7px; margin-top: 3px; }
.tax-row-total .tax-val { color: var(--accent); font-weight: 600; }
.tax-disclaimer {
  font-size: 11px;
  color: var(--text3);
  margin-top: 10px;
  line-height: 1.5;
}

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

.qol-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.qol-pill {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.qol-pill .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--accent); }
.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }

.share-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.share-btn {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 20px;
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 120px;
  text-decoration: none;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

.error-card {
  background: var(--surface);
  border: 1px solid rgba(255,107,91,0.3);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.error-icon { font-size: 32px; margin-bottom: 12px; }
.error-title { font-family: 'DM Sans', sans-serif; font-weight: 700; margin-bottom: 8px; }
.error-text { color: var(--text2); font-size: 14px; }

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-note { font-size: 12px; color: var(--text3); }
.footer-note a { color: var(--text2); text-decoration: none; }
.footer-note a:hover { color: var(--accent); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .breakdown-grid { grid-template-columns: 1fr; }
  .city-row { grid-template-columns: 1fr; }
  .swap-btn { display: none; }
  .cost-headline { grid-template-columns: 1fr; text-align: center; }
  .cost-arrow { transform: rotate(90deg); }
  .hero h1 { letter-spacing: -1px; }
  .form-card { padding: 24px; }
  .share-row { flex-direction: column; }
}
