:root {
  --emerald-950: #052420;
  --emerald-900: #0B3B36;
  --emerald-800: #0F4F48;
  --emerald-700: #14675D;
  --gold: #E3B23C;
  --gold-light: #F3D27F;
  --paper: #F7F8F4;
  --ink: #0E1B18;
  --ink-soft: #5A6B67;
  --line: rgba(11, 59, 54, .12);
  --up-green: #2FAE72;

  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity .35s ease;
}
body.is-loaded { opacity: 1; }
body.is-leaving { opacity: 0; transition: opacity .18s ease; }

@media (prefers-reduced-motion: reduce) {
  body { transition: none; opacity: 1; }
  html { scroll-behavior: auto; }
}

/* ---------- Floating background currency symbols ---------- */
.bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.coin {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--emerald-900);
  opacity: .05;
  animation: float 14s ease-in-out infinite;
}
.coin-1 { font-size: 140px; top: 4%;  left: 6%;  animation-delay: 0s; }
.coin-2 { font-size: 100px; top: 60%; left: 2%;  animation-delay: 2s; }
.coin-3 { font-size: 160px; top: 20%; right: 4%; animation-delay: 4s; }
.coin-4 { font-size: 90px;  top: 78%; right: 10%; animation-delay: 1s; }
.coin-5 { font-size: 110px; top: 42%; left: 46%;  animation-delay: 3s; }
.coin-6 { font-size: 80px;  top: 8%;  left: 60%;  animation-delay: 5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-22px) rotate(6deg); }
}
@media (prefers-reduced-motion: reduce) { .coin { animation: none; } }

/* ---------- Header / Logo ---------- */
.page-header {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 20px 24px 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.site-logo {
  height: auto;
  width: clamp(130px, 14vw, 221px);
  max-width: 75%;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* ---------- Layout ---------- */
.wrap { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; padding: 10px 20px 60px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 20px 0 40px; opacity: 0; transform: translateY(14px); animation: heroIn .6s ease .1s forwards; }
@keyframes heroIn { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .hero { animation: none; opacity: 1; transform: none; } }

.flag-line { font-size: 17px; font-weight: 600; color: var(--emerald-800); margin: 0 0 14px; }
.flag-line .arrow { color: var(--gold); margin: 0 6px; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 4.6vw, 44px);
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--emerald-950);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Country selector — all destinations shown side by side, selected one boxed */
.country-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 18px;
}
.country-tab {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(14px, 1.9vw, 17px);
  color: var(--emerald-800);
  text-decoration: none;
  padding: 8px 18px;
  border: 2px solid transparent;
  border-radius: 9px;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.country-tab:hover {
  background: rgba(227, 178, 60, .14);
  color: var(--gold);
  transform: translateY(-1px);
}
.country-tab.active {
  border-color: var(--emerald-900);
  background: var(--emerald-900);
  color: var(--paper);
  cursor: default;
}
.country-tab.active:hover { transform: none; background: var(--emerald-900); color: var(--paper); }

.disclaimer {
  font-size: 13.5px;
  color: var(--ink-soft);
  background: rgba(227, 178, 60, .12);
  border: 1px solid rgba(227, 178, 60, .35);
  display: inline-block;
  padding: 8px 16px;
  border-radius: 30px;
  margin: 0 0 30px;
}

.live-rate-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  color: var(--paper);
  padding: 18px 32px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(11, 59, 54, .28);
  flex-wrap: wrap;
  justify-content: center;
}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--up-green);
  animation: pulse-dot 1.8s ease-out infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(47, 174, 114, .6); }
  70%  { box-shadow: 0 0 0 10px rgba(47, 174, 114, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 174, 114, 0); }
}
.live-label { font-size: 14px; font-weight: 500; opacity: .85; }
.live-value {
  font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--gold-light);
  transition: opacity .25s ease;
}
.live-sub { font-size: 12.5px; opacity: .65; }
.sync-note { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Calculator ---------- */
.calculator {
  max-width: 460px;
  margin: 44px auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px rgba(11, 59, 54, .06);
  opacity: 0;
  transform: translateY(12px);
  animation: heroIn .6s ease .2s forwards;
}
@media (prefers-reduced-motion: reduce) { .calculator { animation: none; opacity: 1; transform: none; } }

.calc-row { display: flex; align-items: center; gap: 12px; }
.calc-input-wrap { flex: 1; text-align: left; }
.calc-input-wrap label {
  display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px;
}
.calc-input {
  width: 100%;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--emerald-950);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.calc-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227,178,60,.15); }

