/* PlanUsine — thème « plan d'usine » : nuit industrielle + orange sécurité */
:root {
  --bg: #0C1420; --surface: #131E2E; --surface-2: #1A2B42; --ink: #EAF0F7;
  --muted: #8FA3B8; --line: #24344A; --accent: #FF6A2B; --accent-press: #E4571A;
  --ok: #3ECF8E; --warn: #FFC24B; --bad: #FF5C5C; --radius: 10px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 16px; line-height: 1.6;
}
.wrap { max-width: 1020px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.logo { font-size: 21px; font-weight: 400; letter-spacing: -.01em; color: var(--ink); }
.logo b { font-weight: 800; color: var(--accent); }
.logo:hover { text-decoration: none; }
nav.site a { color: var(--muted); margin-left: 18px; font-size: 14.5px; }
nav.site a.cta { color: #fff; background: var(--accent); padding: 8px 16px; border-radius: 8px; font-weight: 700; }
nav.site a.cta:hover { background: var(--accent-press); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 48px; text-align: left; position: relative;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; background-position: center;
}
.hero-inner { background: linear-gradient(180deg, rgba(12,20,32,.55), var(--bg) 85%); margin: -72px -20px -48px; padding: 72px 20px 48px; }
.hero h1 { font-size: clamp(34px, 6.5vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 14px; }
.hero h1 .o { color: var(--accent); }
.hero p.sub { font-size: clamp(16px, 2.5vw, 19px); color: var(--muted); max-width: 40rem; margin: 0 0 26px; }
.hero p.sub b { color: var(--ink); }
.btn {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 800;
  padding: 13px 26px; border-radius: 9px; font-size: 16px; border: none; cursor: pointer;
}
.btn:hover { background: var(--accent-press); text-decoration: none; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); font-weight: 600; }
.btn.ghost:hover { border-color: var(--muted); background: var(--surface); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 34px 0 0; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px 11px; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.35; }
.stat.hot b { color: var(--accent); }
.stat.good b { color: var(--ok); }

/* ---------- Sections ---------- */
section.block { padding: 52px 0 8px; }
.eyebrow { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 6px; }
h2 { font-size: clamp(23px, 3.5vw, 30px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 10px; }
p.lead { color: var(--muted); max-width: 46rem; margin: 0 0 22px; }
p.lead b, p.lead strong { color: var(--ink); }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 820px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); }
.card p b { color: var(--ink); }

/* ---------- Preuve / état de la base ---------- */
.proof { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: var(--radius); padding: 18px 20px; font-size: 15px; }
.proof b { color: var(--ok); }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
@media (max-width: 820px) { .pricing { grid-template-columns: 1fr; } }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; display: flex; flex-direction: column; gap: 8px; }
.price.star { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); position: relative; }
.price .tag { position: absolute; top: -11px; left: 18px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.price h3 { margin: 0; font-size: 15.5px; font-weight: 800; }
.price .amount { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.price .amount small { font-size: 15px; color: var(--muted); font-weight: 600; }
.price .amount .old { font-size: 17px; color: var(--muted); text-decoration: line-through; font-weight: 600; margin-right: 8px; }
.price ul { margin: 4px 0 14px; padding-left: 18px; color: var(--muted); font-size: 14px; flex: 1; }
.price ul li { margin-bottom: 6px; }
.price ul li b { color: var(--ink); }
.price .soon { text-align: center; color: var(--muted); font-size: 13.5px; border: 1.5px dashed var(--line); border-radius: 8px; padding: 11px; }

/* Garantie */
.guarantee { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--ok); border-radius: var(--radius); padding: 18px 20px; margin-top: 14px; }
.guarantee .g-icon { font-size: 26px; flex: none; line-height: 1.2; }
.guarantee b { color: var(--ok); font-size: 15.5px; }
.guarantee p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- FAQ / footer ---------- */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin-bottom: 8px; }
details summary { cursor: pointer; font-weight: 700; font-size: 15px; }
details p { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; }
footer.site { margin-top: 64px; border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: 13px; }
footer.site a { color: var(--muted); margin-right: 14px; }

