/* Self-hosted fonts of the app (SIL OFL 1.1, licences in /fonts/OFL.txt): no request to a font CDN. */
@font-face {
  font-family: 'Alata';
  font-display: swap;
  src: url('/fonts/Alata_400Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Arimo';
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/Arimo_400Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Arimo';
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/Arimo_700Bold.woff2') format('woff2');
}

/*
 * Palette from the "Palettes de couleurs" section of docs/specs.md. The values repeat the
 * tokens of src/constants/theme.ts (this static site cannot import them): keep both in sync.
 */
:root {
  --background: #f7f8f6;
  --card: #ffffff;
  --tile: #e0eee8;
  --text: #000000;
  --text-secondary: #666666;
  --banner: #004128;
  --text-on-banner: #ffffff;
  --accent: #004128;
  --alert-background: #fff4d2;
  --alert-text: #613d00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #14181a;
    --card: #1c2224;
    --tile: #262e30;
    --text: #e8eeec;
    --text-secondary: #9aa8a5;
    --banner: #1d4a3c;
    --text-on-banner: #e8eeec;
    --accent: #8ed3b4;
    --alert-background: #2b2619;
    --alert-text: #ddbb6e;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    'Arimo',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

header {
  align-items: center;
  background: var(--banner);
  color: var(--text-on-banner);
  display: flex;
  justify-content: space-between;
  padding: 16px;
}

header .brand {
  align-items: center;
  color: inherit;
  display: flex;
  font-family: 'Alata', sans-serif;
  font-size: 1.375rem;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.language-switcher {
  display: flex;
  gap: 4px;
}

.language-switcher button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  min-height: 44px;
  min-width: 44px;
}

.language-switcher button[aria-pressed='true'] {
  border-color: var(--text-on-banner);
  font-weight: 700;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

h1,
h2 {
  font-family: 'Alata', sans-serif;
  font-weight: 400;
}

h1 {
  color: var(--accent);
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 0 0 16px;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--accent);
}

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

/* Home page: logo, tagline and store badges on a card. */
.hero {
  padding: 40px 24px;
  text-align: center;
}

.hero img {
  border-radius: 22px;
  height: 96px;
  margin: 0 auto 16px;
  width: 96px;
}

.hero h1 {
  font-size: 2.25rem;
}

.hero .tagline {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.hero .stores {
  justify-content: center;
}

.notice {
  background: var(--alert-background);
  color: var(--alert-text);
  border-radius: 12px;
  padding: 12px 16px;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

.store {
  background: var(--tile);
  border-radius: 12px;
  color: var(--text-secondary);
  min-height: 48px;
  padding: 12px 20px;
}

a.store {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

footer {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0 16px 32px;
  text-align: center;
}

footer a {
  color: inherit;
}

/* Home page: feature sections with a phone screenshot, and the list of smaller features. */
main:has(.feature) {
  max-width: 880px;
}

.feature {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 220px;
  margin-top: 48px;
}

.feature.reverse {
  grid-template-columns: 220px 1fr;
}

.feature.reverse .feature-text {
  order: 2;
}

.feature img {
  border-radius: 20px;
  height: auto;
  width: 100%;
}

.feature h2,
.more h2 {
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 12px;
}

.more {
  margin-top: 56px;
}

.more-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.more-grid li {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
}

.more-grid strong,
.more-grid span {
  display: block;
}

.more-grid span {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 4px;
}

.promise {
  text-align: center;
}

@media (max-width: 600px) {
  .feature,
  .feature.reverse {
    grid-template-columns: 1fr;
  }

  .feature img {
    justify-self: center;
    max-width: 240px;
  }

  .feature.reverse .feature-text {
    order: 0;
  }
}

/* Bilingual pages: French by default, English when the browser asks for it (see page.js). */
html[lang='en'] [lang='fr'],
html[lang='fr'] [lang='en'] {
  display: none;
}

/* Expired or already used link (see page.js): swap the normal content for the error message. */
[data-when='invalid'],
html[data-link='invalid'] [data-when='valid'] {
  display: none;
}

html[data-link='invalid'] [data-when='invalid'] {
  display: block;
}

/* Legal pages (privacy policy, terms of use, legal notice). */
main:has(.legal) {
  max-width: 760px;
}

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

.legal .toc {
  background: var(--tile);
  border-radius: 12px;
  margin: 16px 0 8px;
  padding: 12px 16px;
}

.legal .toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal .toc a {
  display: inline-block;
  min-height: 24px;
}

.legal h2 {
  scroll-margin-top: 16px;
}

.legal h1 {
  margin-bottom: 8px;
}

.legal h2 {
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 32px 0 8px;
}

.legal .updated {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.legal ul {
  margin: 0 0 16px;
  padding-left: 24px;
}

.legal li {
  margin-bottom: 4px;
}

.table-wrap {
  margin: 0 0 16px;
  overflow-x: auto;
}

.legal table {
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 480px;
  width: 100%;
}

.legal th,
.legal td {
  border-bottom: 1px solid var(--tile);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.legal th {
  background: var(--tile);
}
