/* Bouclier's payment pages, in the iOS 27 look (Daniel's design standard): grouped cards on the grouped background,
   the system font, iOS system colours in light and dark. Glyphs are Bouclier's own drawings (CSS masks). */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7; --card: #ffffff; --text: #000000; --muted: rgba(60, 60, 67, 0.6); --line: rgba(60, 60, 67, 0.18);
  --fill: rgba(118, 118, 128, 0.12);
  --accent: #007aff; --good: #34c759; --good-text: #248a3d; --warn: #ff9500; --warn-text: #c93400; --danger: #ff3b30;
  --gray: #8e8e93;
  --r-card: 22px; --r-control: 14px; --r-field: 12px;
  --card-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --text: #ffffff; --muted: rgba(235, 235, 245, 0.6); --line: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --accent: #0a84ff; --good: #30d158; --good-text: #30d158; --warn: #ff9f0a; --warn-text: #ff9f0a; --danger: #ff453a;
    --card-shadow: none;
  }
}
@media (prefers-contrast: more) {
  :root { --muted: rgba(60, 60, 67, 0.85); --line: rgba(60, 60, 67, 0.4); }
  @media (prefers-color-scheme: dark) { :root { --muted: rgba(235, 235, 245, 0.85); --line: rgba(84, 84, 88, 0.9); } }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, "SF Pro Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
main { max-width: 620px; margin: 0 auto; padding: 40px 16px 48px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* the large title */
.hero { display: flex; gap: 16px; align-items: center; margin: 0 4px 26px; }
.hero img { width: 64px; height: 64px; flex: 0 0 auto; filter: drop-shadow(0 6px 14px rgba(0, 70, 190, 0.22)); }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.hero p { margin: 4px 0 0; color: var(--muted); }
h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

/* grouped cards */
section { background: var(--card); border-radius: var(--r-card); padding: 18px 20px 20px; margin-bottom: 18px; box-shadow: var(--card-shadow); }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
section p { margin: 0 0 12px; }
section p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* a white glyph on a coloured rounded square, as in Settings */
.sym { --sym-bg: var(--accent); flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; background: var(--sym-bg); display: grid; place-items: center; }
.sym::before {
  content: ""; width: 19px; height: 19px; background: #fff;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
}
.sym-key { --sym-bg: var(--warn); --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Ccircle cx=%228%22 cy=%2212%22 r=%224.2%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22/%3E%3Cpath d=%22M12.2 12h8.3M17.6 12v3.4M20.5 12v2.6%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222.2%22/%3E%3C/svg%3E"); }
.sym-bag { --sym-bg: var(--accent); --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M5.2 8.2h13.6l-1 11.2a1.8 1.8 0 0 1-1.8 1.6H8a1.8 1.8 0 0 1-1.8-1.6z%22 fill=%22none%22 stroke=%22%23000%22 stroke-linejoin=%22round%22 stroke-width=%222%22/%3E%3Cpath d=%22M8.8 10.4V7.2a3.2 3.2 0 0 1 6.4 0v3.2%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-width=%222%22/%3E%3C/svg%3E"); }
.sym-gift { --sym-bg: #ff2d55; --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Crect x=%223.6%22 y=%228.4%22 width=%2216.8%22 height=%224.4%22 rx=%221.2%22/%3E%3Cpath d=%22M5.4 12.8h13.2v6.4a1.6 1.6 0 0 1-1.6 1.6H7a1.6 1.6 0 0 1-1.6-1.6z%22/%3E%3Cpath d=%22M12 8.4c-1.2-2.9-4.6-4.3-5.4-2.4-.6 1.4 1.6 2.4 5.4 2.4zm0 0c1.2-2.9 4.6-4.3 5.4-2.4.6 1.4-1.6 2.4-5.4 2.4z%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22/%3E%3Cpath d=%22M12 8.4v12.4%22 stroke=%22%23fff%22 stroke-width=%221.6%22/%3E%3C/svg%3E"); }
.sym-life { --sym-bg: var(--gray); --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228.4%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223.6%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22/%3E%3Cpath d=%22M6.1 6.1l3.4 3.4M17.9 6.1l-3.4 3.4M6.1 17.9l3.4-3.4M17.9 17.9l-3.4-3.4%22 stroke=%22%23000%22 stroke-width=%222.4%22/%3E%3C/svg%3E"); }
.sym-tray { --sym-bg: var(--accent); --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 3.6v9.6M8 9.4l4 4 4-4%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222.2%22/%3E%3Cpath d=%22M4 14.4v3.1a2.2 2.2 0 0 0 2.2 2.2h11.6a2.2 2.2 0 0 0 2.2-2.2v-3.1%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222.2%22/%3E%3C/svg%3E"); }
.sym-check { --sym-bg: var(--good); --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 2.6l7.4 2.8v6c0 4.6-3 8.3-7.4 10-4.4-1.7-7.4-5.4-7.4-10v-6z%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22/%3E%3Cpath d=%22M8.6 12.1l2.4 2.4 4.4-4.6%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222.2%22/%3E%3C/svg%3E"); }

.sym-people { --sym-bg: #af52de; --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Ccircle cx=%229%22 cy=%228.2%22 r=%223.4%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22/%3E%3Cpath d=%22M3 19.6c.6-3.4 3-5.3 6-5.3s5.4 1.9 6 5.3%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-width=%222%22/%3E%3Ccircle cx=%2216.8%22 cy=%228.9%22 r=%222.6%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22/%3E%3Cpath d=%22M17.6 14.4c2.1.3 3.5 1.9 3.9 4.7%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-width=%221.8%22/%3E%3C/svg%3E"); }
.sym-link { --sym-bg: var(--good); --glyph: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M10.2 13.8a4 4 0 0 0 5.7 0l3.2-3.2a4 4 0 0 0-5.7-5.7l-1.2 1.2%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-width=%222.2%22/%3E%3Cpath d=%22M13.8 10.2a4 4 0 0 0-5.7 0l-3.2 3.2a4 4 0 0 0 5.7 5.7l1.2-1.2%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-width=%222.2%22/%3E%3C/svg%3E"); }

/* "invite 3 friends": one round per friend, ticked when that friend bought */
.progress { display: flex; gap: 10px; margin: 4px 0 12px; }
.progress span { width: 38px; height: 38px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; }
.progress span.done { background: var(--good); }
.progress span.done::before {
  content: ""; width: 22px; height: 22px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22%3E%3Cpath d=%22M5.6 10.3l2.9 2.9 5.9-6.2%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222.4%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22%3E%3Cpath d=%22M5.6 10.3l2.9 2.9 5.9-6.2%22 fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222.4%22/%3E%3C/svg%3E") center / contain no-repeat;
}
.count { font-weight: 600; }

/* buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: var(--r-control); font: inherit; font-weight: 600; cursor: pointer;
  background: var(--fill); color: var(--accent); text-decoration: none; text-align: center; transition: transform .12s, opacity .12s;
}
.button:hover { text-decoration: none; opacity: .9; }
.button:active { transform: scale(.97); }
.button.primary { background: var(--accent); color: #fff; }
.button.wide { width: 100%; }
.button.wide + p { margin-top: 12px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.buttons .button { flex: 1 1 140px; }

/* the code */
.code {
  display: block; margin: 6px 0 0; padding: 12px 14px; border-radius: var(--r-field); background: var(--fill);
  font: 14px/1.45 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; user-select: all; -webkit-user-select: all;
}
.label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; margin: 0 0 2px 2px; }

#result > .small, #link-card > .small { margin-top: 12px; }

/* status lines */
.status { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; }
.status::before { content: ""; flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: var(--gray); }
.status.ok { color: var(--good-text); font-weight: 600; }
.status.ok::before { background: var(--good) url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22%3E%3Cpath d=%22M5.6 10.3l2.9 2.9 5.9-6.2%22 fill=%22none%22 stroke=%22%23fff%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222.2%22/%3E%3C/svg%3E") center / 20px no-repeat; }
.status.warn { color: var(--warn-text); }
.status.warn::before { background: var(--warn) url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22%3E%3Cpath d=%22M10 5.4v5.6%22 stroke=%22%23fff%22 stroke-linecap=%22round%22 stroke-width=%222.4%22/%3E%3Ccircle cx=%2210%22 cy=%2214.4%22 r=%221.4%22 fill=%22%23fff%22/%3E%3C/svg%3E") center / 20px no-repeat; }
.status.info::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 20 20%22%3E%3Cpath d=%22M10 9v5.4%22 stroke=%22%23fff%22 stroke-linecap=%22round%22 stroke-width=%222.4%22/%3E%3Ccircle cx=%2210%22 cy=%225.8%22 r=%221.4%22 fill=%22%23fff%22/%3E%3C/svg%3E") center / 20px no-repeat; }
.spinner::before { background: conic-gradient(var(--accent) 0 25%, var(--fill) 0) border-box; -webkit-mask: radial-gradient(circle, transparent 6px, #000 6.5px); mask: radial-gradient(circle, transparent 6px, #000 6.5px); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .spinner::before { animation: none; } .button { transition: none; } }

footer { text-align: center; color: var(--muted); font-size: 14px; margin-top: 26px; }
footer a { margin: 0 8px; }
[hidden] { display: none !important; }
@media (max-width: 480px) {
  main { padding-top: 24px; }
  h1 { font-size: 26px; }
  .hero img { width: 56px; height: 56px; }
  .buttons { flex-direction: column; }
  .buttons .button { flex: 0 0 auto; }
}