.calc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 30px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--emerald-900);
  transition: background .2s ease, transform .2s ease;
  white-space: nowrap;
  margin-top: 18px;
}
.calc-toggle:hover { background: rgba(227,178,60,.12); }
.calc-toggle .swap-icon { display: inline-block; transition: transform .3s ease; }
.calc-toggle.flipped .swap-icon { transform: rotate(180deg); }

/* ---------- Table ---------- */
.table-section { opacity: 0; transform: translateY(14px); animation: heroIn .6s ease .3s forwards; }
@media (prefers-reduced-motion: reduce) { .table-section { animation: none; opacity: 1; transform: none; } }

.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  overflow-x: auto;
  box-shadow: 0 10px 34px rgba(11, 59, 54, .06);
}

.table-head-row,
.rate-row {
  display: grid;
  /* minmax(0, ...) lets tracks shrink below their content's natural width —
     without this, long center names + amounts can force the whole grid to
     overflow its container and get clipped by the page's overflow-x:hidden. */
  grid-template-columns: 40px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(110px, 150px);
  gap: 10px;
  align-items: center;
  min-width: 560px;
  transition: grid-template-columns .3s ease;
}
.table-card.has-calc .table-head-row,
.table-card.has-calc .rate-row {
  grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, .9fr) minmax(110px, 150px);
  min-width: 660px;
}

.table-head-row {
  padding: 16px 22px;
  background: var(--emerald-950);
  color: rgba(247,248,244,.75);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rates-list { display: flex; flex-direction: column; }

.rate-row {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: rowIn .5s ease forwards;
}
.rate-row:last-child { border-bottom: none; }
.rate-row:hover { background: rgba(11, 59, 54, .03); }
@keyframes rowIn { to { opacity: 1; transform: translateY(0); } }

.rank-badge {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  background: var(--emerald-900); color: var(--paper);
}
.rank-badge.top1 { background: linear-gradient(135deg, #F3D27F, #C89B3C); color: var(--emerald-950); }
.rank-badge.top2 { background: linear-gradient(135deg, #DADFDA, #B9C2BD); color: var(--emerald-950); }
.rank-badge.top3 { background: linear-gradient(135deg, #D9A36B, #B57A44); color: var(--emerald-950); }

.center-name {
  font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--emerald-950);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.updated-at { font-size: 13.5px; color: var(--ink-soft); }
.rate-value { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--emerald-800); }

.calc-col-head { display: none; }
.table-card.has-calc .calc-col-head { display: block; }

.calc-value {
  display: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-6px);
}
.table-card.has-calc .calc-value {
  display: block;
  animation: calcIn .35s ease forwards;
}
@keyframes calcIn { to { opacity: 1; transform: translateX(0); } }

.update-btn {
  justify-self: end;
  font-family: var(--font-body); font-weight: 600; font-size: 12.5px;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--emerald-900);
  color: var(--emerald-900);
  background: transparent;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.update-btn:hover { background: var(--emerald-900); color: var(--paper); transform: translateY(-1px); }

.loading-row, .empty-state {
  padding: 40px 22px; text-align: center; color: var(--ink-soft); font-size: 14.5px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--line);
  border-top-color: var(--emerald-800); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.refresh-note { text-align: center; font-size: 12px; color: var(--ink-soft); margin-top: 16px; }

/* ---------- FAQ section ---------- */
.faq-section {
  max-width: 720px;
  margin: 50px auto 0;
  padding: 0 4px;
}
.faq-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--emerald-950);
  margin: 0 0 20px;
  text-align: center;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 12px;
}
.faq-item h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  color: var(--emerald-800);
  margin: 0 0 8px;
}
.faq-item p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Footer ---------- */
.page-footer {
  position: relative; z-index: 2; text-align: center; padding: 26px 20px 40px;
  font-size: 12.5px; color: var(--ink-soft); max-width: 640px; margin: 0 auto;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 36, 32, .55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  position: relative; background: #fff; border-radius: 18px; padding: 34px 30px 28px;
  max-width: 400px; width: 100%;
  box-shadow: 0 30px 70px rgba(5, 36, 32, .35);
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute; top: 14px; right: 16px; width: 30px; height: 30px;
  border: none; background: transparent; font-size: 22px; line-height: 1;
  color: var(--ink-soft); cursor: pointer;
}
.modal-close:hover { color: var(--emerald-950); }
.modal-title {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--emerald-950); line-height: 1.4; margin: 0 0 20px; padding-right: 20px;
}
.modal-title #modalCenterName { color: var(--gold); }
.modal-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.modal-input {
  width: 100%; font-family: var(--font-display); font-size: 20px; font-weight: 700;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  color: var(--emerald-950); transition: border-color .2s ease, box-shadow .2s ease;
}
.modal-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227,178,60,.15); }
.modal-error { color: #C0453A; font-size: 12.5px; margin: 8px 0 0; }
.modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.btn {
  flex: 1; font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
  padding: 12px 16px; border-radius: 9px; cursor: pointer; border: none;
  transition: transform .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-cancel { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn-submit { background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700)); color: var(--paper); }
.modal-status { margin: 16px 0 0; font-size: 13.5px; text-align: center; min-height: 18px; }
.modal-status.success { color: var(--up-green); }
.modal-status.error { color: #C0453A; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .table-head-row { display: none; }

  .table-head-row, .rate-row,
  .table-card.has-calc .table-head-row,
  .table-card.has-calc .rate-row { grid-template-columns: 1fr; min-width: 0; }

  .table-card { overflow-x: hidden; }
  .center-name { white-space: normal; }

  .rate-row { gap: 8px; padding: 18px; position: relative; }
  .rank-badge { position: absolute; top: 18px; right: 18px; }
  .center-name { font-size: 16px; padding-right: 40px; }
  .updated-at::before { content: "Updated: "; opacity: .7; }
  .rate-value { font-size: 22px; }
  .calc-value::before { content: "→ "; opacity: .7; }
  .calc-value { font-size: 18px; margin-top: 2px; }
  .update-btn { justify-self: stretch; text-align: center; margin-top: 6px; }

  .live-rate-card { padding: 16px 22px; }
  .live-value { font-size: 24px; }

  .calc-row { flex-wrap: wrap; }
  .calc-toggle { margin-top: 0; width: 100%; justify-content: center; }
}

/* ============================================================
   Content pages (About, Guide, Legal, Contact) + footer links
   ============================================================ */

/* If JavaScript is disabled, don't leave the page invisible */
@media (scripting: none) {
  body { opacity: 1; }
}

.logo-link { display: block; line-height: 0; }

.content-page {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin: 0 auto;
  padding: 18px 20px 60px;
}
.back-link {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--emerald-800);
  text-decoration: none;
  margin-bottom: 14px;
  transition: color .2s ease;
}
.back-link:hover { color: var(--gold); }

