/* Outside app/assets so stylesheet_link_tag :app does not load this on sign-in, the club, or the mobile app. */

:root {
  --bg: #ffffff;
  --surface: #f3f5f6;
  --ink: #1c2124;
  --muted: #5d676d;
  --line: #e6e9ea;
  --accent: #0e7c86;
  --accent-ink: #ffffff;
  --frame: #1c2124;
  --radius: 14px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111416;
    --surface: #1a1e21;
    --ink: #eef1f2;
    --muted: #9aa5ab;
    --line: #2a3034;
    --accent: #3fb6c1;
    --accent-ink: #06191b;
    --frame: #2c3338;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111416;
    --surface: #1a1e21;
    --ink: #eef1f2;
    --muted: #9aa5ab;
    --line: #2a3034;
    --accent: #3fb6c1;
    --accent-ink: #06191b;
    --frame: #2c3338;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.cms a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: max(24px, env(safe-area-inset-left, 0px)) max(24px, env(safe-area-inset-right, 0px));
}

/* ---------- En-tête ---------- */

.site-header {
  padding: 22px 0;
  background: #0e0a14;
  color: #fff;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(160deg, rgba(255, 255, 255, .94) 0%, rgba(240, 236, 232, .88) 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 0 0 4px rgba(255, 255, 255, .26), 0 6px 18px rgba(0, 0, 0, .25); }
.logo img { width: 29px; height: auto; display: block; }

.header-link {
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}
.header-link:hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 48px 0 0;
  overflow: hidden;
}

.hero h1 {
  margin: 0 auto;
  max-width: 14ch;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
}

.hero p.lead {
  margin: 22px auto 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--muted);
  text-wrap: pretty;
}

.cta-row {
  margin: 34px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  text-align: left;
  line-height: 1.15;
  transition: transform .15s ease, opacity .15s ease;
}
.store:hover { transform: translateY(-1px); }

.store svg { width: 24px; height: 24px; flex: none; }

.store small {
  display: block;
  font-size: 0.7rem;
  opacity: .75;
  letter-spacing: .02em;
}
.store strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Boutons pas encore actifs (apps en cours de validation) */
.store[aria-disabled="true"] {
  opacity: .55;
  cursor: default;
  pointer-events: none;
}

.contact-row { margin-top: 22px; }

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.98rem;
  transition: color .15s ease;
}
.contact-link strong {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}
.contact-link:hover, .contact-link:hover strong { color: var(--accent); }

/* ---------- Téléphone ---------- */

.device {
  margin: 56px auto 0;
  width: min(300px, 72vw);
  aspect-ratio: 1206 / 1500;      /* recadré en bas, comme Hello Weather */
  position: relative;
  border: 10px solid var(--frame);
  border-bottom: 0;
  border-radius: 46px 46px 0 0;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .35);
}

.device img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}

.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Pages légales ---------- */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding-block: 40px 80px;
  padding-inline: max(24px, env(safe-area-inset-left, 0px)) max(24px, env(safe-area-inset-right, 0px));
}

.legal h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.legal .updated { color: var(--muted); margin: 0 0 36px; }

.legal h2 {
  margin: 40px 0 8px;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 1.2em; }
.legal li { margin: 4px 0; }

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

/* Champs à compléter : bien visibles pour ne pas les oublier */
.todo {
  background: #fff2b3;
  color: #3a2e00;
  padding: 0 4px;
  border-radius: 4px;
}

.legal a.back {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.legal a.back:hover { color: var(--ink); }

@media (max-width: 520px) {
  .store { width: 100%; justify-content: flex-start; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

.site-header .wrap { gap: 16px; flex-wrap: wrap; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.lang { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .82rem; letter-spacing: .04em; }
.lang a { text-decoration: none; opacity: .72; }
.lang a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.lang span { opacity: .55; }
.login { color: #fff; text-decoration: none; font-weight: 600; font-size: .88rem; padding: 7px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .1); white-space: nowrap; transition: background .15s ease, border-color .15s ease; }
.login:hover { color: #fff; background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .8); }
.legal h3 { margin: 28px 0 6px; font-size: 1.05rem; letter-spacing: -0.01em; }

/* ---------- Developer docs ---------- */

.legal.docs { max-width: 860px; }

.docs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.legal .docs-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.legal .docs-nav a:hover { color: var(--ink); }
.legal .docs-nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.legal .docs-nav a.docs-nav-file { margin-left: auto; }

.docs code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.docs pre {
  margin: 14px 0 20px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.5;
}
.docs pre code { background: none; padding: 0; font-size: .82rem; overflow-wrap: normal; white-space: pre; }

.docs .table-scroll { overflow-x: auto; margin: 14px 0 20px; -webkit-overflow-scrolling: touch; }
/* Narrow screens scroll the table inside .table-scroll rather than crushing its columns. */
.docs table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .92rem; }
.docs th, .docs td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.docs th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.docs td:first-child code { white-space: nowrap; }

.docs h3.endpoint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.docs h3.endpoint code { background: none; padding: 0; font-size: .95rem; }

.method {
  display: inline-block;
  min-width: 64px;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: .03em;
  color: #fff;
}
.method.get { background: #0e7c86; }
.method.put { background: #a35f00; }
.method.delete { background: #b42318; }

/* Club API page: endpoints sidebar next to the guide */

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

.legal.docs.docs-api { max-width: 1140px; }
.docs-api .docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.docs-api .docs-content { min-width: 0; max-width: 820px; }
.docs-api .docs-content h2[id], .docs-api .docs-content h3[id] { scroll-margin-top: 24px; }

.docs-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  font-size: .88rem;
  padding-right: 4px;
}
.docs-toc ul { list-style: none; margin: 0 0 18px; padding: 0; }
.docs-toc li { margin: 0; }
.docs-toc-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.legal .docs-toc a { display: block; padding: 5px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.legal .docs-toc a:hover { background: var(--surface); }
.legal .docs-toc .docs-toc-title a { display: inline; padding: 0; color: inherit; }
.legal .docs-toc .docs-toc-title a:hover { background: none; color: var(--ink); }
.legal .docs-toc .docs-toc-endpoints a { display: flex; align-items: center; gap: 8px; }
.docs-toc-endpoints .method { min-width: 52px; padding: 1px 6px; font-size: .66rem; }
.docs-toc-endpoints code { background: none; padding: 0; font-size: .8rem; overflow-wrap: anywhere; }

.docs h3.endpoint:target { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

@media (max-width: 900px) {
  .docs-api .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .docs-toc { position: static; max-height: none; padding: 14px 14px 0; border: 1px solid var(--line); border-radius: 10px; }
}

.docs ol.steps { padding-left: 1.4em; }
.docs ol.steps li { margin: 8px 0; }
.docs ul.prompts { list-style: none; padding: 0; }
.docs ul.prompts li {
  margin: 8px 0;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 12px;
  font-style: italic;
}

