/*
 * Design tokens of the redesign (docs/design-ecrans.md §1, decided 2026-11-23).
 * Defined now, used by the new screens as they replace the old ones one by one.
 * Prefixed --fbs- so they never clash with the variables of the current styles.
 */
:root {
  /* Design D (2026-11-30): the welcome's garnet, behind every sign-up screen and each tab's head */
  --fbs-garnet-glow: radial-gradient(120% 70% at 85% 0%, #9a3446 0%, #6b1d2a 55%, #4a1019 100%);
  --fbs-garnet-end: #4a1019;
  /* The plate drawn until a recipe has its photo (n°70): vegetables, starch, protein */
  --fbs-food-veg: #6e8b3d;
  --fbs-food-starch: #e6be73;
  --fbs-food-protein: #a9603e;
  /* Colours */
  --fbs-bg: #ffffff;
  --fbs-ink: #292a2d;
  --fbs-ink-2: #4a4b4f;
  --fbs-muted: #6b6c70; /* 5:1 on white */
  /* Actions: the brand's garnet, from the Hopplan logo board (Edgar, 2026-11-26; petrol blue,
     fir green and Swiss red before that) */
  --fbs-accent: #9a3446; /* 7.1:1 under white text, 6.2:1 on the page */
  --fbs-accent-pressed: #7d2838;
  --fbs-accent-tint: #f6dde1;
  /* Alerts — overspending, errors. Garnet and red are too close to tell apart, so an alert is
     never told by its colour: dark text on a cream pastille, marked by a small red icon. */
  --fbs-alert: #d52b1e;
  --fbs-alert-text: var(--fbs-ink);
  --fbs-alert-bg: #fff8ef; /* ink 13.6:1, the red icon 4.8:1 */
  --fbs-alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23d52b1e'/%3E%3Cpath d='M8 4v5' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='12' r='1.1' fill='%23fff'/%3E%3C/svg%3E");
  --fbs-line: #e3e3e1;
  --fbs-line-soft: #efefed;
  --fbs-photo-ground: #f3eee7;

  /* Type: Figtree, the logo's typeface (design D, 2026-11-30), self-hosted (main.tsx) */
  --fbs-font: "Figtree Variable", "Helvetica Neue", Arial, sans-serif;
  --fbs-size-screen-title: 26px;
  --fbs-size-amount: 46px;
  --fbs-size-block-title: 17px;
  --fbs-size-body: 15px;
  --fbs-size-small: 13px;
  --fbs-size-min: 12px;

  /* Shapes */
  --fbs-radius-card: 14px;
  --fbs-radius-button: 12px;
  --fbs-radius-tag: 4px;
  --fbs-tap-min: 44px;

  /* Motion: press feedback only, nothing on scroll or on repeated gestures */
  --fbs-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --fbs-press-duration: 160ms;
  --fbs-press-scale: 0.97;

  /*
   * Redesign of 2026-12-02 (roadmap n°82, docs/design-ecrans.md §1). Added beside the tokens
   * above, which the screens not yet redrawn still read; each tab moves to these in its own PR.
   */
  /* Colours by role: each one says a single thing */
  --fbs-garnet: #6b1d2a; /* act and choose; white text 11.4:1. Never an amount, never a problem */
  --fbs-garnet-edge: #3d0d16; /* the solid edge under the main button */
  --fbs-rose: #f6dde1; /* the only coloured surface: arch, chosen state, aisle badge, rules */
  --fbs-rose-edge: #e3bcc3; /* the edge under a secondary button */
  --fbs-surface: #ffffff; /* every screen's ground */
  --fbs-ink-d: #241a1c; /* everything that is read, and every amount; 16.9:1 */
  --fbs-muted-d: #5e4f52; /* secondary text; 7.7:1 on white, 6.0:1 on rose */
  --fbs-link: #9a3446; /* a link inside a text, details of the drawings */
  --fbs-amber: #ffe2a0; /* « attention », always with a triangle and a sentence; ink 13.4:1 */
  --fbs-paper: #fbf6f1; /* the till receipt, nowhere else */
  --fbs-paper-line: #cdbfc1;
  /* Type scale: nothing read under 16px, the tab names being the one exception */
  --fbs-type-screen: 38px;
  --fbs-type-dish: 30px;
  --fbs-type-block: 22px;
  --fbs-type-row: 20px;
  --fbs-type-body: 17px;
  --fbs-type-small: 16px;
  --fbs-type-tab: 14px;
  --fbs-type-giant: 104px;
  /* Shapes and targets */
  --fbs-radius-control: 18px;
  --fbs-radius-block: 28px;
  --fbs-row-min: 56px;
  /* Motion, by name. Nothing loops, nothing replays when a tab is opened again */
  --fbs-t-press: 160ms; /* a button gives under the finger */
  --fbs-t-quick: 180ms; /* tick, swap an amount, show content */
  --fbs-t-move: 260ms; /* what changes place: tab pill, dish to its sheet */
  --fbs-t-sheet-in: 380ms;
  --fbs-t-sheet-out: 240ms;
  --fbs-t-hop: 600ms; /* five endings only */
  --fbs-ease-move: cubic-bezier(0.77, 0, 0.175, 1);
  --fbs-ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Colours of the Hopplan logo (brand model, 2026-11-26): garnet #6B1D2A, light garnet #9A3446,
   pale pink #F1C3CB. */
.hop-logo {
  display: block;
  width: 100%;
  height: auto;
}

.hop-light .hop-ink {
  fill: #6b1d2a;
}
.hop-light .hop-arch {
  stroke: #6b1d2a;
}
.hop-light .hop-plan,
.hop-light .hop-line {
  fill: #9a3446;
}

.hop-dark .hop-ink {
  fill: #ffffff;
}
.hop-dark .hop-arch {
  stroke: #ffffff;
}
.hop-dark .hop-plan,
.hop-dark .hop-line {
  fill: #f1c3cb;
}

/* At the foot of Foyer: the app signs its screens once, quietly */
.hop-signature {
  display: flex;
  justify-content: center;
  padding: 28px 0 8px;
  opacity: 0.85;
}

.hop-signature .hop-logo {
  width: 140px;
}

/* The site hopplan.ch (roadmap n°83), in the app's own direction D: Figtree, the garnet, the rose
   arch, flat edges under what can be pressed. Mobile first. The tokens come from the app
   (apps/web/src/design-tokens.css), joined in front of this file at build time. */

@font-face {
  font-family: "Figtree Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Figtree Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 300 900;
  src: url("/fonts/figtree-latin-wght-italic.woff2") format("woff2-variations");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--fbs-surface);
  color: var(--fbs-ink-d);
  font-family: var(--fbs-font);
  font-size: var(--fbs-type-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--fbs-link);
  font-weight: 700;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--fbs-garnet);
  outline-offset: 3px;
  border-radius: 6px;
}

