/* Styles consume theme.css tokens only. */

/* Timeless Sans Grotesk 1.094 static cuts, Timeless Free Font License 1.2 (fonts/LICENSE.pdf). */
@font-face {
  font-family: "Timeless Grotesk";
  src: url("fonts/TimelessSans-GroteskRegular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Timeless Grotesk";
  src: url("fonts/TimelessSans-GroteskMedium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Timeless Grotesk";
  src: url("fonts/TimelessSans-GroteskSemibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--cte-canvas);
  color: var(--cte-text);
  font-family: var(--font-ui);
  font-weight: var(--weight-ui-regular);
  font-size: var(--size-s);
  line-height: var(--line-s);
  letter-spacing: var(--letter-spacing-s);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

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

.app {
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--space-m) var(--space-m) 140px;
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.screen { display: flex; flex-direction: column; gap: var(--space-l); }
/* Fade in on a new screen only (app.js adds .enter), not on each redraw. */
.screen.enter { animation: enter var(--motion-large-duration) var(--motion-large-easing); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .screen.enter { animation: none; } }

.stack { display: flex; flex-direction: column; gap: var(--space-s); }
.stack-xs { display: flex; flex-direction: column; gap: var(--space-xs); }
.row { display: flex; align-items: center; gap: var(--space-xs); }
.spread { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-s); }

/* Typography roles */
.t-title { font-family: var(--font-brand); font-weight: var(--weight-brand-medium); font-size: var(--size-l); line-height: var(--line-l); letter-spacing: var(--letter-spacing-l); }
.t-hero { font-family: var(--font-data); font-weight: var(--weight-data-medium); font-size: var(--size-xxl); line-height: var(--line-xxl); letter-spacing: var(--letter-spacing-xxl); font-variant-numeric: tabular-nums; }
.t-m { font-size: var(--size-m); line-height: var(--line-m); letter-spacing: var(--letter-spacing-m); }
.t-strong { font-weight: var(--weight-ui-medium); }
.t-detail { font-size: var(--size-xs); line-height: var(--line-xs); letter-spacing: var(--letter-spacing-xs); color: var(--cte-text-muted); }
.t-muted { color: var(--cte-text-muted); }
/* Landing example: the low-rate number gets a red underline, the higher-rate number a green one. */
.u-bad, .u-good { font-weight: 600; text-decoration: underline 3px; text-underline-offset: 4px; }
.u-bad { text-decoration-color: var(--error); }
.u-good { text-decoration-color: var(--success); }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); font-family: var(--font-brand); font-weight: var(--weight-brand-heavy); }
/* Brand mark: app icon look. Radius 22.37% of the side (Apple icon ratio). Light from the top, soft drop shadow. */
.mark {
  --mark-size: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--mark-size); height: var(--mark-size);
  padding-bottom: calc(var(--mark-size) * 0.08);
  border-radius: calc(var(--mark-size) * 0.2237);
  background: linear-gradient(180deg, var(--neutral-1-transparent), transparent 70%), var(--color-1);
  box-shadow: inset 0 1px 0 var(--neutral-1-transparent), var(--shadow-m);
  color: var(--neutral-2);
  font-size: calc(var(--mark-size) * 0.55); line-height: 1; letter-spacing: -0.02em;
}
/* Start page: two small z float up and fade, once (app.js mark). */
.mark { position: relative; }
.zfloat { position: absolute; left: 100%; bottom: 70%; font-size: 11px; color: var(--color-1); opacity: 0; animation: zfloat 1600ms var(--motion-large-easing) forwards; }
.zfloat + .zfloat { font-size: 8px; animation-delay: 350ms; }
@keyframes zfloat { 0% { opacity: 0; transform: translate(-4px, 6px) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -14px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .zfloat { display: none; } }

/* Progress (Progress: track neutral-3, indicator color-1, radius full) */
.progress { height: var(--space-xxs); border-radius: var(--radius-full); background: var(--neutral-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: var(--radius-full); background: var(--color-1); transition: width var(--motion-large-duration) var(--motion-large-easing); }

/* Button (control padding s / l, radius s, label s medium tracking l) */
.btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-s) var(--space-l);
  border-radius: var(--radius-s);
  font: inherit;
  font-family: var(--font-ui);
  font-weight: var(--weight-ui-medium);
  font-size: var(--size-s);
  line-height: var(--line-s);
  letter-spacing: var(--tracking-l);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion-duration) var(--motion-easing), box-shadow var(--motion-duration) var(--motion-easing), transform var(--motion-duration) var(--motion-easing);
}
.btn:active { transform: translateY(var(--motion-press-distance)); }
.btn svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--color-1); color: var(--neutral-1); box-shadow: var(--border-shadow-none); }
.btn-primary:hover { box-shadow: var(--shadow-s); }
.btn-primary:disabled { background: var(--neutral-3); color: var(--neutral-6); cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--color-1-transparent); color: var(--neutral-10); box-shadow: var(--border-shadow-s); }
.btn-secondary:hover { background: var(--neutral-4-transparent); }
.btn-ghost { background: var(--color-none); color: var(--neutral-10); }
.btn-ghost:hover { background: var(--neutral-3-transparent); }
.btn-icon { padding: var(--space-xs); }
/* Large: the two main actions (Start, Pay). 66px tall vs 52px. */
.btn-l { padding: var(--space-m) var(--space-l); border-radius: var(--radius-m); font-size: var(--size-m); line-height: var(--line-m); }
.btn-l svg { width: 20px; height: 20px; }

