/* Pearl Stream — "aurora flow" theme: deep space-navy with flowing aurora
 * gradient waves and an animated current. Not the vesting hourglass look. */
:root {
  --bg: #040b1a;
  --bg2: #071225;
  --panel: rgba(10, 22, 44, 0.82);
  --line: rgba(110, 200, 255, 0.16);
  --ink: #eaf6ff;
  --dim: #9db4d0;
  --teal: #38f2c8;
  --violet: #a78bfa;
  --rose: #fb7bb8;
  --amber: #ffd166;
  --red: #ff5d5d;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
/* animated aurora waves behind everything */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora .wave {
  position: absolute; left: -30%; width: 160%; height: 46vh; opacity: 0.5;
  filter: blur(70px); border-radius: 50%;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora .w1 { top: -14vh; background: linear-gradient(100deg, rgba(56,242,200,.35), rgba(167,139,250,.25) 55%, transparent); }
.aurora .w2 { top: 22vh; background: linear-gradient(100deg, transparent, rgba(167,139,250,.32), rgba(251,123,184,.22)); animation-delay: -9s; animation-duration: 32s; }
.aurora .w3 { top: 58vh; background: linear-gradient(100deg, rgba(56,150,242,.28), transparent 60%, rgba(56,242,200,.24)); animation-delay: -17s; animation-duration: 38s; }
@keyframes drift {
  from { transform: translateX(-6%) skewX(-4deg); }
  to { transform: translateX(6%) skewX(4deg); }
}

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7,18,37,.92), rgba(7,18,37,.55));
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 0.8rem; }
.seal { width: 40px; height: 40px; color: var(--teal); filter: drop-shadow(0 0 10px rgba(56,242,200,.6)); }
.brand h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0.02em; }
.tagline { margin: 0; color: var(--dim); font-size: 0.85rem; }
.steps { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.steps button {
  background: transparent; color: var(--dim); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer; font-size: 0.85rem;
  transition: all .2s;
}
.steps button.active {
  color: #03131f; font-weight: 700; border-color: transparent;
  background: linear-gradient(100deg, var(--teal), var(--violet));
  box-shadow: 0 0 18px rgba(56,242,200,.35);
}
.steps button:hover:not(.active) { color: var(--ink); border-color: var(--teal); }

main { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.panel {
  display: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 1.6rem; margin-bottom: 1.4rem;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
}
.panel.active { display: block; }
.panel h2 { margin-top: 0; font-size: 1.25rem; }
.panel h3 { margin-top: 1.4rem; }
.lede { color: var(--dim); max-width: 70ch; }
.lede code, .hint code, label code { color: var(--teal); font-size: 0.92em; word-break: break-all; }
.moves-real { color: var(--red); }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin: 1rem 0; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--dim); }
label.wide { grid-column: 1 / -1; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; grid-column: 1 / -1; color: var(--ink); }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea {
  background: rgba(4, 11, 26, 0.85); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.7rem; font-size: 0.95rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px rgba(56,242,200,.25); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 0.8rem 0; }