.hs-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  border-radius: var(--fbs-radius-control);
  background: var(--fbs-garnet);
  color: #ffffff;
  z-index: 10;
}

.hs-skip:focus {
  top: 12px;
}

/* ---------- Header ---------- */
.hs-head {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hs-brand {
  display: block;
  width: 140px;
}

.hs-head nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--fbs-tap-min);
  padding: 0 4px;
  color: var(--fbs-garnet);
  font-weight: 900;
  text-decoration: none;
}

.hs-head nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

/* ---------- Buttons: the app's, with their flat edge ---------- */
.hs-main,
.hs-second {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 24px;
  border-radius: var(--fbs-radius-control);
  font-size: var(--fbs-type-row);
  font-weight: 900;
  text-decoration: none;
  transition:
    transform var(--fbs-t-press) var(--fbs-ease-out),
    box-shadow var(--fbs-t-press) var(--fbs-ease-out);
}

.hs-main {
  background: var(--fbs-garnet);
  box-shadow: 0 5px 0 var(--fbs-garnet-edge);
  color: #ffffff;
}

.hs-main:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--fbs-garnet-edge);
}

/* ---------- Hero: the app's welcome garnet ---------- */
.hs-hero {
  position: relative;
  background: var(--fbs-garnet-glow);
  color: #ffffff;
  padding: 36px 20px 0;
  display: grid;
  gap: 32px;
  overflow: hidden;
}

