/* ============================================================
   Move-to-Thailand Cost Calculator — styles
   Mobile-first, self-contained (no CSS framework).
   ============================================================ */

:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --ink: #15201b;
  --ink-soft: #5a6b62;
  --line: #e4e8e3;
  --brand: #0e7c5a;       /* Thai-leaning emerald */
  --brand-dark: #0a5d43;
  --brand-soft: #e6f4ee;
  --accent: #e8a13a;      /* gold */
  --cash: #0e7c5a;
  --show: #2563a8;
  --danger: #b5483a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 27, .05), 0 8px 24px rgba(20, 32, 27, .06);

  /* category palette for the stacked bar / legend */
  --c-flights: #0e7c5a;
  --c-shipping: #2563a8;
  --c-baggage: #5aa9e6;
  --c-visa: #e8a13a;
  --c-housing: #b5483a;
  --c-setup: #8b5cb8;
  --c-pet: #d96b9a;
  --c-insurance: #14b8a6;
  --c-importvat: #8a93a8;
  --c-admin: #b07d3c;
  --c-education: #5a8f3c;
  --c-fx: #1c6e8c;
  --c-other: #6b7280;
  --c-contingency: #9aa6a0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.app { max-width: 1060px; margin: 0 auto; padding: 20px 16px 60px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 18px 4px 26px; }
.hero-badge {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(26px, 6vw, 42px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}
.hero h1 em { color: var(--brand); font-style: italic; }
.hero-sub {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(15px, 2.6vw, 18px);
}
.freshness {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 8px; }
@media (min-width: 880px) {
  .layout { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: start; }
  .form { position: sticky; top: 18px; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 0 0 16px; font-weight: 700; }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.field label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink);
}
.field-value { color: var(--brand); font-weight: 700; }