button { font-size: 0.9rem; border-radius: 10px; padding: 0.6rem 1.1rem; cursor: pointer; border: 1px solid var(--line); }
button.primary {
  background: linear-gradient(100deg, #1fd6a8, #7c6cf0); color: #03131f; font-weight: 700; border: none;
  box-shadow: 0 4px 22px rgba(56,242,200,.3);
}
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--ink); }
button.ghost:hover { border-color: var(--teal); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.err {
  color: #ffd9d9; background: rgba(255,93,93,.12); border: 1px solid rgba(255,93,93,.4);
  border-radius: 10px; padding: 0.7rem 0.9rem;
}
.hint { color: var(--dim); font-size: 0.85rem; }
.note {
  margin-top: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 10px;
  background: rgba(56,242,200,.08); border: 1px solid rgba(56,242,200,.3); font-size: 0.88rem;
}
.note code { color: var(--teal); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.card {
  border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem;
  background: linear-gradient(160deg, rgba(16,32,60,.9), rgba(8,16,34,.9));
}
.card h4 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.card .meta { font-size: 0.82rem; color: var(--dim); margin-bottom: 0.4rem; }
.card .addr { font-family: ui-monospace, monospace; font-size: 0.72rem; word-break: break-all; color: var(--teal); margin-bottom: 0.5rem; }
.badge {
  display: inline-block; font-size: 0.72rem; padding: 0.12rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); margin-left: 0.3rem; vertical-align: middle;
}
.badge.mature { color: var(--teal); border-color: rgba(56,242,200,.5); }
.badge.locked { color: var(--amber); border-color: rgba(255,209,102,.4); }
.badge.funded { color: var(--violet); border-color: rgba(167,139,250,.5); }
.badge.unfunded { color: var(--dim); }
.badge.swept { color: var(--rose); border-color: rgba(251,123,184,.5); }
.qr { margin-top: 0.6rem; }
.qr img { border-radius: 8px; }

.dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 1rem 0; }
.stat {
  border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem;
  background: linear-gradient(160deg, rgba(20,40,76,.9), rgba(8,16,34,.9));
}
.stat-label { display: block; font-size: 0.78rem; color: var(--dim); margin-bottom: 0.25rem; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--teal); }
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); margin-top: 0.5rem; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--violet), var(--rose));
  transition: width .5s ease;
}

.tick-select { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.8rem 0; max-height: 320px; overflow-y: auto; }
.tick-row {
  display: flex; gap: 0.7rem; align-items: center; padding: 0.55rem 0.8rem;
  border: 1px solid var(--line); border-radius: 10px; font-size: 0.88rem; cursor: pointer;
}
.tick-row:hover { border-color: var(--teal); }
.tick-row input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }
.tick-row .tinfo { flex: 1; }
.tick-row .taddr { font-family: ui-monospace, monospace; font-size: 0.72rem; color: var(--teal); word-break: break-all; }
.tick-row.disabled { opacity: 0.45; cursor: not-allowed; }
.tick-row .utxo-note { font-size: 0.78rem; color: var(--violet); }

.review { display: grid; grid-template-columns: 130px 1fr; gap: 0.3rem 0.8rem; font-size: 0.9rem; margin: 0.8rem 0; }
.review dt { color: var(--dim); }
.review dd { margin: 0; word-break: break-all; }
.asm {
  background: rgba(4,11,26,.9); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem; font-size: 0.8rem; overflow-x: auto; color: var(--violet);
}
.limits ul { margin: 0.5rem 0; padding-left: 1.2rem; color: var(--dim); }
.limits li { margin-bottom: 0.4rem; }

footer {
  max-width: 1060px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
  color: var(--dim); font-size: 0.85rem; border-top: 1px solid var(--line);
}
footer a { color: var(--teal); }
footer code { color: var(--teal); font-size: 0.78rem; word-break: break-all; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .dashboard { grid-template-columns: repeat(2, 1fr); }
  .review { grid-template-columns: 1fr; }
}

/* Keyboard focus: a visible ring in this app's accent on every interactive element (fleet focus-visible pass). */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Skip link: the first Tab stop on the page — parked off-screen until keyboard focus reveals it (fleet skip-link pass). */
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 1000; padding: 10px 16px; border: 2px solid var(--amber); border-radius: 8px; background: #0b0e14; color: var(--amber); font-weight: 700; text-decoration: none; transition: top .15s ease; }
.skip-link:focus-visible { top: 12px; }
main:focus { outline: none; }

/* Reduced motion: when the OS asks for reduced motion, animations and transitions finish near-instantly and scrolling is not smoothed (fleet reduced-motion pass). Near-zero durations — not animation: none — so fade-ins still land on their end state and no content can be stranded invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Touch targets (fleet WCAG 2.5.8 pass): native checkboxes/radios measured 13-18px in the fleet probe — size them to the 24px minimum. */
input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; flex: none; }
.tick-row input[type="checkbox"] { width: 24px; height: 24px; }
