/* go.{$ZZMONEY_DOMAIN}'s page. Light or dark with the phone, but the QR code is
   always dark on light: that is the order a scanner reads. The accent is the
   wallet's (frontend/flutter/apps/wallet/lib/colors.dart). */
:root {
  color-scheme: light dark;
  --ground: #f2f2f7;
  --card: #ffffff;
  --ink: #1c1c1e;
  --quiet: #6c6c70;
  --hairline: rgba(60, 60, 67, 0.18);
  --accent: #2f5f8f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 95, 143, 0.12);
  --good: #087a52;
  --good-soft: rgba(8, 122, 82, 0.1);
  --critical: #c4141f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #000000;
    --card: #1c1c1e;
    --ink: #f2f2f7;
    --quiet: #a1a1a6;
    --hairline: rgba(84, 84, 88, 0.6);
    --accent: #6ea3d8;
    --accent-ink: #0c0c0c;
    --accent-soft: rgba(110, 163, 216, 0.16);
    --good: #5fd39b;
    --good-soft: rgba(95, 211, 155, 0.14);
    --critical: #ff6961;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* One language at a time once links.js has picked it; the no-script page
   (#app) is outside .flow and keeps both. */
html[data-lang="bn"] .flow [lang="en"],
html[data-lang="en"] .flow [lang="bn"] {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Noto Sans", sans-serif;
}

.top,
main {
  width: 100%;
  max-width: 28rem;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
}

.langs {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.langs button {
  appearance: none;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--quiet);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.langs button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

main,
.flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  padding: 24px;
  border-radius: 20px;
  background: var(--card);
}

h1,
h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
  line-height: 1.35;
}

p {
  margin: 0 0 12px;
}

#app h2 {
  margin-top: 20px;
}

#app p:last-child,
.flow p {
  margin: 0;
}

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

/* While whom and how much is still being asked, through any backoff: the mark
   breathing in a sweeping ring, the apps' working loader. Classes and
   keyframes only — the page's policy allows no inline style. */
.checking {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--quiet);
  font-weight: 600;
}

.loader {
  position: relative;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
}

.loader::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader img {
  width: 1.25rem;
  height: 1.25rem;
  animation: breathe 1.2s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader::before,
  .loader img {
    animation: none;
  }
}

/* Whom it pays and how much, with the time left beside it. */
.ask {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.due {
  min-width: 0;
}

.merchant {
  font-size: 0.9375rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.flow .amount {
  margin-top: 2px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.amount .unit {
  color: var(--quiet);
  font-size: 1rem;
  font-weight: 600;
}

.timer {
  flex: none;
  text-align: right;
}

.label {
  color: var(--quiet);
  font-size: 0.75rem;
}

.left {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.left.soon {
  color: var(--critical);
}

.done {
  text-align: center;
}

.done .good {
  color: var(--good);
}

.done p {
  color: var(--quiet);
}

.flow .back {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 0.9375rem;
}

#back-now {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

/* The code, as a payment page shows it: what it is, the code, the link. */
.qr-card {
  text-align: center;
}

.qr-card h1 {
  font-size: 1.25rem;
}

.lead {
  color: var(--quiet);
}

figure {
  margin: 20px 0 0;
}

svg.qr {
  display: block;
  width: min(240px, 70vw);
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--hairline);
}

svg.qr .light {
  fill: #ffffff;
}

svg.qr .dark {
  fill: #000000;
}

figcaption {
  margin-top: 12px;
  color: var(--quiet);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

#copy {
  appearance: none;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 20px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

#copy:not(.done) .ok,
#copy.done .idle {
  display: none;
}

#copy.done {
  color: var(--good);
}

.flow .safe {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: left;
}

.safe svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.steps ol {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9375rem;
  line-height: 1.5;
  counter-increment: step;
}

/* A hidden step is display: none, so it does not count. */
.steps li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
}

html[data-lang="bn"] .steps li::before {
  content: counter(step, bengali);
}

.quiet {
  color: var(--quiet);
  font-size: 0.9375rem;
}
