/* FamiLink — site officiel. Léger (aucune police ni bibliothèque externe),
   lisible sur mobile, clair et sombre. */
:root {
  --brand: #3646c6;
  --brand-2: #6b4ce6;
  --brand-deep: #1e2a8a;
  --accent: #f08a24;
  --ok: #1f9d55;
  --danger: #d93838;
  --bg: #f6f7fc;
  --bg-2: #eef0fa;
  --card: #ffffff;
  --text: #171a2c;
  --muted: #5d6280;
  --line: #e2e5f2;
  --shadow: 0 10px 30px rgba(30, 42, 138, .10);
  --radius: 18px;
  --grad: linear-gradient(135deg, #2b3bb8 0%, #5a46d8 55%, #8a4fd8 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8e9bff;
    --brand-2: #b29cff;
    --brand-deep: #c3caff;
    --bg: #0e1020;
    --bg-2: #14172b;
    --card: #191c33;
    --text: #eceef8;
    --muted: #a3a8c3;
    --line: #2a2e4a;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --grad: linear-gradient(135deg, #1b2470 0%, #3a2b8f 55%, #5b2d8f 100%);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- En-tête (aussi l'ancien balisage <header><div class="bar">) ----- */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
header .bar {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
header img { width: 36px; height: 36px; border-radius: 10px; }
header .name { font-weight: 800; font-size: 1.2rem; margin-right: auto; color: var(--text); letter-spacing: -.01em; }
header nav { display: flex; gap: 6px; flex-wrap: wrap; }
header nav a {
  color: var(--text); padding: 8px 12px; border-radius: 999px; font-size: .95rem; font-weight: 600;
}
header nav a:hover { background: var(--bg-2); text-decoration: none; }
header nav a.cta { background: var(--brand); color: #fff; }
header nav a.cta:hover { filter: brightness(1.08); background: var(--brand); }

main { max-width: 1080px; margin: 0 auto; padding: 32px 20px 64px; }
main.narrow { max-width: 640px; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); line-height: 1.12; margin: 8px 0 14px; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; margin: 0 0 6px; }
.lead { font-size: 1.12rem; color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent);
  padding: 6px 12px; border-radius: 999px;
}

/* ----- Boutons ----- */
.btn, a.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; color: #fff; background: var(--brand);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn:hover, a.button:hover, button:hover { transform: translateY(-1px); filter: brightness(1.06); text-decoration: none; }
.btn:active, button:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: default; transform: none; }
button { width: 100%; margin-top: 10px; }
.btn.ghost {
  background: transparent; color: var(--text); box-shadow: none; border: 1.5px solid var(--line);
}
.btn.light { background: #fff; color: var(--brand-deep); }
.btn svg { width: 22px; height: 22px; flex: none; }

/* ----- Cartes et grilles ----- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 14px 0; box-shadow: var(--shadow);
}
.card > h2:first-child, .card > p:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.grid .card { margin: 0; }
.notice { border-color: var(--accent); }
.error { color: var(--danger); font-weight: 600; }
section { padding: 56px 0 0; }
.section-head { max-width: 640px; margin: 0 auto 28px; text-align: center; }

/* ----- Héros de l'accueil ----- */
.hero {
  position: relative; overflow: hidden; color: #fff; background: var(--grad);
  border-radius: 28px; padding: clamp(28px, 6vw, 64px); margin-top: 8px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none;
}
.hero::before { width: 360px; height: 360px; background: #ff9f43; top: -120px; right: -80px; }
.hero::after { width: 300px; height: 300px; background: #2ee6c5; bottom: -140px; left: -60px; }
.hero > * { position: relative; }
.hero .lead { color: rgba(255,255,255,.85); }
.hero .eyebrow { background: rgba(255,255,255,.16); color: #fff; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero .meta { margin-top: 14px; font-size: .9rem; color: rgba(255,255,255,.75); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .mockup { display: none; } }

/* Téléphone dessiné en CSS (aperçu de l'app). */
.mockup {
  justify-self: center; width: 230px; height: 460px; border-radius: 38px; padding: 12px;
  background: #0d0f1c; box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.08);
}
.mockup .screen {
  height: 100%; border-radius: 28px; overflow: hidden; background: #f3f0ea;
  display: flex; flex-direction: column; gap: 8px; padding: 14px 10px; color: #171a2c; font-size: .72rem;
}
.mockup .top { display: flex; align-items: center; gap: 6px; font-weight: 800; color: #3646c6; }
.mockup .top img { width: 20px; height: 20px; border-radius: 6px; }
.mockup .post { background: #fff; border-radius: 14px; padding: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.mockup .post .pic { height: 74px; border-radius: 10px; margin-top: 6px; background: linear-gradient(135deg,#ffb26b,#ff6b8b); }
.mockup .bubble { align-self: flex-start; max-width: 80%; background: #fff; border-radius: 12px; padding: 6px 9px; }
.mockup .bubble.me { align-self: flex-end; background: #dfe3ff; }
.mockup .fund { background: linear-gradient(135deg,#3646c6,#6b4ce6); color: #fff; border-radius: 14px; padding: 10px; }
.mockup .fund b { display: block; font-size: 1rem; }

/* ----- Fonctionnalités ----- */
.feature .icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 12px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
}
.feature .icon svg { width: 24px; height: 24px; }
.feature p { margin: 0; color: var(--muted); }

/* ----- Étapes ----- */
.steps { counter-reset: step; }
.steps .card { position: relative; padding-top: 30px; }
.steps .card::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -16px; left: 22px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad);
}

/* ----- Offres ----- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-card { position: relative; display: flex; flex-direction: column; }
.plan-card .price { font-size: 1.7rem; font-weight: 800; color: var(--text); margin: 6px 0 2px; }
.plan-card .price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.plan-card ul { list-style: none; padding: 0; margin: 14px 0 0; }
.plan-card li { padding: 6px 0 6px 26px; position: relative; color: var(--muted); }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan-card.popular { border: 2px solid var(--brand); }
.plan-card .tag {
  position: absolute; top: -12px; right: 18px; background: var(--grad); color: #fff;
  font-size: .75rem; font-weight: 800; padding: 4px 10px; border-radius: 999px;
}

/* ----- Téléchargement ----- */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.platform { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.platform .logo { width: 56px; height: 56px; }
.platform.soon { opacity: .65; }
.platform .soon-tag {
  font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); background: var(--bg-2); padding: 4px 10px; border-radius: 999px;
}
.download-box { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
@media (max-width: 720px) { .download-box { grid-template-columns: 1fr; } .qr { justify-self: center; } }
.qr { background: #fff; padding: 12px; border-radius: 16px; width: 172px; height: 172px; }
.qr img, .qr svg { width: 100%; height: 100%; }
.howto ol { margin: 8px 0 0; padding-left: 20px; }
.howto li { margin: 6px 0; }

/* ----- Questions fréquentes ----- */
details {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 10px 0;
}
details summary { cursor: pointer; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; font-weight: 800; color: var(--brand); }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; color: var(--muted); }

/* ----- Tableaux (pages légales) ----- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--card); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: .95rem; }
th { background: var(--brand); color: #fff; font-weight: 600; }

/* ----- Formulaires (abonnement) ----- */
label { display: block; margin: 12px 0; font-weight: 600; }
label > span { display: block; margin-bottom: 6px; }
input[type=email], input[type=password], input[type=tel], input[type=text], select {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.phone-field, .phone { display: flex; align-items: center; gap: 8px; }
.toggle label { font-weight: 500; display: inline-flex; gap: 8px; margin-right: 18px; align-items: center; }
.plan { cursor: pointer; font-weight: 400; position: relative; transition: transform .15s ease, border-color .15s ease; }
.plan:hover { transform: translateY(-2px); }
.plan input { position: absolute; top: 20px; right: 20px; accent-color: var(--brand); }
.plan h3 { margin: 0 0 4px; }
.plan ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.plan.selected { border: 2px solid var(--brand); }
.price { font-size: 1.35rem; font-weight: 800; color: var(--accent); }

/* ----- États (paiement, invitation) ----- */
.status { font-size: 3rem; margin: 12px 0 0; }
.status-icon {
  width: 92px; height: 92px; border-radius: 50%; margin: 8px auto 18px; display: grid; place-items: center;
  color: #fff; font-size: 2.6rem; font-weight: 800; animation: pop .45s cubic-bezier(.2,1.4,.4,1) both;
}
.status-icon.ok { background: var(--ok); box-shadow: 0 12px 30px color-mix(in srgb, var(--ok) 40%, transparent); }
.status-icon.ko { background: var(--danger); }
.status-icon.wait { background: var(--accent); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.code {
  font-size: 2.1rem; font-weight: 800; letter-spacing: .22em; color: var(--brand);
  background: var(--card); border: 2px dashed var(--brand); border-radius: 16px;
  display: inline-block; padding: 12px 24px; margin: 4px 0 18px;
}
.spinner {
  width: 44px; height: 44px; margin: 8px auto 18px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Pied de page ----- */
footer {
  border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; padding: 28px 20px; text-align: center;
}
footer a { margin: 0 8px; color: var(--muted); }
footer .by { display: block; margin-top: 6px; font-size: .85rem; }
footer .by b { color: var(--text); letter-spacing: .06em; }

/* ----- Apparition au défilement (désactivée si l'appareil réduit les animations) ----- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .spinner, .status-icon { animation: none; }
}

/* Petits écrans : menu sur une ligne (les ancres restent accessibles en défilant). */
@media (max-width: 600px) {
  header nav a[href^="#"]:not(#lang) { display: none; }
  header .name { font-size: 1.1rem; }
}
.grid.steps { row-gap: 30px; margin-top: 16px; }
@media (max-width: 720px) {
  .download-box > .center { display: none; }
  .platforms { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .platform { padding: 16px 8px; }
  .platform .logo { width: 36px; height: 36px; }
  .platform h3 { font-size: .95rem; }
}