/* Text field (control neutral-3, padding s / m, radius s) */
.field { display: flex; flex-direction: column; gap: var(--space-xs); }
.field label { font-weight: var(--weight-ui-medium); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--neutral-3);
  color: var(--neutral-10);
  box-shadow: var(--border-shadow-s);
  padding: var(--space-s) var(--space-m);
  font-family: var(--font-ui);
  font-size: var(--size-m);
  line-height: var(--line-m);
  letter-spacing: var(--letter-spacing-m);
}
.input::placeholder { color: var(--neutral-6); }
.input:focus-visible { outline: 2px solid var(--cte-focus); outline-offset: 0; }
.input-affix { position: absolute; color: var(--cte-text-muted); pointer-events: none; font-size: var(--size-m); line-height: var(--line-m); }
.input-affix.pre { left: var(--space-m); }
.input-affix.post { right: var(--space-m); }
.input.has-pre { padding-left: calc(var(--space-m) + var(--space-s)); }
.input.has-post { padding-right: calc(var(--space-m) + var(--space-l)); }
/* Amount field: transparent input text, the mirror draws it (app.js mirror). Same box, font and padding, no kerning, so the caret lines up. */
.amount-input, .input-mirror { font-kerning: none; }
.amount-input { color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--neutral-10); }
.amount-input::placeholder { color: var(--neutral-6); -webkit-text-fill-color: var(--neutral-6); }
.input-mirror {
  position: absolute; inset: 0; pointer-events: none; white-space: pre; overflow: hidden;
  padding: var(--space-s) var(--space-m);
  color: var(--neutral-10);
  font-size: var(--size-m); line-height: var(--line-m); letter-spacing: var(--letter-spacing-m);
}
.input-mirror.has-pre { padding-left: calc(var(--space-m) + var(--space-s)); }
.comma { display: inline-block; }
.comma.pop { animation: comma-in var(--motion-duration) var(--motion-easing); }
@keyframes comma-in { from { opacity: 0; transform: translateY(-0.35em) scale(0.6); } }
@media (prefers-reduced-motion: reduce) { .comma.pop { animation: none; } }

/* Toggle group used as choice list (control hover/pressed neutral-3, radius s) */
.choices { display: flex; flex-direction: column; gap: var(--space-xxs); }
.choice {
  appearance: none; border: 0; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-s);
  background: var(--neutral-2);
  color: var(--neutral-10);
  font: inherit; font-weight: var(--weight-ui-medium); font-size: var(--size-m); line-height: var(--line-m);
  transition: background-color var(--motion-duration) var(--motion-easing);
}
.choice:hover { background: var(--neutral-3); }
.choice[aria-pressed="true"] { background: var(--color-1-transparent); }
.choice svg { width: 20px; height: 20px; color: var(--color-1); }

/* Combobox options */
.options { display: flex; flex-direction: column; gap: var(--space-xxs); }
.option { appearance: none; border: 0; background: none; text-align: left; cursor: pointer; padding: var(--space-xs); border-radius: var(--radius-xs); color: var(--neutral-10); font: inherit; display: flex; justify-content: space-between; }
.option:hover { background: var(--neutral-3); }
.option[aria-selected="true"] { background: var(--neutral-2); }
.option { align-items: center; }
/* Bank logo: app icon corners like .mark, hairline so white icons keep an edge. */
.bank-logo { flex: none; width: 28px; height: 28px; border-radius: calc(28px * 0.2237); outline: 1px solid var(--neutral-4); outline-offset: -1px; }
.bank-logo-none { display: inline-flex; align-items: center; justify-content: center; background: var(--neutral-3); color: var(--cte-text-muted); outline: 0; }
.bank-logo-none svg { width: 18px; height: 18px; }

/* Surfaces */
.card { border-radius: var(--radius-m); background: var(--cte-surface); box-shadow: var(--border-shadow-s), var(--shadow-none); padding: var(--space-m); }
.card-muted { background: var(--cte-surface-muted); }
.card-balance { background: var(--emphasis-balance-background); color: var(--cte-accent-text); border-radius: var(--radius-l); padding: var(--space-l) var(--space-m); }
.card-balance .t-detail { color: inherit; }
.callout { display: flex; gap: var(--space-xs); align-items: flex-start; padding: var(--space-s); border-radius: var(--radius-s); background: var(--warning-transparent); }
.callout svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }

.divider { height: 0; box-shadow: inset 0 -1px 0 var(--neutral-4); }


/* Disclosure */
details > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-weight: var(--weight-ui-medium); padding: var(--space-s) 0; }
details > summary::-webkit-details-marker { display: none; }
details > summary svg { width: 18px; height: 18px; transition: transform var(--motion-duration) var(--motion-easing); }
/* .is-open, not [open]: [open] stays set while the close animation runs (app.js toggleDetails). */
details.is-open > summary svg { transform: rotate(180deg); }


/* Guide list */
.guide { margin: 0; padding-left: var(--space-m); display: flex; flex-direction: column; gap: var(--space-xxs); }

.center { text-align: center; }

/* Landing: how it works */
.steps { margin: 0; padding-left: var(--space-m); display: flex; flex-direction: column; gap: var(--space-xs); }
.faq details > p { padding-bottom: var(--space-s); }
.faq details + details { box-shadow: inset 0 1px 0 var(--neutral-4); }

/* Footer: every screen and the privacy page */
.footer { margin-top: auto; padding-top: var(--space-l); display: flex; flex-direction: column; gap: var(--space-xxs); }

/* Privacy page */
.prose { display: flex; flex-direction: column; gap: var(--space-s); }
.prose ul { margin: 0; padding-left: var(--space-m); display: flex; flex-direction: column; gap: var(--space-xs); }
a.brand { color: inherit; text-decoration: none; }
.footer a, .prose a { color: inherit; }
.prose strong { font-weight: var(--weight-ui-medium); }
