/*
  Smoking Ends Here look for the deprivation calculator variants.
  Colours and fonts from the SEH brand guidelines v8 (refs/seh-brand-guidelines-v8.pdf).
  Layout ideas (calm page, cards, one bright fill at a time) carried over from Quit28.
*/
@font-face { font-family: "Alternate Gothic"; src: url("../assets/alternategothicno1.otf") format("opentype"); font-display: swap; }
/* Only the bold Forma is on file (a testing licence), so it is used for labels, buttons and numbers. */
@font-face { font-family: "Forma"; src: url("../assets/FormaDJRDisplay-Bold-Testing.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root[data-accent="pink"] { --go: var(--pink); }
:root {
  --ink: #000; --grey: #333; --muted: #555; --page: #fff; --tile: #f3f3ef; --line: #e4e4de;
  --green: #06fb06; --cyan: #00a7fa; --blue: #006fef; --red: #ed1652; --pink: #f31a7b;
  --orange: #ffb22c; --lime: #4aed16; --aqua: #13d8eb;
  --head: "Alternate Gothic", "Arial Narrow", Impact, sans-serif;
  --bold: "Forma", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  /* Headline weight, size scale and tracking: Quit28's Manrope needs heavier, smaller and tighter (quit28.css). */
  --hw: 400; --hs: 1; --ht: .005em;
  --chosen: var(--ink); --chosen-ink: #fff; --accent: var(--red);
  /* The one button we most want tapped: SEH red, or ?accent=pink (shared/mode.js). */
  --go: var(--red);
  /* Fill for tappable things sitting on the page. */
  --well: var(--tile); --well-shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 18px/1.45 var(--body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
/* No double-tap zoom on phones when tapping + and − quickly. */
button, a, input, label { touch-action: manipulation; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { width: min(100%, 480px); margin: 0 auto; padding: 0 20px 48px; }

/* Logos: SEH block top left, NHS Cheshire and Merseyside top right (brand guidelines, logo pages). */
.logos { display: flex; justify-content: space-between; align-items: flex-start; padding-top: 16px; margin-bottom: 20px; }
.logos .seh { width: 76px; }
.logos .nhs { width: 132px; margin-top: 4px; }

h1, h2, .head { font-family: var(--head); font-weight: var(--hw); line-height: .95; letter-spacing: var(--ht); margin: 0; }
h1 { font-size: calc(clamp(44px, 13vw, 60px) * var(--hs)); }
h2 { font-size: calc(38px * var(--hs)); }
.label { font: 700 15px/1.2 var(--bold); letter-spacing: .02em; }
.small { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* The red full stop from the logo, used after big numbers. */
.dot::after { content: ""; display: inline-block; width: .16em; height: .16em; margin-left: .06em; border-radius: 50%; background: var(--red); }

/* Progress, drawn like the logo's bar and dot: the bar grows each step and the dot rides its end. Set --p (0 to 1). */
.progress { position: relative; height: 16px; margin: 4px 17px 8px 0; }
.progress i { position: absolute; left: 0; top: 2px; height: 12px; width: calc(12px + (100% - 12px) * var(--p, 0)); background: var(--ink); transition: width .55s cubic-bezier(.2, .9, .3, 1); }
.progress i::after { content: ""; position: absolute; right: -17px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }

/* Two-option switch (cigarettes / roll-ups). */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #fff; border-radius: 18px; padding: 6px; }
.seg button { min-height: 56px; border: 0; border-radius: 13px; background: transparent; font: 700 18px var(--bold); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Minus / number / plus. */
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; }
.stepper button { height: 64px; border: 0; border-radius: 50%; background: #fff; font: 700 32px/1 var(--bold); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { text-align: center; font: var(--hw) calc(72px * var(--hs))/1 var(--head); letter-spacing: var(--ht); }

/* Tap-to-pick chips (prices, quick counts). */
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chips button { min-height: 56px; border: 2px solid transparent; border-radius: 14px; background: #fff; font: 700 20px var(--bold); }
.chips button[aria-pressed="true"] { background: var(--chosen); color: var(--chosen-ink); }
.other { display: flex; align-items: center; gap: 8px; margin-top: 8px; background: #fff; border-radius: 14px; padding: 0 14px; min-height: 56px; border: 2px solid transparent; }
.other:focus-within { border-color: var(--ink); }
/* Controls sit white on grey cards; on a white page give them the grey instead. */
.on-white .seg, .on-white .stepper button, .on-white .chips button:not([aria-pressed="true"]), .on-white .other { background: var(--tile); }
.other span { font: 700 20px var(--bold); }
.other input { flex: 1; min-width: 0; border: 0; background: transparent; font: 700 20px var(--bold); padding: 12px 0; outline: none; }

/* Buttons. Black for moving on, neon green for the end of the journey. */
.btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 0 22px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; font: 700 19px var(--bold); text-decoration: none; transition: transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn::after { content: "→"; font-size: 22px; transition: transform .15s; }
.btn:hover::after { transform: translateX(4px); }
.btn.go { background: var(--green); color: var(--ink); }
.btn.quiet { background: var(--tile); color: var(--ink); }
.btn.out::after { content: "↗"; }
/* Quit28 in its own pink, so the button looks like where it goes. */
.btn.q28 { background: var(--accent); color: #fff; }

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

/* The big number block, built like the logo: black block, white type, white bar, red dot. */
.logo-block { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 22px 26px; }
.logo-block .big { display: block; font: var(--hw) calc(clamp(84px, 27vw, 128px) * var(--hs))/.9 var(--head); letter-spacing: var(--ht); font-variant-numeric: tabular-nums; }
.logo-block .bar { display: flex; align-items: center; gap: 5px; margin-top: 12px; }
.logo-block .bar::before { content: ""; flex: 1; height: 12px; background: #fff; }
.logo-block .bar::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }

/* Quick reaction buttons for the in-tool questions. */
.react { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.react button { display: grid; justify-items: center; gap: 4px; padding: 14px 6px; border: 0; border-radius: 16px; background: var(--tile); font: 700 16px var(--bold); }
.react button span { font-size: 36px; line-height: 1; }
.react button[aria-pressed="true"] { background: var(--chosen); color: var(--chosen-ink); }

/* Quick picks under a stepper (5, 10, 15...). */
.quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.quick button { min-width: 52px; min-height: 48px; border: 0; border-radius: 24px; background: #fff; font: 700 18px var(--bold); }
.on-white .quick button { background: var(--well); box-shadow: var(--well-shadow); }
.quick button[aria-pressed="true"] { background: var(--chosen); color: var(--chosen-ink); box-shadow: none; }

/* The shared form from money.js. */
.habit-form { display: grid; gap: 20px; }
.habit-form .hf-q { margin: 0 0 8px; }
.habit-form .quick { flex-wrap: nowrap; gap: 6px; }
.habit-form .quick button { flex: 1; min-width: 0; }
.habit-form.compact { gap: 14px; }
.habit-form.compact .stepper { grid-template-columns: 56px 1fr 56px; }
.habit-form.compact .stepper button { height: 56px; }
.habit-form.compact .stepper output { font-size: calc(60px * var(--hs)); }

/* Pictures: emoji or icons, chosen in the lab (mode.js). Both size with font-size. */
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
[data-emoji="android"] .emoji { font-family: "Noto Color Emoji", sans-serif; }
.icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -.12em; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
