/* scrollworks.ai/account and /account/return: the site's look (index.html's
   tokens, light and dark), system fonts, no inline styles (the pages' CSP
   allows `style-src 'self'` only). Colour means status: the accent is what
   you tap; green, amber and grey only say a plan's state. */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --text: #14151a;
  --muted: #535866;
  --line: #e3e4ea;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-soft: #eef0ff;
  --accent-ink: #ffffff;
  --ok: #157f3b;
  --attention: #a15c00;
  --attention-soft: #fff6e5;
  --off: #6b7080;
  --error: #b42318;
  --shadow: 0 1px 2px rgb(20 21 26 / 4%), 0 12px 32px -12px rgb(20 21 26 / 12%);
  --radius: 20px;
  --max: 40rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f13;
    --surface: #16181e;
    --text: #ecedf1;
    --muted: #a4a8b4;
    --line: #282b35;
    --accent: #a5b4fc;
    --accent-hover: #c7d2fe;
    --accent-soft: #1d2036;
    --accent-ink: #0e0f13;
    --ok: #4ade80;
    --attention: #fbbf24;
    --attention-soft: #2a2312;
    --off: #8c91a0;
    --error: #fca5a5;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px -12px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.875rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  z-index: 10;
}
.skip:focus {
  top: 1rem;
}

/* Header */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.brand svg {
  width: 28px;
  height: 28px;
  flex: none;
}
.who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

main {
  flex: 1;
  padding-block: clamp(1.25rem, 5vw, 3rem) clamp(2.5rem, 7vw, 4.5rem);
}
h1 {
  font-size: clamp(1.75rem, 6.5vw, 2.375rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}
.lead {
  margin-top: 0.625rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

/* Cards */
.card {
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 5vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card {
  margin-top: 1rem;
}
.card.is-focused {
  border-color: var(--accent);
}
.card h2 {
  font-size: 1.1875rem;
  font-weight: 700;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  flex: none;
  box-shadow: 0 0 0 1px var(--line);
}
.plan-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-top: 0.125rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--off);
  flex: none;
}
.dot[data-tone='ok'] {
  background: var(--ok);
}
.dot[data-tone='attention'] {
  background: var(--attention);
}
.plan-name {
  color: var(--text);
  font-weight: 600;
}
.lines {
  margin-top: 0.875rem;
  display: grid;
  gap: 0.375rem;
}
.lines p {
  color: var(--muted);
  font-size: 0.975rem;
}
.lines p.attention {
  color: var(--text);
  background: var(--attention-soft);
  border-left: 3px solid var(--attention);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
.badge {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Buttons: one filled primary per state; the rest outlined or plain. */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.button-primary:hover {
  background: var(--accent-hover);
}
.button-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}
.button-secondary:hover {
  border-color: var(--accent);
}
.button[aria-disabled='true'],
.button:disabled {
  opacity: 0.6;
  cursor: progress;
}
.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
  cursor: pointer;
}
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1rem;
  margin-top: 0.5rem;
}
.hint {
  margin-top: 0.625rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.center {
  text-align: center;
}

/* Paying ahead with bitcoin: the periods, inside the app's card. */
.periods {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}
.periods legend {
  padding: 0;
  font-weight: 650;
  font-size: 1rem;
}
.period {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 0.75rem;
  margin-top: 0.5rem;
  padding: 0.75rem 0.875rem;
  min-height: 3.25rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.period.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.period input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--accent);
}
.period-name {
  font-weight: 600;
}
.period-price {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.period-note {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 0.875rem;
}
.bitcoin-title {
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  font-weight: 700;
}
.bitcoin-title:focus {
  outline: none;
}

/* Signing in */
.ways > * + * {
  margin-top: 1.25rem;
}
.or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.or::before,
.or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}
label.field-label {
  display: block;
  font-weight: 650;
}
.key-input {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.5rem;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem;
}
.key-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.qr-box {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
}
.qr {
  width: min(15rem, 70vw);
  aspect-ratio: 1;
}
.qr-svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
}
.qr-bg {
  fill: #ffffff;
}
.qr-dark {
  fill: #14151a;
}
.qr-box[data-state='loading'] .qr,
.qr-box[data-state='expired'] .qr,
.qr-box[data-state='error'] .qr {
  opacity: 0.2;
}
.qr-meta {
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.qr-code {
  color: var(--text);
  letter-spacing: 0.06em;
}

.status {
  margin-top: 1rem;
  min-height: 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.status:empty {
  margin-top: 0;
  min-height: 0;
}
.status[data-tone='error'] {
  color: var(--error);
  font-weight: 600;
}
.fine {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.fine p + p {
  margin-top: 0.5rem;
}

/* The return page: one centred moment. */
.moment {
  text-align: center;
}
.moment .app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin: 0 auto 1.25rem;
  display: block;
}
.moment .lines {
  justify-items: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer .wrap {
  padding-block: 1.5rem 2rem;
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .period {
    transition:
      background-color 120ms ease,
      border-color 120ms ease;
  }
}