input[type="number"], input[type="email"], select, .fx-input input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6b62' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Range slider */
input[type="range"] { width: 100%; accent-color: var(--brand); height: 6px; cursor: pointer; }
.range-hint { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

/* Toggle */
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 14px; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  flex: 0 0 auto; width: 40px; height: 23px; border-radius: 999px;
  background: #d4dad6; position: relative; transition: background .18s;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-track { background: var(--brand); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(17px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--brand-soft); }
.toggle-label { font-size: 14px; font-weight: 500; }
.toggle-label small { color: var(--ink-soft); font-weight: 400; }

/* "Who's moving?" quick-preset chips — accelerators, not a mode switch */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

.fx-input { display: flex; align-items: center; gap: 8px; }
.fx-input input { max-width: 110px; }
.fx-unit { font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* ---------- Results ---------- */
.headline { text-align: center; padding: 6px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.headline-label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.headline-figure {
  font-size: clamp(30px, 7vw, 46px);
  font-weight: 800; letter-spacing: -.02em; color: var(--brand-dark); margin: 4px 0 2px;
}
.headline-thb { font-size: 13px; color: var(--ink-soft); font-weight: 500; }

/* Move Planner product CTA */
.product-cta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 2px solid var(--accent);
  background: #fffaf0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.product-cta-text { flex: 1; min-width: 180px; }
.product-cta-title { font-weight: 800; font-size: 15px; color: var(--ink); }
.product-cta-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.product-cta-btn {
  font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 10px;
}
.product-cta-btn:hover { filter: brightness(0.94); }

/* Stacked bar */
.stacked-bar {
  display: flex; width: 100%; height: 22px; border-radius: 7px; overflow: hidden;
  background: var(--line); margin-bottom: 12px;
}
.stacked-bar span { height: 100%; transition: width .25s ease; min-width: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 22px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

/* Line items */
.lineitems { list-style: none; margin: 0 0 22px; padding: 0; }
.lineitem {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.lineitem:last-child { border-bottom: none; }
.li-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.li-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.li-spacer { flex: 1; }
.li-range { font-weight: 700; font-size: 14px; white-space: nowrap; }
.li-range.zero { color: var(--ink-soft); font-weight: 500; }
.li-cta {
  font-size: 11px; font-weight: 700; text-decoration: none;
  background: var(--brand-soft); color: var(--brand-dark);
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.li-cta:hover { background: var(--brand); color: #fff; }
.li-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }

/* info tooltip */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--line); color: var(--ink-soft);
  font-size: 10px; font-weight: 800; font-style: normal; cursor: help;
  position: relative;
}
.info:hover::after, .info:focus::after {
  content: attr(data-tip);
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 220px;
  background: var(--ink); color: #fff; font-weight: 500; font-size: 11px; line-height: 1.4;
  padding: 7px 9px; border-radius: 8px; z-index: 10; text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

/* Highlight boxes */
.box { border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.box-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.box-figure { font-size: clamp(22px, 5vw, 30px); font-weight: 800; letter-spacing: -.01em; }
.box-note { font-size: 12.5px; margin-top: 6px; line-height: 1.45; }
.box-cash { background: var(--brand-soft); border: 1px solid #cbe7db; }
.box-cash .box-figure, .box-cash .box-title { color: var(--brand-dark); }
.box-cash .box-note { color: var(--brand-dark); opacity: .85; }
.box-show { background: #eaf1fa; border: 1px solid #cfe0f3; }
.box-show .box-figure, .box-show .box-title { color: var(--show); }
.box-show .box-note { color: #3a5b80; }

/* Notes */
.notes { margin: 4px 0 20px; }
.note-line {
  display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-soft);
  background: #fff7ed; border: 1px solid #f5e2c5; border-radius: 9px;
  padding: 9px 11px; margin-bottom: 8px; line-height: 1.45;
}
.note-line::before { content: "⚠️"; flex: 0 0 auto; }

/* Capture / monetization */
.capture {
  background: linear-gradient(135deg, #eef5f1, var(--brand-soft));
  border: 1px solid #d4e6dd; border-radius: 16px;
  padding: 20px; margin-bottom: 18px;
}
.capture-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.capture-icon { font-size: 22px; line-height: 1.1; flex: none; }
.capture-title { font-weight: 700; font-size: 16px; color: var(--ink); margin-bottom: 3px; }
.capture-sub { font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.45; }
.capture-note { font-size: 12px; color: var(--ink-soft); margin: 9px 0 0; }

/* Blend MailerLite's embedded form into our capture card + match brand.
   (!important is needed to beat MailerLite's own inline form styles.) */
.capture .ml-form-embedContainer,
.capture .ml-form-embedWrapper,
.capture .ml-form-embedBody,
.capture .ml-form-formContent {
  background: transparent !important; border: 0 !important;
  padding: 0 !important; margin: 0 !important; max-width: none !important; width: 100% !important;
}
.capture .ml-form-embedContent,
.capture .ml-form-embedContent h4,
.capture .ml-form-embedContent p { display: none !important; }
.capture .ml-form-fieldRow { margin: 0 0 8px !important; padding: 0 !important; }
.capture .ml-form-embedBody input[type="email"],
.capture .ml-form-fieldRow input {
  font-family: inherit !important; font-size: 15px !important; color: var(--ink) !important;
  padding: 12px 14px !important; border: 1px solid var(--line) !important;
  border-radius: 10px !important; background: #fff !important; box-shadow: none !important; width: 100% !important;
}
.capture .ml-form-embedBody input[type="email"]:focus {
  border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-soft) !important; outline: none !important;
}
.capture .ml-form-embedSubmit button,
.capture .ml-form-embedSubmit button.primary {
  font-family: inherit !important; font-weight: 700 !important; font-size: 15px !important;
  background: var(--brand) !important; color: #fff !important; border: 0 !important;
  border-radius: 10px !important; padding: 12px 20px !important; box-shadow: none !important;
  cursor: pointer !important; width: 100% !important; transition: background .15s !important;
}
.capture .ml-form-embedSubmit button:hover { background: var(--brand-dark) !important; }
.capture .ml-form-successBody {
  background: #fff !important; border: 1px solid #d4e6dd !important;
  border-radius: 10px !important; padding: 12px 14px !important;
}
.capture .ml-form-successContent h4,
.capture .ml-form-successContent p { color: var(--brand-dark) !important; }

.disclaimer { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

/* Footer */
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  margin-top: 26px; font-size: 12px; color: var(--ink-soft); padding: 0 4px;
}
.foot a { color: var(--brand-dark); font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (max-width: 420px) {
  .field-row { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .panel { padding: 16px; }
}
