:root {
  --bg: #0a0d14;
  --bg-soft: #10141d;
  --surface: #141926;
  --surface-2: #1b2130;
  --border: #242c3d;
  --border-soft: #1c2331;
  --text: #eef2f9;
  --muted: #8b95ab;
  --accent: #22d3a6;
  --accent-2: #16b98f;
  --accent-soft: rgba(34, 211, 166, 0.12);
  --danger: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(34, 211, 166, 0.14), transparent 60%),
    radial-gradient(700px 400px at 5% 5%, rgba(56, 132, 255, 0.1), transparent 55%);
  background-attachment: fixed;
}

.container {
  width: min(1140px, 100% - 40px);
  margin-inline: auto;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.accent {
  color: var(--accent);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 13, 20, 0.78);
  border-bottom: 1px solid var(--border-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04110d;
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04110d;
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--block {
  width: 100%;
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Hero ---------- */
.hero {
  padding: 76px 0 40px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 18px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 46ch;
}

.hero__stats {
  display: flex;
  gap: 34px;
  margin-top: 34px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat__label {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Converter ---------- */
.converter {
  padding: 26px;
  box-shadow: var(--shadow);
}

.converter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.converter__head h2 {
  font-size: 1.25rem;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.converter__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.input-group {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.input-group:focus-within {
  border-color: var(--accent);
}

.input-group input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 14px 16px;
}

.input-group input:focus {
  outline: none;
}

.input-group--result input {
  color: var(--accent);
}

.input-group input.pulse {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% {
    opacity: 0.4;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-group select {
  background: var(--surface-2);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
}

.input-group select:focus {
  outline: none;
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

.swap {
  align-self: center;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.2s ease;
}

.swap:hover {
  border-color: var(--accent);
  transform: rotate(180deg);
}

.summary {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}

.summary__row strong {
  color: var(--text);
  font-weight: 600;
}

.disclaimer {
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
}

/* ---------- Sections ---------- */
.section {
  padding: 64px 0;
}

.section__head {
  margin-bottom: 32px;
}

.section__head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.section__head p {
  color: var(--muted);
}

/* ---------- Rates ---------- */
.rates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.rate-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rate-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.rate-card--muted:hover {
  border-color: var(--border);
}

.rate-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rate-card__flag {
  font-size: 1.6rem;
}

.rate-card__top h3 {
  font-size: 1rem;
}

.rate-card__top p {
  font-size: 0.8rem;
  color: var(--muted);
}

.rate-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.rate-card--muted .rate-card__value {
  color: var(--text);
}

.rate-card__note {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feature {
  padding: 28px 24px;
}

.feature__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.feature p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 30px 0;
  margin-top: 40px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer p {
  color: var(--muted);
  font-size: 0.84rem;
}

.footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--accent);
}

.rates__update {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Modales ---------- */
.modal {
  width: min(560px, calc(100% - 32px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal--sm {
  width: min(440px, calc(100% - 32px));
}

.modal--legal {
  width: min(760px, calc(100% - 32px));
}

.modal::backdrop {
  background: rgba(4, 6, 11, 0.72);
  backdrop-filter: blur(4px);
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}

.modal__head h2 {
  font-size: 1.3rem;
}

.modal__sub {
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

.modal__close {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.modal__close:hover {
  color: var(--text);
  border-color: var(--accent);
}

.modal__text {
  padding: 18px 24px 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px 24px;
  margin-top: auto;
}

.modal--legal .modal__foot,
.modal--sm .modal__foot {
  border-top: 1px solid var(--border-soft);
}

/* ---------- Formularios ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 24px 0;
  overflow-y: auto;
}

.field--full {
  grid-column: 1 / -1;
}

.form-grid .field input,
.form-grid .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  padding: 11px 14px;
  transition: border-color 0.2s ease;
}

.form-grid .field input:focus,
.form-grid .field select:focus {
  outline: none;
  border-color: var(--accent);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.check input {
  flex: none;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-error {
  grid-column: 1 / -1;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
}

.modal__switch {
  font-size: 0.85rem;
  color: var(--muted);
}

.notice {
  margin: 20px 24px 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.notice strong {
  color: var(--text);
}

.notice--warn {
  background: var(--accent-soft);
  border-color: rgba(34, 211, 166, 0.35);
}

/* ---------- Resumen de operación ---------- */
.op-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px 0;
}

.op-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.op-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* ---------- Contenido legal ---------- */
.legal {
  padding: 20px 24px;
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.legal h3 {
  color: var(--text);
  font-size: 1rem;
  margin: 20px 0 8px;
}

.legal h3:first-child {
  margin-top: 0;
}

.legal p {
  margin-bottom: 10px;
}

.legal ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal li {
  margin-bottom: 6px;
}

.legal strong,
.legal em {
  color: var(--text);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 200;
  max-width: min(420px, calc(100% - 32px));
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .rates,
  .features {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 6px 20px 10px;
    background: rgba(10, 13, 20, 0.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
  }

  .nav.nav--open {
    display: flex;
  }

  .nav a {
    padding: 14px 2px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.95rem;
  }

  .nav a:last-child {
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1140px, 100% - 28px);
  }

  .topbar__inner {
    gap: 12px;
    height: 62px;
  }

  .hero {
    padding: 40px 0 24px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.6rem);
  }

  .hero__stats {
    flex-wrap: wrap;
    gap: 16px 26px;
    margin-top: 26px;
  }

  .converter {
    padding: 20px;
  }

  .converter__head {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px 20px 0;
  }

  .modal__head,
  .modal__foot {
    padding-left: 20px;
    padding-right: 20px;
  }

  .notice {
    margin-left: 20px;
    margin-right: 20px;
  }

  .op-summary,
  .legal {
    padding-left: 20px;
    padding-right: 20px;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section {
    padding: 48px 0;
  }
}

@media (max-width: 520px) {
  .topbar__cta {
    display: none;
  }

  .topbar__actions .btn {
    padding: 9px 14px;
    font-size: 0.88rem;
  }

  .hero__stats {
    gap: 14px 22px;
  }

  .input-group input {
    font-size: 1.1rem;
    padding: 12px 14px;
  }

  .input-group select {
    padding: 0 12px;
  }

  .rate-card__value {
    font-size: 1.7rem;
  }

  .modal__foot {
    flex-direction: column-reverse;
  }

  .modal__foot .btn {
    width: 100%;
  }
}

