/* Styles borrowed from liq2sol (github.com/SwapMarket/liq2sol, client/site/style.css), in the style of
   swapmarket.github.io: deep navy, dark cards with a soft glow, dashed fields, and a yellow call to action. */
:root {
  --bg: #142840;
  --card: #0f1f30;
  --deep: #091625;
  --edge: #1e2d3c;
  --border: rgb(255 255 255 / 10%);
  --text: #d7dee4;
  --muted: #a1a9b2;
  --dim: #727e8c;
  --primary: #e8cb2b;
  --primary-soft: rgb(232 203 43 / 35%);
  --link: #4fadc2;
  --ok: #4fc04f;
  --ok-bg: #0f3a1c;
  --warn-bg: #3d3210;
  --warn-text: #f6e7a8;
  --err: #ff8a80;
  --err-bg: #4a1414;
  --radius: 16px;
  color-scheme: dark;
  accent-color: var(--primary);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); }
main { max-width: 520px; margin: 0 auto; padding: 32px 16px; }
header { text-align: center; }
h1 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(1.3rem, 7.5vw, 2.4rem);
  white-space: nowrap;
  line-height: 1.15;
  font-weight: 800;
}
h1 .tether { flex: none; width: 1.1em; height: 1.1em; }
h1 span {
  background: linear-gradient(90deg, #eac806, #2084f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { margin: 8px 0 16px; color: var(--muted); font-size: 14px; }

/* Direction switch */
.dir { display: flex; margin: 0 0 20px; border: 1px dashed var(--dim); border-radius: 12px; overflow: hidden; background: var(--deep); }
.dir label { flex: 1; margin: 0; text-align: center; padding: 9px 8px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
.dir label:hover { color: var(--primary); }
.dir label:has(input:checked) { background: var(--primary); color: var(--card); }
.dir label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: -4px; }
.dir input { position: absolute; opacity: 0; pointer-events: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 34px var(--primary-soft);
  padding: 16px;
  margin-bottom: 20px;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
#balances { margin-top: 12px; font-size: 14px; }
.bal { display: grid; grid-template-columns: 72px 1fr; padding: 4px 0; }
.bal .chain { color: var(--dim); }
.bal .vals { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.muted { color: var(--muted); }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px 4px; }
label:first-child { margin-top: 0; }
input[type=text] {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px dashed var(--dim);
  border-radius: 12px;
  background: var(--deep);
  color: var(--text);
  font: inherit;
  outline: 0;
}
input[type=text]::placeholder { color: var(--dim); }
.row input[type=text] { width: auto; }
input[type=text]:focus { border-color: var(--primary); }
#amount { font-size: 1.35rem; }

fieldset { border: 0; padding: 0; margin: 14px 0 0; }
fieldset.src { margin: 0 0 4px; }
legend { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 4px; padding: 0; }
label.radio { display: block; padding-left: 26px; text-indent: -26px; font-weight: 400; font-size: 14px; color: var(--text); margin: 6px 0 6px 4px; }
label.radio input { margin: 0 8px 0 0; vertical-align: -2px; }
label.radio:has(input:disabled) { opacity: 0.55; }
label.topup { margin-left: 26px; color: var(--muted); }

/* Buttons: quiet (outlined) by default, yellow for the main action. */
button, a.btn {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--dim);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
button:hover:not(:disabled), a.btn:hover { background: var(--edge); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary, a.btn.primary {
  border: 0;
  background: var(--primary);
  color: var(--card);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
}
button.primary { width: 100%; margin-top: 18px; padding: 11px 12px; }
button.primary:hover:not(:disabled), a.btn.primary:hover { background: #fee86b; }
button.primary:disabled { opacity: 1; background: #545c65; color: var(--edge); }
button.ghost { background: transparent; }
.wc-mobile { margin-top: 12px; }
.wc-mobile p { margin: 0 0 10px; font-size: 14px; }

/* Progress */
#steps { list-style: none; margin: 0; padding: 0; font-size: 14px; }
#steps li { position: relative; padding: 3px 0 3px 24px; color: var(--dim); }
#steps li::before { content: "○"; position: absolute; left: 4px; }
#steps li.active { color: var(--text); font-weight: 600; }
#steps li.active::before { content: "●"; color: var(--primary); }
#steps li.done { color: var(--muted); }
#steps li.done::before { content: "✓"; color: var(--ok); }
#steps li.skipped { color: var(--dim); text-decoration: line-through; }
#steps li.skipped::before { content: "–"; }
#steps .elapsed { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
#steps li.active .elapsed { color: var(--primary); }
.status { margin-top: 12px; font-size: 14px; overflow-wrap: anywhere; }
.status.ok { padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); color: #d3f5d3; }
.status.err { padding: 10px 12px; border-radius: 10px; background: var(--err-bg); color: #ffd9d4; }
#manualMint, #retrySwap { margin-top: 12px; }

/* The outcome, in liq2sol's dashed "to" row; warnings as tinted boxes. */
.receive { margin: 14px 0 0; padding: 10px 12px; border: 1px dashed rgb(232 203 43 / 60%); border-radius: 12px; background: var(--deep); font-size: 14px; font-weight: 600; }
.receive:empty { display: none; }
.warn { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-size: 14px; }
.warn:empty { display: none; }
.hint { margin: 6px 0 0 4px; font-size: 13px; }
.hint:empty { display: none; }
.sweep { margin-top: 8px; }

summary { cursor: pointer; font-weight: 600; color: var(--muted); }
summary:hover { color: var(--primary); }
details p { margin: 10px 0; font-size: 14px; }
footer { text-align: center; color: var(--dim); font-size: 12px; margin-top: 20px; }
code { font: 12px ui-monospace, "Noto Mono", Menlo, monospace; }

/* sol2base: the Base wallet section and the rent line. */
.base-wallet { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--edge); }
#baseBalances { margin-top: 8px; font-size: 14px; }
.rent { margin-top: 6px; font-size: 14px; }

/* The menu, as in liq2sol (client/site/style.css): the site's logo on the left, then SwapMarket's other pages. */
nav { background: var(--card); border-bottom: 1px solid rgb(255 255 255 / 8%); }
.nav-inner { max-width: 960px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; justify-content: center; }
.logo { display: inline-flex; align-items: center; margin-right: 28px; }
.logo img { display: block; height: 28px; width: auto; }
.tab { color: var(--text); text-decoration: none; font-size: 16px; padding: 2px 14px; border-left: 1px solid rgb(255 255 255 / 15%); }
#collapse { display: flex; align-items: center; flex-wrap: wrap; }
.tab:hover, .tab.on { color: var(--primary); }
@media (max-width: 500px) { .logo { margin-right: 12px; } }

/* The burger and its menu, from SwapMarket/swapmarket.github.io src/style/nav.scss (AGPL-3.0), with this page's colours. */
#burger { display: none; background: none; border: 0; padding: 0; margin-left: auto; position: relative; z-index: 1000;
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 400ms; user-select: none; }
#burger.active { transform: rotate(45deg); }
body.menu-open { overflow: hidden; }
#burger .line { fill: none; transition: stroke-dasharray 400ms, stroke-dashoffset 400ms; stroke: var(--text); stroke-width: 5.5; stroke-linecap: round; }
#burger .top, #burger .bottom { stroke-dasharray: 40 121; }
#burger.active .top, #burger.active .bottom { stroke-dashoffset: -68px; }
@media (max-width: 768px) {
  .nav-inner { justify-content: flex-start; }
  #burger { display: block; }
  #collapse { display: none; }
  #collapse.open { display: flex; position: fixed; z-index: 999; inset: 0; background: var(--bg); align-items: center; justify-content: center; flex-direction: column; }
  #collapse.open .tab { display: block; border-left: 0; padding: 6px 24px; font-size: 26px; }
}

/* The WalletConnect QR dialog (qr.js), and its code filling the screen on a tap, as in liq2sol. */
.wc-dialog { max-width: min(92vw, 380px); padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); text-align: center; }
.wc-dialog::backdrop { background: rgb(0 0 0 / 60%); }
.wc-dialog h3 { margin: 0 0 10px; font-size: 1.05rem; }
.wc-dialog .row { justify-content: center; gap: 8px; margin-top: 12px; }
.wc-dialog .open-wc { display: block; margin-top: 12px; }
.wc-dialog .muted { font-size: .85rem; margin: 8px 0 0; }
.qr { display: flex; justify-content: center; cursor: zoom-in; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 10px; padding: 6px; }
.qr-full { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: #000; cursor: zoom-out; }
.qr-full > svg { box-sizing: border-box; width: min(94vw, 94vh); height: min(94vw, 94vh); padding: min(3vw, 3vh); background: #fff; }