.content-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 10px 34px rgba(11, 59, 54, .06);
}
.content-card h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  color: var(--emerald-950);
  margin: 0 0 8px;
}
.content-card .page-meta { font-size: 13px; color: var(--ink-soft); margin: 0 0 24px; }
.content-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--emerald-900);
  margin: 30px 0 10px;
}
.content-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--emerald-800);
  margin: 20px 0 6px;
}
.content-card p, .content-card li { font-size: 15.5px; line-height: 1.75; color: var(--ink); }
.content-card p { margin: 0 0 14px; }
.content-card ul, .content-card ol { padding-left: 22px; margin: 0 0 16px; }
.content-card li { margin-bottom: 6px; }
.content-card a { color: var(--emerald-700); text-decoration: underline; text-underline-offset: 2px; }
.content-card a:hover { color: var(--gold); }
.content-card .callout {
  background: rgba(227, 178, 60, .12);
  border: 1px solid rgba(227, 178, 60, .35);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 18px 0;
}
.content-card .callout p { margin: 0; font-size: 14.5px; }

/* Footer link row */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 0 0 16px;
}
.footer-links a {
  color: var(--emerald-800);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: color .2s ease;
}
.footer-links a:hover { color: var(--gold); }
.page-footer .copyright { margin-top: 10px; opacity: .8; }

/* Feedback / contact form */
.feedback-form { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.ff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ff-field { display: flex; flex-direction: column; gap: 7px; }
.ff-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.ff-field input,
.ff-field select,
.ff-field textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.ff-field textarea { resize: vertical; min-height: 130px; }
.ff-field input:focus,
.ff-field select:focus,
.ff-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(227, 178, 60, .15);
}
.ff-field .captcha-input { max-width: 140px; }
.feedback-form .hp-check { display: none !important; }
.feedback-form .btn-submit { flex: none; align-self: flex-start; padding: 13px 30px; }
.ff-status { margin: 0; min-height: 20px; font-size: 14px; }
.ff-status.success { color: #1E8A55; }
.ff-status.error { color: #C0453A; }

@media (max-width: 560px) {
  .ff-row { grid-template-columns: 1fr; }
}
