/* order-flow.css — channel-order page styles.
   Page-specific layer for the consumer "Open a Lightning channel" flow. Loaded AFTER flow-ui.css, which
   supplies the design tokens (:root), base resets, and shared chrome (.shell / .top / .brand / .mark /
   .sub / .tabs / .spacer). Only the rules unique to this flow live here, mirroring how swap-flow.css sits
   on top of flow-ui.css for the swap page. Extracted verbatim from the old inline <style> in
   channel-order-flow.html when that page was ported to the Scala.js `web` app. */

/* page-local tokens flow-ui.css's :root doesn't define yet: elevation + the faint accent border. */
:root {
  --shadow: 0 1px 2px rgba(14, 21, 48, 0.04), 0 14px 38px -22px rgba(14, 21, 48, 0.24);
  --accent-line: rgba(79, 70, 229, 0.34); /* faint accent border — active step + summary tag */
}

/* top bar extras (brand/tabs/spacer come from flow-ui.css) */
.top-path { color: var(--ink-mute); font-family: var(--mono); font-size: 12px; min-width: 0; }
.top-path strong { color: var(--ink); font-weight: 600; }

.api-pill {
  display: inline-flex; align-items: center; gap: 8px; max-width: 360px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-dim);
  font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--warn); }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--err); }

/* page layout */
.page {
  width: min(100%, 1480px); margin: 0 auto; padding: 36px 56px 86px;
  display: grid; grid-template-columns: minmax(0, 1fr) 386px; gap: 36px;
}
.main { min-width: 0; max-width: 100%; }

