/* The swap card in the hero widget. */

.widget :is(.swap, .leg, .token, .flip, .cta, .routing, .venue) {
  corner-shape: superellipse(var(--squircle-factor));
}

/* Swap card */
.swap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 30rem;
  padding: 8px;
  border-radius: var(--radius-2xl);
  background: var(--surface-primary);
  box-shadow: 0 0 0 .5px var(--border-surface-strong), 0 20px 25px -5px #0000000f, 0 8px 10px -6px #0000000f;
}
.swap-head { display: flex; gap: 16px; padding: 6px 10px 10px; color: var(--muted-foreground); font-size: var(--text-sm); font-weight: var(--font-weight-medium); }
.swap-head .on { color: var(--foreground); }
.swap-head .slippage { margin-left: auto; font-size: var(--text-xs); }

.leg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: color-mix(in oklab, var(--foreground) 3.5%, transparent);
}
.leg-label, .leg-meta { color: var(--muted-foreground); font-size: var(--text-sm); font-weight: var(--font-weight-medium); }
.leg-row, .leg-meta { display: flex; align-items: center; justify-content: space-between; }
.leg-meta { font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.amount {
  min-height: 40px;
  font-size: 2.25rem;
  font-weight: var(--font-weight-medium);
  line-height: 40px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.amount-out { color: var(--color-neutral-300); transition: color .3s; }
.is-routed .amount-out { color: var(--foreground); }

.token {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px 0 4px;
  border-radius: 999px;
  background: var(--surface-primary);
  box-shadow: 0 0 0 .5px var(--border-surface-strong), 0 1px 2px #0000000d;
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
}
.token img:first-child { width: 28px; height: 28px; }
.token .caret { width: 14px; height: 14px; opacity: .5; }
.hook {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-violet-500), var(--color-pink-500));
  color: var(--color-white);
  font-size: var(--text-xs);
  font-style: normal;
  font-weight: var(--font-weight-bold);
}

.flip {
  position: absolute;
  top: 147px;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  translate: -50% 0;
  border: 4px solid var(--surface-primary);
  border-radius: var(--radius-lg);
  background: var(--color-neutral-100);
}
.flip img { width: 16px; height: 16px; }

.rate { display: flex; justify-content: space-between; padding: 10px 10px 6px; color: var(--muted-foreground); font-size: var(--text-xs); font-weight: var(--font-weight-medium); }
.rate span:first-child { color: var(--foreground); }

.cta {
  display: grid;
  place-items: center;
  height: 56px;
  border-radius: var(--radius-xl);
  background: color-mix(in oklab, var(--foreground) 6%, transparent);
  color: var(--muted-foreground);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  transition: background-color .3s, color .3s;
}
.cta .done, .is-routed .cta .busy { display: none; }
.is-routed .cta .done { display: inline; }
.is-routed .cta { background: var(--brand); color: var(--color-white); }
