:root {
  --ink: #171612;
  --ink-soft: #5f5c55;
  --paper: #f6f5f2;
  --card: #ffffff;
  --line: #e5e2da;
  --amber: #fbbf24;
  --amber-dark: #9b6900;
  --amber-soft: #fff4cc;
  --green: #17a568;
  --green-soft: #eaf8f1;
  --danger: #d94040;
  --shadow: 0 16px 40px rgba(27, 23, 13, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 4%, rgba(251, 191, 36, .11), transparent 25rem),
    var(--paper);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: rgba(17, 16, 13, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px);
}

.header-inner,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; }
.brand img { width: 154px; height: 54px; object-fit: contain; object-position: left center; }

.live-state {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 9px 13px;
  color: #d9d6ce;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  font-size: 13px;
}

.live-state.ready { color: #b9f1d4; border-color: rgba(23, 165, 104, .35); }
.live-state.error { color: #ffc3c3; border-color: rgba(217, 64, 64, .4); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9d998f; }
.ready .live-dot { background: #29c67e; box-shadow: 0 0 0 4px rgba(41, 198, 126, .12); }
.error .live-dot { background: #f15c5c; }

main { padding: 64px 0 56px; }

.intro {
  max-width: 690px;
  margin-bottom: 32px;
}

/* Tasas de referencia: las dos siempre visibles, cada una en su propia pastilla
   con bandera y etiqueta, para que no se lean como una sola frase corrida. */
.ticker {
  margin-top: 18px;
  color: #6b6459;
  font-size: 12.5px;
}

.ticker__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--line, rgba(0, 0, 0, .08));
  border-radius: 999px;
  background: rgba(0, 0, 0, .025);
  white-space: nowrap;
}

.ticker__flag {
  width: 20px;
  height: 14px;
  flex: none;
  overflow: hidden;
  border: 1px solid rgba(20, 18, 12, .12);
  border-radius: 3px;
}

.ticker__flag img { width: 100%; height: 100%; display: block; object-fit: cover; }

.ticker__tag {
  color: #2c2823;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
}

.ticker b { color: #2c2823; font-weight: 700; }

.quick-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.quick-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b6459;
  font-size: 12.5px;
}

.quick-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  color: #17130a;
  font-size: 11px;
  font-weight: 700;
}

.eyebrow,
.section-kicker {
  color: var(--amber-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.intro h1 {
  margin: 9px 0 8px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.55;
}

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(440px, 1.08fr);
  gap: 24px;
  align-items: start;
}

/* Los elementos de una rejilla no bajan de su ancho intrínseco a menos que se
   les permita: el de un <select> lo fija su opción más larga ("USD · Dólar
   estadounidense") y el del <input> del monto su tamaño por defecto. Sin esto,
   en un móvil de 375px el formulario se plantaba en 482px y toda la página se
   desplazaba en horizontal. */
.quote-card,
.result-column,
.field,
.field-grid > *,
select { min-width: 0; }

.amount-input-wrap > input { width: 100%; }

.quote-card,
.result-card,
.trust-card,
.steps {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quote-card { padding: 26px; }

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.card-heading h2 {
  margin: 5px 0 0;
  font-size: 23px;
  letter-spacing: -.025em;
}

.secure-label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  color: #157f53;
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.secure-label svg { width: 14px; fill: currentColor; }

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  margin-bottom: 24px;
  background: #f0efeb;
  border-radius: 15px;
}

.mode-button {
  min-width: 0;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 11px 12px;
  color: var(--ink-soft);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 11px;
}

.mode-button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 4px 12px rgba(20, 18, 12, .08);
}

.mode-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--amber-dark);
  background: var(--amber-soft);
  border-radius: 8px;
  font-weight: 900;
}

.mode-button span:last-child { min-width: 0; display: grid; gap: 2px; }
.mode-button b { font-size: 13px; white-space: nowrap; }
.mode-button small { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
}

