/* ============================================================
   Emargio — Thème clair B2B
   Vanilla CSS, mobile-first, variables CSS.
   ============================================================ */

:root {
  --accent: #FF5722;
  --accent-dark: #E64A19;
  --accent-soft: #FFF0EB;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --text: #1C2128;
  --muted: #67707C;
  --border: #E3E6EA;
  --ok: #16A34A;
  --ok-soft: #EAF7EF;
  --warn: #C2700B;
  --warn-soft: #FdF3E4;
  --danger: #DC2626;
  --danger-soft: #FDEDED;
  --info: #2563EB;
  --info-soft: #EBF1FE;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }
.container-narrow { max-width: 480px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }
  h1 { font-size: 1.8rem; }
}

/* --- Barre supérieure ------------------------------------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.02rem; color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 800;
}
.topnav { display: flex; gap: 2px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.topnav a, .topnav button {
  color: var(--muted); font-size: .92rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
  background: none; border: 0; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.topnav a:hover, .topnav button:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.topnav .active { color: var(--accent-dark); background: var(--accent-soft); }

/* --- Cartes ------------------------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin-top: 0; }

/* --- Boutons ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; font-family: inherit;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s;
  line-height: 1.3;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { color: var(--danger); border-color: #F3C3C3; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* --- Formulaires ------------------------------------------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit;
  background: var(--card); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent);
}
textarea { min-height: 110px; resize: vertical; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.checkline input { width: 19px; height: 19px; margin-top: 2px; flex: none; }

/* --- Tableaux ---------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .sig-thumb { height: 30px; max-width: 90px; object-fit: contain; display: block; }

/* --- Badges & bandeaux ------------------------------------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: .76rem; font-weight: 600; white-space: nowrap;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; }

.banner {
  padding: 11px 16px; font-size: .92rem;
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.banner-info { background: var(--info-soft); color: var(--info); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-danger { background: var(--danger-soft); color: var(--danger); }
.banner .btn { padding: 4px 12px; font-size: .85rem; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .94rem; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--info-soft); color: var(--info); }

/* --- Pied de page ------------------------------------------ */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 16px 26px; text-align: center;
  font-size: .84rem; color: var(--muted);
}
.footer a { color: var(--muted); margin: 0 8px; }

/* --- Vitrine ------------------------------------------------ */
.hero { text-align: center; padding: 44px 16px 28px; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 1.9rem; margin-bottom: 14px; }
.hero .lead { font-size: 1.08rem; color: var(--muted); margin-bottom: 26px; }
@media (min-width: 720px) { .hero h1 { font-size: 2.5rem; } .hero { padding-top: 64px; } }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature { text-align: left; }
.feature .ico {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 10px;
}
.steps { counter-reset: step; }
.step { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.step-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.pricing-card { text-align: center; padding: 28px 20px; }
.pricing-card .price { font-size: 1.9rem; font-weight: 800; margin: 8px 0 2px; }
.pricing-card.featured { border-color: var(--accent); border-width: 2px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq-item summary { font-weight: 600; cursor: pointer; }
.faq-item p { margin: 10px 0 4px; color: var(--muted); }

/* --- Page publique d'émargement (mobile-first) -------------- */
.sign-shell { max-width: 470px; margin: 0 auto; padding: 14px 14px 40px; }
.sign-head { text-align: center; padding: 14px 0 4px; }
.sign-head .org { font-size: .86rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sign-head h1 { font-size: 1.25rem; margin: 6px 0 2px; }
.sign-head .slot-label { color: var(--accent-dark); font-weight: 600; }
.sigpad-wrap { position: relative; }
.sigpad {
  width: 100%; height: 170px; display: block;
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  background: #fff;
  touch-action: none;
}
.sigpad-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #C3C9D1; font-size: .95rem; pointer-events: none;
}
.sign-done { text-align: center; padding: 48px 18px; }
.sign-done .big { font-size: 3rem; margin-bottom: 8px; }

/* --- Page QR plein écran ------------------------------------ */
.qrpage {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: #fff; text-align: center; padding: 24px;
}
.qrpage h1 { font-size: 1.5rem; margin: 0; }
.qrpage .slot-label { color: var(--accent-dark); font-weight: 700; font-size: 1.15rem; }
.qrbox { width: min(62vmin, 440px); }
.qrbox svg { width: 100%; height: auto; display: block; }
.qr-url {
  font-size: 1.15rem; font-weight: 600; letter-spacing: .02em;
  background: var(--bg); border-radius: 10px; padding: 8px 18px;
  word-break: break-all;
}
.qr-counter { font-size: 1.35rem; font-weight: 700; }
.qr-counter .num { color: var(--accent-dark); font-size: 1.7rem; }
.qr-recent { color: var(--muted); min-height: 1.4em; font-size: .98rem; }
.qr-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* --- Grille d'évaluations ----------------------------------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg label {
  padding: 6px 11px; font-size: .85rem; cursor: pointer; background: var(--card);
  border-right: 1px solid var(--border); white-space: nowrap;
}
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { font-weight: 700; }
.seg label:has(input:checked) { background: var(--accent-soft); color: var(--accent-dark); }
.seg label:has(input[value=success]:checked) { background: var(--ok-soft); color: var(--ok); }
.seg label:has(input[value=fail]:checked) { background: var(--danger-soft); color: var(--danger); }

/* --- Créneaux (cartes) --------------------------------------- */
.slot-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between;
}
.slot-card .slot-meta { min-width: 180px; }
.slot-card .slot-title { font-weight: 700; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-off { background: #C3C9D1; }

/* --- Tuiles de stats ----------------------------------------- */
.stat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
@media (min-width: 720px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-tile .n { font-size: 1.5rem; font-weight: 800; }
.stat-tile .l { font-size: .8rem; color: var(--muted); }

/* --- Divers --------------------------------------------------- */
.empty {
  text-align: center; color: var(--muted); padding: 34px 16px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.list-actions { display: flex; gap: 6px; flex-wrap: wrap; }
code.copy { background: var(--bg); padding: 3px 8px; border-radius: 6px; font-size: .85rem; }