.hs-hero h1 {
  font-size: clamp(42px, 11vw, 78px);
  max-width: 12ch;
}

.hs-lead {
  margin-top: 18px;
  max-width: 34em;
  font-size: var(--fbs-type-row);
  line-height: 1.45;
}

.hs-hero .hs-lead {
  color: var(--fbs-rose);
}

.hs-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hs-hero .hs-main,
.hs-on-garnet {
  background: #ffffff;
  box-shadow: 0 5px 0 var(--fbs-rose-edge);
  color: var(--fbs-garnet);
}

.hs-hero .hs-main:active,
.hs-on-garnet:active {
  box-shadow: 0 1px 0 var(--fbs-rose-edge);
}

.hs-hero .hs-second {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  padding: 0 6px;
}

.hs-beta {
  margin-top: 22px;
  color: #f1c3cb;
  font-weight: 700;
}

.hs-hero :focus-visible,
.hs-closing :focus-visible,
.hs-foot :focus-visible {
  outline-color: #ffffff;
}

/* The phone rises from the bottom of the garnet, its foot cut by the white below */
.hs-hero-phone {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: -150px;
}

.hs-hero-phone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40px;
  width: 380px;
  height: 640px;
  transform: translateX(-50%);
  border-radius: 190px 190px 0 0;
  background: #9a3446;
  opacity: 0.45;
}

.hs-hero-phone .hs-phone {
  width: min(300px, 78vw);
}

/* ---------- A phone around a screen of the app ---------- */
.hs-phone {
  position: relative;
  display: block;
  border: 10px solid var(--fbs-ink-d);
  border-radius: 46px;
  overflow: hidden;
  background: var(--fbs-ink-d);
  box-shadow: 0 14px 0 rgb(61 13 22 / 0.16);
}

.hs-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 36px;
}

/* ---------- How it works: a real sequence, so numbered ---------- */
.hs-steps {
  max-width: 1120px;
  margin: 0 auto;
  padding: 200px 20px 40px;
}

.hs-steps > h2,
.hs-promises > h2 {
  font-size: clamp(34px, 7vw, 52px);
  color: var(--fbs-garnet);
}

.hs-steps ol {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  gap: 64px;
}

.hs-step {
  display: grid;
  gap: 28px;
  align-items: center;
}

.hs-step-number {
  display: block;
  color: var(--fbs-garnet);
  font-size: 72px;
  font-weight: 900;
  font-style: italic;
  line-height: 0.9;
}

.hs-step h3 {
  margin-top: 6px;
  font-size: var(--fbs-type-dish);
}

.hs-step p {
  margin-top: 12px;
  max-width: 30em;
  color: var(--fbs-muted-d);
  font-size: var(--fbs-type-row);
  line-height: 1.45;
}

/* The rose arch of the app, behind each phone */
.hs-step-phone {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 28px;
}

.hs-step-phone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: min(340px, 86vw);
  height: 78%;
  transform: translateX(-50%);
  border-radius: 170px 170px var(--fbs-radius-block) var(--fbs-radius-block);
  background: var(--fbs-rose);
}

.hs-step-phone .hs-phone {
  width: min(250px, 66vw);
}