/* stepper */
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 28px; }
.step {
  min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px;
  color: var(--ink-mute); text-align: left;
}
.step.done, .step.active { border-color: var(--accent-line); background: var(--accent-tint); color: var(--accent); }
.step.active { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.step-number {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: var(--line); color: var(--ink-dim); font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.step.done .step-number, .step.active .step-number { background: var(--accent); color: #fff; }
.step-label {
  display: block; margin-top: 7px; color: var(--ink-2); font-size: 13px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* headings */
.kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 11px;
  font-weight: 700; text-transform: uppercase;
}
.zap-icon { width: 10px; height: 14px; display: inline-block; color: currentColor; }
.title {
  margin: 14px 0 10px; color: var(--ink); font-size: clamp(32px, 4vw, 46px); line-height: 1.08;
  font-weight: 720; max-width: 100%; overflow-wrap: anywhere;
}
.title em { color: var(--accent); font-style: normal; }
.lede { max-width: 720px; margin: 0 0 26px; color: var(--ink-dim); font-size: 15.5px; overflow-wrap: anywhere; }

/* panels */
.panel {
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.panel-title { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.panel-note { margin-left: auto; color: var(--ink-mute); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.panel-body { padding: 22px 20px; }

/* form fields */
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .group-label { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.hint { color: var(--ink-mute); font-size: 12px; }
.mono { font-family: var(--mono); }
input[type="text"], input[type="url"], input[type="number"], select, textarea {
  width: 100%; min-height: 42px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  padding: 10px 12px; outline: none; transition: border-color 140ms ease, box-shadow 140ms ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
textarea { min-height: 84px; resize: vertical; }

/* capacity slider */
.capacity-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.capacity-amount { color: var(--ink); font-size: clamp(34px, 5vw, 50px); line-height: 1; font-weight: 760; }
.capacity-amount span { color: var(--ink-mute); font-size: 18px; font-weight: 600; }
.range { width: 100%; margin: 0; accent-color: var(--accent); }
.tick-row { position: relative; height: 18px; margin-top: 8px; color: var(--ink-mute); font-family: var(--mono); font-size: 11px; }
.tick-row span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tick-row span:first-child { transform: translateX(0); }
.tick-row span:last-child { transform: translateX(-100%); }

/* choices (confirm target / duration) */
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.duration-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice {
  min-height: 96px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  padding: 13px; text-align: left; transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.choice:hover { border-color: var(--line-3); }
.choice.active { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08); }
.choice:disabled { cursor: not-allowed; opacity: 0.48; }
.choice strong { display: block; color: var(--ink); font-size: 17px; font-weight: 750; }
.choice span { display: block; margin-top: 4px; color: var(--ink-mute); font-family: var(--mono); font-size: 12px; }

/* switches */
.switches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.switch {
  display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--ink-dim);
  font-size: 13px; font-weight: 600;
}
.switch input { width: 17px; height: 17px; accent-color: var(--accent); }

/* review list */
.review-list { display: grid; gap: 0; }
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: 0; }
.review-key { color: var(--ink-dim); font-size: 13px; }
.review-key strong { display: block; color: var(--ink); font-size: 14px; }
.review-value { color: var(--ink); font-family: var(--mono); text-align: right; }

/* callouts */
.callout { display: grid; gap: 8px; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--accent-tint); color: var(--ink-dim); }
.callout strong { color: var(--ink); }
.callout.warn { border-color: #f8df9f; background: var(--warn-soft); color: #7c4a05; }

/* actions / buttons */
.actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.actions .push { flex: 1; }
.btn {
  min-height: 42px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink);
  padding: 10px 16px; font-weight: 700; transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}
.btn:hover { border-color: var(--line-3); transform: translateY(-1px); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 10px 22px -14px rgba(79, 70, 229, 0.85); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-dim); }
.btn:disabled { cursor: not-allowed; opacity: 0.62; transform: none; }

/* payment / QR */
.payment-grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.qr-box { min-height: 236px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 14px; display: grid; place-items: center; overflow: hidden; }
.qr-box svg { width: 100%; height: auto; display: block; }
.invoice-box { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.invoice-text { flex: 1; min-width: 0; color: var(--ink-dim); font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn { border: 1px solid var(--accent); border-radius: 6px; background: #fff; color: var(--accent); padding: 6px 9px; font-family: var(--mono); font-size: 11px; font-weight: 700; }

/* status log */
.status-box { border-top: 1px solid var(--line); background: var(--panel-2); }
.status-line { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; padding: 9px 20px; border-bottom: 1px solid var(--line); color: var(--ink-dim); font-family: var(--mono); font-size: 12px; }
.status-line:last-child { border-bottom: 0; }
.status-line strong { color: var(--ink); font-weight: 700; }
.status-line.ok strong { color: var(--ok); }
.status-line.warn strong { color: var(--warn); }
.status-line.err strong { color: var(--err); }

/* channel-opening visual */
.channel-visual {
  min-height: 210px; display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; gap: 16px;
  padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, var(--panel-2), #fff);
}
.node { display: grid; justify-items: center; gap: 10px; color: var(--ink-dim); text-align: center; font-size: 12px; }
.node-circle { width: 70px; height: 70px; display: grid; place-items: center; border: 2px solid var(--accent); border-radius: 50%; background: #fff; color: var(--accent); }
.node-circle.dark { background: var(--ink); color: #fff; }
.channel-line { position: relative; height: 2px; background: var(--line-2); overflow: hidden; }
.channel-line::after { content: ""; position: absolute; top: 0; left: -24%; width: 24%; height: 100%; background: var(--accent); animation: sweep 2.4s linear infinite; }
@keyframes sweep { to { left: 100%; } }

/* success */
.success { text-align: center; padding: 44px 20px 24px; background: linear-gradient(180deg, var(--ok-soft), transparent 78%); }
.success-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #a7f3d0; border-radius: 999px; background: #fff; color: var(--ok); font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.success h2 { margin: 14px 0 8px; color: var(--ink); font-size: 32px; line-height: 1.15; }
.success p { max-width: 540px; margin: 0 auto; color: var(--ink-dim); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 20px; }
.fact { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: 14px; min-width: 0; }
.fact-key { color: var(--ink-mute); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.fact-value { margin-top: 6px; color: var(--ink); font-weight: 750; overflow-wrap: anywhere; }

/* sidebar */
.side { position: sticky; top: 86px; align-self: start; display: grid; gap: 14px; }
.summary { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.summary-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-weight: 750; }
.tag { margin-left: auto; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-key { color: var(--ink-mute); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.summary-value { min-width: 0; color: var(--ink); font-family: var(--mono); font-size: 12.5px; text-align: right; overflow-wrap: anywhere; }
.summary-total { padding: 15px 18px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-tint), var(--accent-soft)); }
.summary-total .summary-value { color: var(--accent); font-size: 24px; font-weight: 800; }
.help { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; color: var(--ink-dim); box-shadow: var(--shadow); }
.help strong { display: block; margin-bottom: 6px; color: var(--ink); }

/* error / utility */
.error { display: none; margin: 18px 0 0; border: 1px solid #fecaca; border-radius: 8px; background: var(--err-soft); color: #7f1d1d; padding: 12px 14px; }
.error.show { display: block; }
.hidden { display: none !important; }

@media (max-width: 1180px) {
  .page { grid-template-columns: 1fr; padding: 28px; }
  .side { position: static; }
}

@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .top { align-items: flex-start; flex-direction: column; padding: 12px 18px; }
  .spacer { display: none; }
  .api-pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .page { width: min(100%, 390px); margin: 0; padding: 22px 16px 64px; }
  .title { font-size: 28px; line-height: 1.12; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-note { margin-left: 0; white-space: normal; }
  .capacity-row { display: grid; gap: 8px; }
  .capacity-amount { font-size: 34px; }
  .capacity-amount span { font-size: 16px; }
  .stepper { grid-template-columns: 1fr; }
  .field-grid, .choice-row, .payment-grid, .facts { grid-template-columns: 1fr; }
  .review-row { grid-template-columns: 1fr; }
  .review-value { text-align: left; }
  .status-line { grid-template-columns: 1fr; }
  .channel-visual { grid-template-columns: 1fr; }
  .channel-line { height: 58px; width: 2px; justify-self: center; }
  .channel-line::after { top: -24%; left: 0; width: 100%; height: 24%; animation-name: sweepY; }
  @keyframes sweepY { to { top: 100%; } }
  .actions { flex-wrap: wrap; }
  .actions .push { flex-basis: 100%; }
  .btn { width: 100%; }
}
