:root {
  --bg-1: #0d1b2a;
  --bg-2: #1b263b;
  --panel: rgba(17, 24, 39, 0.82);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #22c55e;
  --primary-dark: #15803d;
  --stroke: rgba(148, 163, 184, 0.28);
  --danger: #f87171;
  --card-icon-size: 27px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, #1d4ed8, transparent 45%),
    radial-gradient(circle at 90% 0%, #0f766e, transparent 40%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.layout {
  width: min(1100px, 100% - 2rem);
  margin: 2.5rem auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  backdrop-filter: blur(7px);
  padding: 1.25rem;
  opacity: 0;
  transform: translateY(18px);
  animation: panelReveal 720ms cubic-bezier(0.18, 0.84, 0.28, 1) forwards;
}

.panel-right {
  animation-delay: 140ms;
}

.panel-left {
  position: relative;
}

.lang-switcher {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: grid;
  grid-template-columns: repeat(4, 30px);
  gap: 0.36rem;
  z-index: 5;
}

.lang-btn {
  width: 30px;
  height: 22px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lang-btn img {
  width: 22px;
  height: 14px;
  display: block;
  border-radius: 2px;
}

.lang-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.9);
}

.lang-btn.active {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}

.lang-btn:focus-visible {
  outline: 2px solid #facc15;
  outline-offset: 1px;
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(160deg, #14b8a6, #22c55e);
  color: #03220d;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.brand-overline {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

h1,
h2 {
  margin: 0;
}

h2 {
  font-size: 1.2rem;
}

.muted {
  color: var(--muted);
  margin: 0.4rem 0 1rem;
}

.purchase-intro {
  color: #22c55e;
  font-size: 17px;
  margin: 0.4rem 0 1rem;
}

.wallet-destino-red {
  color: #ef4444;
  font-size: 18px;
}

.purchase-intro .wallet-destino-red {
  color: inherit;
}

.wallet-focus-icon {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  font-size: 24px;
  line-height: 1;
  vertical-align: -2px;
}

.wallet-focus-icon:focus-visible {
  outline: 2px solid #facc15;
  outline-offset: 2px;
  border-radius: 6px;
}

input.field-flash,
select.field-flash,
#wallet.wallet-flash {
  animation: walletFluorescent 0.95s ease-in-out infinite;
}

@keyframes walletFluorescent {
  0%,
  100% {
    border-color: #facc15;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.15), 0 0 10px rgba(250, 204, 21, 0.25);
  }
  50% {
    border-color: #fde047;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.4), 0 0 16px rgba(250, 204, 21, 0.6);
  }
}

.coin-list {
  display: grid;
  gap: 0.45rem;
  max-height: 60vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.coin-item {
  border: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  border-radius: 12px;
  padding: 0.7rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.coin-item:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.8);
}

.coin-item.active {
  border-color: var(--primary);
  background: rgba(20, 184, 166, 0.15);
}

.coin-item.disabled {
  background: rgba(71, 85, 105, 0.25);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.65;
}

.coin-item.disabled:hover {
  transform: none;
  border-color: rgba(148, 163, 184, 0.2);
}

.coin-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.coin-symbol {
  font-weight: 700;
}

.stable-tag {
  font-size: 0.76rem;
  color: #03220d;
  background: #86efac;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  align-self: start;
}

.coin-network {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.payment-description {
  margin-top: 0.9rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: linear-gradient(145deg, rgba(8, 47, 73, 0.55), rgba(15, 23, 42, 0.7));
}

.payment-description-title {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #7dd3fc;
}

.payment-led {
  display: inline-block;
  width: 0.56rem;
  height: 0.56rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.16), 0 0 5px rgba(34, 197, 94, 0.22);
  animation: paymentLedBreath 1300ms ease-in-out infinite;
  vertical-align: middle;
}

@keyframes paymentLedBreath {
  0%,
  100% {
    opacity: 0.35;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12), 0 0 4px rgba(34, 197, 94, 0.18);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3), 0 0 11px rgba(34, 197, 94, 0.6);
  }
}

.payment-description-text {
  margin: 0.4rem 0 0;
  color: #e2e8f0;
  line-height: 1.38;
  font-size: 0.92rem;
  word-break: break-word;
}

.field-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.7rem;
}

label {
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
.cta {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.76);
  color: var(--text);
  padding: 0.72rem;
  font: inherit;
}

input.locked,
select.locked {
  background: rgba(100, 116, 139, 0.35);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.45);
  cursor: not-allowed;
}

input:focus,
select:focus {
  outline: none;
  border-color: #38bdf8;
}

.cta {
  margin-top: 1rem;
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  color: #05200d;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.cta:hover {
  filter: brightness(1.05);
}

.cta:disabled {
  opacity: 0.82;
  cursor: not-allowed;
}

.cta.cta-ready:not(:disabled) {
  animation: ctaReadyPulse 2100ms ease-in-out infinite;
}

@keyframes ctaReadyPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.34);
  }
  50% {
    transform: scale(1.015);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

.help {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.flow-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin-top: 0.35rem;
}

.flow-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.48rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.flow-pill-card {
  color: #0f172a;
  background: linear-gradient(145deg, #93c5fd, #38bdf8);
}

.flow-icon-card {
  font-size: var(--card-icon-size);
  line-height: 1;
  margin-right: 0.2rem;
}

#coin {
  font-size: var(--card-icon-size);
}

.flow-pill-usdc {
  color: #052e16;
  background: linear-gradient(145deg, #86efac, #4ade80);
}

.flow-arrow {
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-block;
  animation: flowArrowTrace 3200ms ease-in-out infinite;
}

@keyframes flowArrowTrace {
  0%,
  55%,
  100% {
    opacity: 0.62;
    transform: translateX(0);
    text-shadow: none;
  }
  72% {
    opacity: 1;
    transform: translateX(3px);
    text-shadow: 0 0 10px rgba(147, 197, 253, 0.8);
  }
  84% {
    opacity: 0.9;
    transform: translateX(0);
    text-shadow: 0 0 4px rgba(147, 197, 253, 0.35);
  }
}

.message {
  margin: 0.7rem 0 0;
  min-height: 1.2rem;
  font-size: 0.9rem;
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: #4ade80;
}

.commission-panel {
  margin-top: 1.6rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
}

.commission-panel p {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.commission-panel small {
  color: #94a3b8;
}

.commission-panel input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  margin-top: 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 20, 30, 0.65);
  color: #f8fafc;
  font-size: 1rem;
}

.simulation-result {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #e5e7eb;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    width: min(740px, 100% - 1.2rem);
    margin: 1rem auto;
  }

  .lang-switcher {
    top: 0.8rem;
    right: 0.8rem;
    grid-template-columns: repeat(4, 28px);
    gap: 0.28rem;
  }

  .lang-btn {
    width: 28px;
    height: 20px;
  }

  .coin-list {
    max-height: 38vh;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
.brand-logo {
  width: 56px;
  height: 56px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(34, 197, 94, 0.3));
}
.coin-group-title {
  margin: 0.7rem 0 0.25rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dd3fc;
}

.coin-group-title:first-child {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .panel-right,
  .cta.cta-ready:not(:disabled),
  .flow-arrow {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
