/* Copyright 2026 The Shinerium Authors
 * SPDX-License-Identifier: LGPL-3.0-or-later
 *
 * The claim page's styles. Paper and ink, with gold kept for what the
 * person gets. No web fonts: the page loads nothing from elsewhere. */

:root {
  --paper: #f7f8fa;
  --surface: #ffffff;
  --ink: #14213d;
  --ink-soft: #4a5876;
  --line: #d9dee7;
  --shine: #f2b705;
  --shine-soft: #fdf3d3;
  --good: #1e7f4f;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --on-ink: #ffffff;
  --font: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1424;
    --surface: #151d31;
    --ink: #e8ecf4;
    --ink-soft: #a9b4c9;
    --line: #2a3654;
    --shine: #f5c542;
    --shine-soft: #2e2810;
    --good: #5fd39b;
    --bad: #ff9b91;
    --bad-soft: #3a1a1a;
    --on-ink: #0e1424;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

@media (min-width: 640px) {
  .page { padding: 64px 24px 96px; }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Masthead */

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.spark { width: 20px; height: 20px; fill: var(--shine); }

h1 {
  margin: 0 0 12px;
  font-size: 2.15rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h2 { margin: 0 0 12px; font-size: 1.3rem; line-height: 1.25; }
h3 { margin: 0 0 6px; font-size: 1rem; line-height: 1.35; }

.lead { margin: 0 0 8px; font-size: 1.1rem; color: var(--ink-soft); max-width: 34em; }
.period { margin: 0; min-height: 1.55em; font-size: 0.94rem; color: var(--ink-soft); }

/* The check */

.check { margin-top: 36px; }

label { display: block; font-weight: 600; margin-bottom: 6px; }

input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 1rem/1.3 var(--mono);
}

input[type="text"]::placeholder { color: var(--ink-soft); }

.field { display: flex; gap: 8px; }
.field input { flex: 1; }

@media (max-width: 480px) {
  .field { flex-direction: column; }
}

button {
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

button.primary { background: var(--ink); color: var(--on-ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

button.wallet { display: inline-flex; align-items: center; gap: 10px; margin: 0 8px 8px 0; }
button.wallet img { width: 20px; height: 20px; border-radius: 4px; }

:focus-visible { outline: 3px solid var(--shine); outline-offset: 2px; }

.hint { margin: 8px 0 0; font-size: 0.9rem; color: var(--ink-soft); }

/* The result: the one bold moment */

.result {
  margin-top: 24px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--shine);
  border-radius: var(--radius);
  background: var(--surface);
}

.result > :first-child { margin-top: 0; }
.result > :last-child { margin-bottom: 0; }

.result-label { margin: 0; color: var(--ink-soft); }

.amount {
  margin: 2px 0 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.amount-figure { font-size: 2.9rem; font-weight: 700; letter-spacing: -0.02em; }
.amount-unit { font-size: 1.3rem; font-weight: 600; margin-left: 3px; }

.split { margin-top: 14px; }

.bar {
  height: 10px;
  border-radius: 5px;
  background: var(--line);
  overflow: hidden;
}

.bar-now { display: block; height: 100%; background: var(--shine); }

.split-text { margin: 8px 0 0; font-size: 0.95rem; }

@media (prefers-reduced-motion: no-preference) {
  .result:not([hidden]) { animation: reveal 220ms ease-out; }
  @keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Messages */

.msg { margin: 10px 0 0; }
.msg-bad { color: var(--bad); }
.msg-good { color: var(--good); font-weight: 600; }
.msg-detail { margin: 4px 0 0; font-size: 0.85rem; color: var(--ink-soft); overflow-wrap: anywhere; }

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bad-soft);
  color: var(--bad);
}

/* The steps: a real sequence, numbered */

.claim { margin-top: 40px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }

.step {
  position: relative;
  padding: 0 0 26px 48px;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -2px;
  width: 30px; height: 30px;
  border: 2px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--paper);
}

.step::after {
  content: "";
  position: absolute;
  left: 14px; top: 32px; bottom: 2px;
  width: 2px;
  background: var(--line);
}

.step:last-child::after { display: none; }
.step.is-current::before { border-color: var(--ink); color: var(--ink); }
.step.is-done::before { content: "✓"; border-color: var(--good); color: var(--good); }
.step.is-todo h3 { color: var(--ink-soft); }

.step-body p { margin: 0 0 10px; }

.addr { font-family: var(--mono); font-size: 0.92em; overflow-wrap: anywhere; }

.choices { border: 0; margin: 0; padding: 0; }
.choice { display: flex; align-items: baseline; gap: 10px; font-weight: 400; margin: 0 0 6px; cursor: pointer; }
.choice input { accent-color: var(--ink); }
.other { margin-top: 12px; }

.summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary dt { color: var(--ink-soft); }
.summary dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.progress { margin-top: 14px; }
.progress p { margin: 0 0 6px; }

/* Safety and details */

.safety {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.safety ul { margin: 0; padding-left: 1.2em; }
.safety li { margin-bottom: 6px; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.advanced { margin-top: 24px; }
.advanced summary { cursor: pointer; font-weight: 600; }
.advanced dl { margin: 12px 0 0; }
.advanced dt { color: var(--ink-soft); margin-top: 10px; }
.advanced dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.advanced code { font-family: var(--mono); font-size: 0.85rem; }
.proof { margin: 4px 0 0; padding-left: 2.2em; }
