:root {
  --navy-950: #101d3f;
  --navy-900: #17264d;
  --navy-800: #243860;
  --navy-100: #e9edf5;
  --orange-600: #e94727;
  --orange-500: #f26522;
  --orange-100: #fff0e9;
  --cream-50: #fffdf9;
  --cream-100: #fff8ef;
  --cream-200: #f5ebdc;
  --ink: #18213a;
  --muted: #667085;
  --line: #dfe3ea;
  --white: #ffffff;
  --success: #17745a;
  --danger: #b42318;
  --shadow-sm: 0 1px 2px rgba(16, 29, 63, .06), 0 4px 14px rgba(16, 29, 63, .04);
  --shadow-lg: 0 22px 55px rgba(16, 29, 63, .12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --header-height: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(242, 101, 34, .08), transparent 25rem),
    radial-gradient(circle at 95% 45%, rgba(28, 45, 90, .08), transparent 28rem),
    var(--cream-50);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy-950);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(16, 29, 63, .08);
  background: rgba(255, 253, 249, .92);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: var(--header-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-cluster { display: flex; align-items: center; gap: 18px; min-width: 0; }
.partner-logo { display: block; width: auto; object-fit: contain; }
.partner-logo--danantara { height: 29px; max-width: 190px; }
.partner-logo--posind { height: 34px; max-width: 130px; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.location-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--navy-800);
  font-size: .84rem;
  font-weight: 700;
}
.location-chip svg { width: 17px; height: 17px; color: var(--orange-600); }
.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.language-button {
  min-width: 42px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  font-size: .78rem;
  cursor: pointer;
}
.language-button:hover { color: var(--navy-950); background: var(--cream-100); }
.language-button.is-active { color: var(--white); background: var(--navy-900); }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 28px;
  flex: 1;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}
.intro-copy { max-width: 760px; }
.eyebrow {
  margin: 0 0 9px;
  color: var(--orange-600);
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .14em;
}
h1 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.intro-text {
  max-width: 680px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.14rem);
  line-height: 1.65;
}
.mailon-logo {
  width: clamp(145px, 18vw, 205px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(16, 29, 63, .09));
}

.calculator-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  overflow: visible;
  border: 1px solid rgba(16, 29, 63, .09);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}
.calculator-form { padding: 34px; min-width: 0; }
.result-panel {
  min-width: 0;
  padding: 34px;
  border-left: 1px solid var(--line);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background:
    linear-gradient(135deg, rgba(242, 101, 34, .07), transparent 45%),
    var(--cream-100);
}
.section-heading { display: flex; align-items: flex-start; gap: 13px; }
.section-heading h2 { margin: 0; color: var(--navy-950); font-size: 1.14rem; letter-spacing: -.015em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.step-number {
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--white);
  background: var(--navy-900);
  font-size: .78rem;
  font-weight: 850;
}