/* ---------- App (annuaire) ---------- */
.gate { max-width: 420px; margin: 9vh auto 0; text-align: center; padding: 0 20px; }
.gate .logo { font-size: 26px; }
.gate p { color: var(--muted); font-size: 15px; }
input, select, textarea {
  width: 100%; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; font-size: 15.5px; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.gate input { text-align: center; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
.gate .btn { width: 100%; margin-top: 10px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 8px 0 0; }

.toolbar { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; margin: 18px 0 6px; }
@media (max-width: 760px) { .toolbar { grid-template-columns: 1fr 1fr; } .toolbar input[type="search"] { grid-column: 1 / -1; } }
.count { color: var(--muted); font-size: 13.5px; margin: 6px 0 14px; }
.count b { color: var(--ink); }
/* Filtres rapides (chips) */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 2px; }
.chip { font-size: 12.5px; font-weight: 700; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Mode découverte (annuaire ouvert, contacts réservés) */
.pubbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 13px 17px; margin: 16px 0 4px; font-size: 14px; }
.pubbar > div { flex: 1; min-width: 240px; color: var(--muted); }
.pubbar b { color: var(--ink); }
.pubbar .btn { flex: none; }
.meta.locked { color: var(--accent); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.lockbox { background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 10px; padding: 16px 18px; margin-top: 16px; }
.lock-t { margin: 0 0 5px; font-weight: 800; font-size: 14.5px; color: var(--accent); }
.lock-d { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.lock-d b { color: var(--ink); }

/* Suivi personnel par fiche */
.suivi { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); }
.s-title { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.s-title span { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.s-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 640px) { .s-row { grid-template-columns: 1fr; } }
.suivi input, .suivi select, .suivi textarea { font-size: 14px; padding: 9px 11px; }
.suivi textarea { resize: vertical; font-family: inherit; }
.s-saved { font-size: 12px; color: var(--ok); margin: 7px 0 0; min-height: 16px; }
.pill.suivi-p { background: var(--accent-soft); color: var(--accent); }

/* Modèles de messages traduits */
.tpl-box { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); }
.tpl-title { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.tpl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tpl-tab { font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-family: inherit; }
.tpl-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tpl-when { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; font-style: italic; }
.tpl-msg { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; margin-bottom: 8px; }
.tpl-msg.fr { opacity: .75; }
.tpl-lang { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tpl-msg p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tpl-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.discovery-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.discovery-note b { color: var(--ink); }

.fiches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 820px) { .fiches { grid-template-columns: 1fr; } }
.fiche { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; cursor: pointer; position: relative; }
.fiche:hover { border-color: var(--muted); }
.fiche h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; padding-right: 30px; }
.fiche .meta { font-size: 13px; color: var(--muted); }
.fiche .meta b { color: var(--ink); font-weight: 600; }
.fiche .fav { position: absolute; top: 10px; right: 12px; font-size: 17px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 4px; }
.fiche .fav.on { color: var(--warn); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-right: 6px; }
.pill.ok { background: rgba(62,207,142,.14); color: var(--ok); }
.pill.warn { background: rgba(255,194,75,.14); color: var(--warn); }
.pill.info { background: rgba(143,163,184,.16); color: var(--muted); }

.more { display: block; margin: 22px auto 60px; }

/* Modal fiche */
.overlay { position: fixed; inset: 0; background: rgba(5,10,18,.72); display: none; align-items: flex-end; justify-content: center; z-index: 50; }
.overlay.open { display: flex; }
@media (min-width: 700px) { .overlay { align-items: center; } }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 0 0;
  width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; padding: 22px 22px 26px;
}
@media (min-width: 700px) { .modal { border-radius: 14px; } }
.modal h2 { font-size: 21px; margin: 0 0 2px; padding-right: 40px; }
.modal .close { position: absolute; margin-left: calc(100% - 70px); margin-top: -4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; font-size: 15px; padding: 6px 11px; cursor: pointer; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 16px 0; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn.wa { background: #1FAF5F; }
.btn.wa:hover { background: #189150; }
.btn.tel { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.btn.tel:hover { border-color: var(--muted); background: var(--surface); }
.tel-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.tel-note b { color: var(--ink); }
.btn.small { padding: 10px 16px; font-size: 14.5px; }
.report { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Admin */
table.codes { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 16px; }
table.codes th, table.codes td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.codes th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.row { display: flex; gap: 8px; margin-top: 14px; }
.row input { flex: 1; }