/* ---------- What we guarantee ---------- */
.hs-promises {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.hs-promise-list {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.hs-promise {
  padding: 22px 22px 24px;
  border-radius: var(--fbs-radius-block);
  background: var(--fbs-rose);
}

.hs-promise h3 {
  color: var(--fbs-garnet);
  font-size: var(--fbs-type-block);
}

.hs-promise p {
  margin-top: 8px;
  color: var(--fbs-ink-d);
}

/* ---------- The last word, in garnet ---------- */
.hs-closing {
  background: var(--fbs-garnet-glow);
  color: #ffffff;
  padding: 56px 20px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 16px;
}

.hs-closing h2 {
  font-size: clamp(32px, 7vw, 50px);
}

.hs-closing p {
  max-width: 30em;
  color: var(--fbs-rose);
  font-size: var(--fbs-type-row);
}

/* ---------- Install, and the other plain pages ---------- */
.hs-page-head {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 8px;
}

.hs-page-head h1 {
  color: var(--fbs-garnet);
  font-size: clamp(40px, 9vw, 64px);
}

.hs-page-head .hs-lead {
  color: var(--fbs-muted-d);
}

.hs-app-link,
.hs-page-head > p:last-child {
  margin-top: 24px;
}

.hs-notice {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: var(--fbs-radius-control);
  background: var(--fbs-rose);
  color: var(--fbs-ink-d);
  font-weight: 700;
}

.hs-install {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 0;
  display: grid;
  gap: 14px;
}

.hs-device {
  padding: 22px 22px 24px;
  border-radius: var(--fbs-radius-block);
  border: 2px solid var(--fbs-rose);
}

.hs-device h2 {
  font-size: var(--fbs-type-block);
}

.hs-device > p {
  margin-top: 10px;
}

.hs-gestures {
  list-style: none;
  counter-reset: gesture;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.hs-gestures li {
  counter-increment: gesture;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  font-size: var(--fbs-type-row);
  font-weight: 700;
  line-height: 1.3;
}

.hs-gestures li::before {
  content: counter(gesture);
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fbs-garnet);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: var(--fbs-type-small);
  font-weight: 900;
}

.hs-hint {
  margin-top: 12px;
  color: var(--fbs-muted-d);
  font-size: var(--fbs-type-small);
}

.hs-qr {
  display: block;
  margin-top: 14px;
  width: 200px;
  height: 200px;
}

.hs-then {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  font-size: var(--fbs-type-row);
  font-weight: 700;
}

/* ---------- Footer ---------- */
.hs-foot {
  background: var(--fbs-garnet-end);
  color: #ffffff;
}

.hs-foot-in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 44px;
  display: grid;
  gap: 12px;
}

.hs-foot-logo {
  display: block;
  width: 140px;
  margin-bottom: 6px;
}

.hs-foot p {
  color: var(--fbs-rose);
}

.hs-foot a {
  color: #ffffff;
}

.hs-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.hs-foot nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--fbs-tap-min);
}

/* ---------- Wider screens ---------- */
@media (min-width: 820px) {
  .hs-head {
    padding: 18px 32px;
  }

  .hs-hero {
    grid-template-columns: 1.2fr 1fr;
    align-items: end;
    padding: 64px max(32px, calc((100vw - 1120px) / 2 + 32px)) 0;
  }

  .hs-hero-text {
    padding-bottom: 96px;
  }

  .hs-hero-phone {
    margin-bottom: -40px;
  }

  .hs-steps {
    padding: 120px 32px 48px;
  }

  .hs-step {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .hs-step:nth-child(even) .hs-step-text {
    order: 2;
  }

  .hs-promises {
    padding: 48px 32px 88px;
  }

  .hs-promise-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .hs-install {
    grid-template-columns: 1fr 1fr;
  }

  .hs-install .hs-device:last-child {
    grid-column: 1 / -1;
  }

  .hs-foot-in {
    padding: 44px 32px 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hs-main,
  .hs-second {
    transition: none;
  }

  .hs-main:active {
    transform: none;
  }
}

/* The privacy and about pages: plain reading */
.hs-prose {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) 72px max(20px, env(safe-area-inset-left, 0px));
}

.hs-prose h2 {
  margin: 40px 0 8px;
  font-style: italic;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
}

.hs-prose p {
  margin: 0 0 14px;
  max-width: 62ch;
}

.hs-never {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  max-width: 62ch;
}

.hs-never li {
  margin: 0 0 12px;
}

.hs-notice-legal {
  margin-top: 56px;
  font-size: 15px;
  color: var(--fbs-muted-d);
}

.hs-notice-legal h2 {
  font-size: 20px;
}