.route-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) 32px minmax(0, 1.2fr);
  align-items: start;
  gap: 12px;
  margin-top: 27px;
}
.field-group { min-width: 0; }
.field-group label { display: block; margin-bottom: 8px; color: var(--navy-800); font-size: .78rem; font-weight: 800; }
.fixed-field, .combobox-wrap { position: relative; }
.fixed-field svg, .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  color: var(--orange-600);
  pointer-events: none;
}
.fixed-field input, .combobox-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 0 47px 0 43px;
  border: 1px solid #cfd5df;
  border-radius: var(--radius-sm);
  color: var(--navy-950);
  background: var(--white);
  outline: none;
  font-size: .94rem;
  font-weight: 650;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.fixed-field input { padding-right: 14px; background: #f8fafc; color: var(--navy-800); }
.combobox-wrap input::placeholder { color: #8a94a6; font-weight: 500; }
.combobox-wrap input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.combobox-wrap input[type="search"] { appearance: none; -webkit-appearance: none; }
.combobox-wrap input:hover:not(:disabled) { border-color: #9ca6b6; }
.combobox-wrap input:focus { border-color: var(--orange-500); box-shadow: 0 0 0 4px rgba(242, 101, 34, .13); }
.combobox-wrap input:disabled { cursor: progress; color: #98a2b3; background: #f5f6f8; }
.clear-search {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.clear-search:hover { color: var(--navy-950); background: var(--cream-100); }
.clear-search svg { width: 18px; height: 18px; }
.loading-spinner {
  position: absolute;
  right: 16px;
  top: 17px;
  width: 18px;
  height: 18px;
  border: 2px solid #d5dae2;
  border-top-color: var(--orange-500);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.route-arrow { display: grid; place-items: center; padding-top: 34px; color: #98a2b3; }
.route-arrow svg { width: 23px; height: 23px; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }

.options-panel {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 18px 42px rgba(16, 29, 63, .18);
}
.destination-group { position: relative; }
.options-status { padding: 10px 14px; border-bottom: 1px solid #eef0f4; color: var(--muted); background: #fafbfc; font-size: .73rem; font-weight: 700; }
.destination-options { max-height: 300px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.destination-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.destination-option:hover, .destination-option.is-active { background: var(--orange-100); }
.destination-option.is-active { outline: 2px solid rgba(242, 101, 34, .18); }
.option-main { min-width: 0; }
.option-name { display: block; overflow: hidden; color: var(--navy-950); font-size: .9rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.option-meta { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.option-badge { padding: 5px 8px; border-radius: 999px; color: var(--navy-800); background: var(--navy-100); font-size: .67rem; font-weight: 800; }
.option-badge--international { color: #a13c22; background: var(--orange-100); }
.no-results { padding: 25px 16px; text-align: center; color: var(--muted); font-size: .86rem; }

.data-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; color: var(--muted); font-size: .76rem; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #f4b740; box-shadow: 0 0 0 4px rgba(244, 183, 64, .14); }
.data-status.is-ready .status-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(23, 116, 90, .12); }
.data-status.is-error { color: var(--danger); }
.data-status.is-error .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 24, .12); }

.result-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.result-type-badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: var(--navy-800); background: var(--navy-100); font-size: .67rem; font-weight: 850; }
.result-type-badge.is-international { color: #a13c22; background: var(--orange-100); }
.empty-state { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; text-align: center; }
.empty-illustration {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  color: var(--orange-500);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.empty-illustration svg { width: 48px; height: 48px; stroke-width: 1.4; }
.empty-state h3 { margin: 20px 0 7px; color: var(--navy-950); font-size: 1.06rem; }
.empty-state p { max-width: 280px; margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.result-content { padding-top: 34px; animation: reveal .25s ease both; }
.tariff-kicker { margin: 0; color: var(--orange-600); font-size: .69rem; font-weight: 900; letter-spacing: .14em; }
.tariff-value { margin: 6px 0 3px; color: var(--navy-950); font-size: clamp(2.55rem, 5vw, 4.1rem); font-weight: 880; letter-spacing: -.055em; line-height: 1; }
.route-summary { margin: 10px 0 24px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.result-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.result-details div { min-width: 0; padding: 12px 13px; background: rgba(255, 255, 255, .72); }
.result-details dt { color: var(--muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.result-details dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--navy-950); font-size: .85rem; font-weight: 750; }
.result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 17px; }
.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button svg { width: 17px; height: 17px; }
.button--primary { color: var(--white); background: var(--navy-900); box-shadow: 0 7px 15px rgba(23, 38, 77, .16); }
.button--primary:hover { background: var(--navy-950); }
.button--secondary { color: var(--white); background: var(--orange-500); box-shadow: 0 7px 15px rgba(242, 101, 34, .17); }
.button--secondary:hover { background: var(--orange-600); }
.button--ghost { color: var(--navy-800); border-color: #ccd3de; background: rgba(255,255,255,.74); }
.button--ghost:hover { border-color: #98a2b3; background: var(--white); }

.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.trust-item { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 14px 16px; border: 1px solid rgba(16,29,63,.08); border-radius: 14px; background: rgba(255,255,255,.68); }
.trust-item svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--orange-500); }
.trust-item div { min-width: 0; }
.trust-item strong, .trust-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trust-item strong { color: var(--navy-950); font-size: .78rem; }
.trust-item span { margin-top: 2px; color: var(--muted); font-size: .71rem; }
.disclaimer { max-width: 900px; margin: 19px auto 0; color: #7d8798; font-size: .7rem; line-height: 1.55; text-align: center; }

.dashboard-footer {
  width: 100%;
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 24px;
  border-top: 3px solid var(--orange-500);
  color: #e2e8f0;
  background: #0f172a;
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; color: #f8fafc; font-size: .88rem; font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.footer-brand svg { width: 18px; height: 18px; color: var(--orange-500); }
.footer-brand:hover, .footer-brand:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-desc { margin: 0; color: #94a3b8; font-size: .73rem; text-align: center; }
.footer-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.footer-reset { padding: 4px 8px; border: 0; border-radius: 7px; color: #94a3b8; background: transparent; font-size: .68rem; cursor: pointer; }
.footer-reset:hover, .footer-reset:focus-visible { color: #f8fafc; background: rgba(255,255,255,.07); }
.footer-creator-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid rgba(242,101,34,.22); border-radius: 999px; color: #dbe2eb; background: rgba(242,101,34,.09); font-size: .68rem; white-space: nowrap; }
.footer-creator-badge svg { width: 14px; height: 14px; color: var(--orange-500); }
.footer-creator-badge strong { color: #ff8053; font-weight: 750; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border-radius: 11px;
  color: var(--white);
  background: var(--navy-950);
  box-shadow: 0 16px 36px rgba(16,29,63,.25);
  font-size: .82rem;
  font-weight: 700;
  animation: toastIn .2s ease both;
}
.noscript-message { position: fixed; inset: auto 12px 12px; z-index: 200; padding: 12px; border-radius: 10px; color: #fff; background: var(--danger); text-align: center; }

:focus-visible { outline: 3px solid rgba(242,101,34,.42); outline-offset: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes reveal { from { opacity: 0; transform: translateY(7px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 940px) {
  .calculator-card { grid-template-columns: 1fr; }
  .result-panel { border-top: 1px solid var(--line); border-left: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .empty-state { min-height: 250px; }
  .footer-desc { display: none; }
}

@media (max-width: 680px) {
  :root { --header-height: 68px; }
  .header-inner, .page-shell { width: min(100% - 28px, 1180px); }
  .header-inner { gap: 10px; }
  .brand-cluster { gap: 10px; }
  .partner-logo--danantara { height: 22px; max-width: 130px; }
  .partner-logo--posind { height: 26px; max-width: 86px; }
  .brand-divider { height: 24px; }
  .location-chip { display: none; }
  .language-button { min-width: 37px; min-height: 32px; }
  .page-shell { padding-top: 28px; }
  .intro { align-items: flex-start; gap: 15px; margin-bottom: 19px; }
  .mailon-logo { width: 105px; }
  .eyebrow { font-size: .62rem; }
  h1 { font-size: clamp(1.78rem, 9vw, 2.55rem); }
  .intro-text { margin-top: 10px; font-size: .93rem; line-height: 1.55; }
  .calculator-card { border-radius: 19px; }
  .calculator-form, .result-panel { padding: 22px 18px; }
  .route-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 23px; }
  .route-arrow { display: none; }
  .fixed-field input, .combobox-wrap input { min-height: 54px; font-size: 16px; }
  .destination-options { max-height: min(300px, 42vh); }
  .result-panel { border-radius: 0 0 19px 19px; }
  .result-content { padding-top: 27px; }
  .tariff-value { font-size: 3rem; }
  .result-details { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-template-columns: 1fr 1fr; }
  .trust-row { grid-template-columns: 1fr; gap: 8px; }
  .trust-item { padding: 12px 14px; }
  .dashboard-footer { flex-direction: column; justify-content: center; gap: 7px; padding: 10px 14px; }
  .footer-tools { width: 100%; justify-content: center; flex-wrap: wrap; }
  .footer-reset { order: 2; }
  .toast { bottom: 98px; }
}

@media (max-width: 430px) {
  .partner-logo--danantara { height: 20px; max-width: 112px; }
  .partner-logo--posind { height: 23px; max-width: 73px; }
  .brand-divider { display: none; }
  .mailon-logo { width: 88px; }
  .result-details { grid-template-columns: 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .footer-creator-badge { font-size: .64rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .intro, .calculator-form, .trust-row, .disclaimer, .dashboard-footer, .result-actions, .toast { display: none !important; }
  body { background: #fff; }
  .page-shell { width: 100%; padding: 0; }
  .calculator-card { display: block; border: 0; box-shadow: none; }
  .result-panel { border: 0; background: #fff; }
  .result-content { display: block !important; }
}