.field-label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #4f4c45;
  font-size: 13px;
  font-weight: 700;
}

.field-label i {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #706c63;
  background: #f0efeb;
  border-radius: 8px;
  font-style: normal;
  font-size: 11px;
}

.field small { color: #7b776f; font-size: 12px; line-height: 1.35; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #777269;
  border-bottom: 2px solid #777269;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-wrap--flag select { padding-left: 51px; }

.select-flag {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 25px;
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(20, 18, 12, .1);
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(20, 18, 12, .09);
  transform: translateY(-50%);
  pointer-events: none;
}

.select-flag img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

select,
.amount-input-wrap {
  width: 100%;
  min-height: 54px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9d6cf;
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}

select {
  padding: 0 42px 0 15px;
  appearance: none;
}

select:focus,
.amount-input-wrap:focus-within {
  outline: 0;
  border-color: #e7a800;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, .18);
}

.amount-input-wrap {
  display: flex;
  align-items: center;
  padding: 0 15px;
}

.amount-input-wrap input {
  min-width: 0;
  flex: 1;
  height: 52px;
  padding: 0;
  color: #11100d;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.amount-input-wrap input::-webkit-inner-spin-button,
.amount-input-wrap input::-webkit-outer-spin-button { appearance: none; margin: 0; }

.amount-input-wrap strong {
  padding-left: 12px;
  color: #5d5951;
  font-size: 14px;
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -7px 0 20px;
}

.quick-amounts button {
  padding: 8px 10px;
  color: #5e5a52;
  background: #fff;
  border: 1px solid #dedbd4;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.quick-amounts button:hover,
.quick-amounts button.active {
  color: #7a5200;
  background: var(--amber-soft);
  border-color: var(--amber);
}

.form-message {
  padding: 11px 13px;
  margin-bottom: 12px;
  color: #a42727;
  background: #fff0f0;
  border: 1px solid #ffd1d1;
  border-radius: 12px;
  font-size: 13px;
}

.primary-button,
.share-button,
.secondary-button {
  min-height: 50px;
  border-radius: 13px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  color: #191506;
  background: linear-gradient(135deg, #ffc82e, #f2aa0d);
  border: 1px solid #e5a203;
  box-shadow: 0 7px 16px rgba(225, 155, 0, .2);
}

.primary-button:hover { filter: brightness(.98); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }

.result-column { display: grid; gap: 14px; }

.result-card {
  min-height: 490px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0, rgba(251, 191, 36, .16), transparent 18rem),
    #171612;
  border-color: #24221d;
}

.result-loading {
  min-height: 488px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px;
  text-align: center;
}

.result-placeholder-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: #f6bc22;
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .22);
  border-radius: 18px;
  font-size: 26px;
}

.result-loading h2 { margin: 0 0 8px; font-size: 23px; }
.result-loading p { max-width: 370px; margin: 0; color: #a9a69e; line-height: 1.55; }

.result-content { min-height: 488px; }

.result-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 23px 25px;
  color: #d8d4cb;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-size: 13px;
  font-weight: 800;
}

.validity {
  padding: 7px 10px;
  color: #f7cf67;
  background: rgba(251, 191, 36, .1);
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.result-main { padding: 38px 25px 34px; }
.result-caption { color: #96928a; font-size: 11px; font-weight: 800; letter-spacing: .1em; }

.result-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 13px;
  color: var(--amber);
}

.result-amount > span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.045em;
}

.result-block + .result-block { margin-top: 20px; }
.result-block:first-child .result-amount { color: #fff; }

.result-amount small { color: #fff; font-size: 17px; font-weight: 800; }
.result-rate { color: #dedbd2; font-size: 14px; font-weight: 700; }

/* Equivalencia BCV: chip compacto pegado al monto que recibe el destinatario.
   El display explícito anula el atributo hidden, por eso la regla [hidden]. */
.result-reference {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin: -4px 0 0;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: #dedbd2;
  font-size: 13px;
  font-weight: 700;
}
.result-reference[hidden] { display: none; }
.result-reference small { color: #96928a; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }

.result-summary {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.result-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 25px;
}
.result-summary span { color: #8f8b83; font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.result-summary strong { color: #fff; font-size: 16px; }
.result-summary small { font-size: 12px; }

.result-extra {
  display: grid;
  gap: 7px;
  padding: 18px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.result-extra__title { color: #8f8b83; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.result-extra__row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.result-extra__row span { color: #cfcac1; font-size: 13px; }
.result-extra__row strong { color: #fff; font-size: 15px; white-space: nowrap; }
.result-extra__row small { font-size: 12px; }
.result-extra__note { color: #8f8b83; font-size: 11.5px; margin: 0; }

.result-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 9px;
  padding: 20px 25px 25px;
}

.result-actions button { min-width: 0; }

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #17130a;
  background: var(--amber);
  border: 1px solid var(--amber);
}
.share-button svg { width: 17px; fill: currentColor; }
.share-button.is-copied { background: #2f9e6b; border-color: #2f9e6b; color: #fff; }

.route-pair {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.route-pair img {
  width: 24px;
  height: 17px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
}

.secondary-button {
  color: #eeeae0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .18);
}
.share-button:hover, .secondary-button:hover { filter: brightness(1.04); }

.trust-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px;
}

.trust-card > div {
  min-width: 0;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 4px 10px;
}
.trust-card > div + div { border-left: 1px solid var(--line); }

.trust-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #147c51;
  background: var(--green-soft);
  border-radius: 9px;
  font-weight: 900;
}
.trust-card div > span:last-child { min-width: 0; display: grid; gap: 2px; }
.trust-card b { font-size: 12px; }
.trust-card small { overflow: hidden; color: #858078; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.steps { margin-top: 30px; padding: 28px; }
.steps-heading h2 { margin: 5px 0 22px; font-size: 26px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }

.steps-grid article {
  display: flex;
  gap: 13px;
  padding: 18px;
  background: #faf9f6;
  border: 1px solid #ebe8e1;
  border-radius: 15px;
}
.steps-grid article > span { color: #c38904; font-size: 12px; font-weight: 900; }
.steps-grid h3 { margin: 0 0 5px; font-size: 15px; }
.steps-grid p { margin: 0; color: #736f67; font-size: 12px; line-height: 1.5; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 34px;
  color: #77736b;
  font-size: 12px;
}
footer a { color: #7e5700; font-weight: 700; }
.footer-dot { margin: 0 6px; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  main { padding-top: 44px; }
  .quote-layout { grid-template-columns: 1fr; }
  .result-column { grid-row: 2; }
  .steps-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .header-inner,
  main,
  footer { width: min(100% - 24px, 1180px); }
  .header-inner { height: 66px; }
  .brand img { width: 128px; height: 46px; }
  .live-state { padding: 8px 10px; font-size: 11px; }
  main { padding-top: 34px; }
  .intro { margin-bottom: 24px; }
  .intro h1 { font-size: 38px; }
  .intro p { font-size: 15px; }
  .quote-card { padding: 19px; border-radius: 18px; }
  .secure-label { display: none; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .mode-button { padding: 10px 8px; }
  .mode-button small { display: none; }
  .mode-button b { font-size: 12px; }
  .result-card { min-height: 430px; border-radius: 18px; }
  .result-loading, .result-content { min-height: 428px; }
  .result-topline, .result-main { padding-left: 19px; padding-right: 19px; }
  .result-amount > span { font-size: 42px; }
  .result-summary > div { padding: 17px 19px; }
  .result-actions { grid-template-columns: 1fr; padding: 18px 19px 21px; }
  .trust-card { grid-template-columns: 1fr; }
  .trust-card > div { padding: 9px 6px; }
  .trust-card > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .trust-card small { white-space: normal; }
  .steps { padding: 20px; }
  footer { flex-direction: column; padding-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
