/* PharmAI — site de présentation. Couleurs reprises de l'app (src/ui/theme.ts).
   Aucune ressource extérieure : polices du système, rien n'est chargé ailleurs. */
:root {
  --bg: #F3F5F7; --surface: #FFFFFF; --surface-alt: #EEF1F4;
  --text: #16202A; --muted: #5F6B78; --faint: #8A95A1; --border: #E2E7EC;
  --primary: #0E7C66; --primary-dark: #0A5E4E; --primary-soft: #E1F2EC; --on-primary: #FFFFFF;
  --danger: #C62828; --danger-soft: #FDECEC; --soon: #C2410C; --soon-soft: #FFEDE3;
  --ok: #2E7D32; --ok-soft: #E7F4E8; --spark: #F5B83D; --twinkle: #9BE3CF;
  --hero-from: #0E7C66; --hero-to: #0A5E4E;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1317; --surface: #182026; --surface-alt: #212A31;
    --text: #E7ECF0; --muted: #A2ADB7; --faint: #76828D; --border: #2B353D;
    --primary: #1A9179; --primary-dark: #7FD8C1; --primary-soft: #14322B;
    --danger: #F27474; --danger-soft: #3A1E1F; --soon: #F59A5B; --soon-soft: #3A2617;
    --ok: #5CCB72; --ok-soft: #17301E;
    --hero-from: #0F5F4F; --hero-to: #0A3F35;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); }
img, svg { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { a { color: var(--primary-dark); } }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 2px; border-radius: 6px; }

/* En-tête */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; }
.brand b { color: var(--primary); font-weight: 800; }
@media (prefers-color-scheme: dark) { .brand b { color: var(--primary-dark); } }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 12px 10px; min-height: 48px; display: inline-flex; align-items: center; border-radius: 10px; }
.top nav a:hover { color: var(--text); background: var(--surface-alt); }
.top nav a.cta { color: var(--on-primary); background: var(--primary); padding: 0 16px; }
@media (max-width: 640px) { .top nav a:not(.cta) { display: none; } }

/* Hero */
.hero { background: linear-gradient(160deg, var(--hero-from), var(--hero-to)); color: #fff; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding-block: 72px 0; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--twinkle); }
.hero .lead { font-size: 1.2rem; margin-top: 18px; color: #DDF2EB; max-width: 34em; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero .badges span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); padding: 6px 12px; border-radius: 999px; font-size: .92rem; font-weight: 600; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding-bottom: 72px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 14px; font-weight: 700; text-decoration: none; font-size: 1rem; }
.btn-light { background: #fff; color: var(--hero-to) !important; }
.btn-ghost { border: 2px solid rgba(255, 255, 255, .55); color: #fff !important; }
.btn:hover { filter: brightness(1.06); }
.hero .phone-col { align-self: end; display: flex; justify-content: center; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 8px; padding-top: 48px; }
  .hero .actions { padding-bottom: 32px; }
}

/* Téléphone dessiné (aperçu de l'écran d'accueil) */
.phone { width: 300px; max-width: 100%; background: #0B1014; border-radius: 42px 42px 0 0; padding: 12px 12px 0; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); }
.screen { background: #F3F5F7; color: #16202A; border-radius: 32px 32px 0 0; padding: 22px 14px 14px; font-size: 13px; line-height: 1.35; height: 470px; overflow: hidden; position: relative; }
.screen .app-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.screen .app-head .brand { font-size: 17px; gap: 7px; color: #16202A; }
.screen .app-head .brand b { color: #0E7C66; }
.screen .app-head .brand img { width: 24px; height: 24px; }
.screen .kitbtn { width: 28px; height: 28px; border-radius: 8px; background: #0E7C66; color: #fff; display: grid; place-items: center; font-size: 16px; }
.screen .search { background: #fff; border: 1px solid #E2E7EC; border-radius: 12px; padding: 9px 12px; color: #8A95A1; margin-bottom: 10px; }
.screen .chips { display: flex; gap: 6px; margin-bottom: 10px; }
.screen .chips span { background: #E1F2EC; color: #0A5E4E; border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: 12px; }
.screen .chips span.off { background: #EEF1F4; color: #5F6B78; }
.item { background: #fff; border-radius: 14px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.item .pic { width: 38px; height: 38px; border-radius: 10px; background: #E1F2EC; color: #0E7C66; display: grid; place-items: center; font-size: 20px; flex: none; }
.item .name { font-weight: 700; }
.item .meta { color: #5F6B78; font-size: 12px; }
.item .tag { margin-left: auto; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.tag.red { background: #FDECEC; color: #C62828; }
.tag.orange { background: #FFEDE3; color: #C2410C; }
.tag.green { background: #E7F4E8; color: #2E7D32; }
.screen .tabs { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; background: #fff; border-top: 1px solid #E2E7EC; display: flex; justify-content: space-around; align-items: center; color: #8A95A1; font-size: 20px; }
.screen .tabs .scanbtn { width: 50px; height: 50px; border-radius: 50%; background: #0E7C66; color: #fff; display: grid; place-items: center; margin-top: -26px; box-shadow: 0 6px 14px rgba(14, 124, 102, .4); font-size: 24px; }
.screen .tabs .on { color: #0E7C66; }

/* Sections */
section.block { padding-block: 80px; }
section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.kicker { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; margin-bottom: 10px; }
@media (prefers-color-scheme: dark) { .kicker { color: var(--primary-dark); } }
.intro { color: var(--muted); font-size: 1.1rem; margin-top: 14px; max-width: 40em; }

/* Anti-gaspillage */
.stat { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; background: var(--primary-soft); border-radius: var(--radius); padding: 22px 26px; margin-top: 32px; }
.stat strong { font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -0.03em; }
@media (prefers-color-scheme: dark) { .stat strong { color: var(--primary-dark); } }
.stat small { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
@media (max-width: 560px) { .stat { grid-template-columns: 1fr; } }
.cycle { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: step; }
.cycle li { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; }
section.alt .cycle li { background: var(--bg); }
.cycle li::before { counter-increment: step; content: counter(step); position: absolute; top: 14px; right: 16px; font-weight: 800; color: var(--faint); }
.cycle .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 24px; margin-bottom: 12px; }
.cycle li:last-child .ic { background: var(--ok); }
.cycle h3 { font-size: 1.02rem; }
.cycle p { color: var(--muted); font-size: .95rem; margin-top: 6px; }
.cycle li:not(:last-child)::after { content: ""; position: absolute; right: -12px; top: 50%; width: 10px; height: 10px; border-top: 2px solid var(--faint); border-right: 2px solid var(--faint); transform: translateY(-50%) rotate(45deg); }
.loop { margin-top: 14px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .95rem; }
.loop .icon { color: var(--primary); font-size: 1.3rem; }
@media (max-width: 900px) {
  .cycle { grid-template-columns: 1fr; }
  .cycle li { display: grid; grid-template-columns: 44px 1fr; gap: 0 14px; }
  .cycle .ic { grid-row: span 2; margin: 0; }
  .cycle li:not(:last-child)::after { right: auto; left: 37px; top: auto; bottom: -12px; transform: rotate(135deg); }
}

/* Fonctions */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 36px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { .card .ic { color: var(--primary-dark); } }
.card p { color: var(--muted); margin-top: 6px; font-size: .98rem; }

/* Confidentialité : schéma du partage */
.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .privacy { grid-template-columns: 1fr; gap: 32px; } }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks .icon { color: var(--ok); font-size: 1.4rem; margin-top: 2px; }
.flow { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.flow-row { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; }
.node { text-align: center; display: grid; justify-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.node .ic { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; background: var(--primary); color: #fff; }
.node.server .ic { background: var(--surface-alt); color: var(--muted); border: 2px dashed var(--faint); }
.node small { font-weight: 500; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.link { display: grid; justify-items: center; gap: 4px; color: var(--spark); font-size: .75rem; font-weight: 700; }
.link .bar { width: 46px; height: 3px; background: repeating-linear-gradient(90deg, var(--spark) 0 6px, transparent 6px 10px); border-radius: 2px; }
.link .icon { font-size: 1.2rem; }
.flow-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .92rem; display: flex; gap: 10px; }
.flow-note .icon { color: var(--primary); font-size: 1.3rem; }
@media (max-width: 480px) {
  .flow-row { grid-template-columns: 1fr; }
  .link { grid-auto-flow: column; }
  .link .bar { width: 3px; height: 26px; background: repeating-linear-gradient(180deg, var(--spark) 0 6px, transparent 6px 10px); }
}

/* Téléchargement */
.stores { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin-top: 32px; }
.store { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; box-shadow: var(--shadow); }
.store h3 { font-size: 1.15rem; }
.store p { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.store .btn { margin-top: 14px; background: var(--primary); color: #fff; }
.store .btn[aria-disabled="true"] { background: var(--surface-alt); color: var(--muted); pointer-events: none; }
.qr { width: 132px; height: 132px; border-radius: 12px; background: #fff; padding: 8px; display: grid; place-items: center; border: 1px solid var(--border); }
.qr svg { width: 100%; height: 100%; }
.qr.empty { background: var(--surface-alt); color: var(--faint); font-size: .8rem; text-align: center; font-weight: 600; border-style: dashed; }
@media (max-width: 420px) { .store { grid-template-columns: 1fr; } .qr { display: none; } }

/* Questions */
.faq { margin-top: 28px; display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 20px; min-height: 52px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 20px 18px; color: var(--muted); }

/* Pied de page */
.disclaimer { background: var(--surface-alt); border-radius: 14px; padding: 16px 20px; color: var(--muted); font-size: .92rem; display: flex; gap: 12px; margin-top: 8px; }
.disclaimer .icon { font-size: 1.3rem; color: var(--primary); margin-top: 2px; }
footer { border-top: 1px solid var(--border); padding-block: 36px 48px; color: var(--muted); font-size: .92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
footer a { color: var(--muted); }
footer .brand { font-size: 1.05rem; }
footer .brand img { width: 26px; height: 26px; }
footer .not-official { flex-basis: 100%; margin: 0; font-size: .85rem; line-height: 1.5; }
footer .not-official a { text-decoration: underline; }

/* Pages de texte (confidentialité, suppression, mentions légales) */
.doc { max-width: 760px; margin: 0 auto; padding-block: 48px 64px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); font-weight: 800; }
.doc .date { color: var(--muted); margin-top: 10px; }
.doc h2 { font-size: 1.35rem; margin: 40px 0 12px; }
.doc h3 { margin: 24px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc li { margin-bottom: 6px; }
.doc .summary { background: var(--primary-soft); border-radius: var(--radius); padding: 18px 22px 6px; margin-top: 28px; }
.doc .summary ul { padding-left: 20px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 12px; }
.doc table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.doc th { background: var(--surface-alt); font-weight: 700; }
.doc tr:last-child td { border-bottom: 0; }
.doc .todo { background: #FFF4D6; color: #6B4A00; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.doc .steps { counter-reset: s; list-style: none; padding: 0; }
.doc .steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 14px; }
.doc .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }

/* Vraies captures */
.hero .phone { height: 560px; overflow: hidden; }
.hero .phone img { display: block; width: 100%; height: auto; border-radius: 32px 32px 0 0; }
@media (max-width: 860px) { .hero .phone { height: 420px; } }
.gallery { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 20px; margin-top: 32px; }
.gallery figure { flex: 0 0 220px; margin: 0; scroll-snap-align: start; }
.gallery img { display: block; width: 100%; height: auto; border-radius: 22px; border: 6px solid #0B1014; box-shadow: var(--shadow); background: #0B1014; }
.gallery figcaption { margin-top: 10px; font-weight: 700; font-size: .95rem; text-align: center; }
@media (max-width: 560px) { .gallery figure { flex-basis: 64%; } }

/* Nos autres créations (letusgeek.com) */
#nos-apps { padding-block: 64px; }
.more-apps { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding: 36px 40px; border-radius: 24px; background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; text-decoration: none; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.more-apps::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 184, 61, .35), transparent 70%); pointer-events: none; }
.more-apps > div { flex: 1 1 380px; min-width: 0; position: relative; }
.more-apps h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; color: #fff; text-wrap: balance; }
.more-apps p { color: #DDF2EB; margin-top: 10px; max-width: 36em; }
.more-apps .more-kicker { color: var(--spark); font-weight: 800; letter-spacing: .12em; font-size: .82rem; margin: 0 0 8px; }
.more-chips { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.more-chips li { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); padding: 6px 12px; border-radius: 999px; font-size: .92rem; font-weight: 600; }
.more-chips .icon { width: 18px; height: 18px; fill: currentColor; }
.more-apps .btn { position: relative; flex: 0 0 auto; }
.more-apps .btn .icon { width: 20px; height: 20px; fill: currentColor; transition: transform .2s; }
.more-apps:hover .btn .icon { transform: translateX(4px); }
.more-apps:focus-visible { outline: 3px solid var(--spark); outline-offset: 3px; }
@media (max-width: 560px) { .more-apps { padding: 28px 22px; } .more-apps .btn { width: 100%; } }
