/* ============================================================
   LABELY — style.css
   Palette : Encre #14181D · Papier #FBFAF7 · Vert sceau #17864B
   Typo : Archivo (titres) · IBM Plex Sans (texte) · IBM Plex Mono (n° de certificat)
   ============================================================ */

:root {
  --ink: #14181d;
  --ink-soft: #1d232a;
  --paper: #fbfaf7;
  --white: #ffffff;
  --red: #17864b;
  --red-dark: #0f6437;
  --line: #e5e2db;
  --line-dark: #2c333c;
  --muted: #5a6068;
  --muted-light: #9aa2ab;
  --radius: 14px;
  --container: 1160px;
  --font-display: "Archivo", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------- Typo ---------- */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--red); }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.dark .lead { color: var(--muted-light); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 15px 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.dark .btn-ghost { border-color: var(--line-dark); color: #fff; }
.dark .btn-ghost:hover { border-color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 24, 29, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-dark);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.logo-img {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a {
  color: var(--muted-light);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: #fff; }
.main-nav .btn { padding: 10px 20px; font-size: 0.9rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.dark { background: var(--ink); color: #fff; }
.dark h1, .dark h2, .dark h3 { color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 100px; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}
.hero .rotator { color: var(--red); display: inline-block; min-width: 5.5ch; }
.hero p.lead { margin: 24px 0 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted-light);
}

/* Carte certificat (élément signature) */
.cert-card {
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  transform: rotate(1.5deg);
}
.cert-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  pointer-events: none;
}
.cert-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.cert-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.cert-status.st-expire { color: #9a6b00; background: #fdf3dd; }
.cert-status.st-retire { color: #b3261e; background: #fdecea; }
.cert-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0d7a3f;
  background: #e7f5ec;
  padding: 5px 12px;
  border-radius: 999px;
}
.cert-name { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; margin-bottom: 4px; }
.cert-meta { font-size: 0.88rem; color: var(--muted); margin-bottom: 22px; }
.cert-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.cert-dates { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); line-height: 1.8; }
.cert-seal {
  width: 74px; height: 74px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-align: center;
  line-height: 1.5;
  border: 3px double #fff;
  outline: 3px solid var(--red);
}

/* Sceau image sur les cartes certificat */
.cert-seal-img { width: 76px; height: 76px; flex-shrink: 0; }

/* Aperçu du certificat officiel intégré (accueil) */
.cert-embed {
  width: min(620px, 100%);
  margin: 36px auto 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.16);
  background: var(--white);
  border: 1px solid var(--line);
}
.cert-embed iframe {
  width: 794px;   /* largeur A4 à l'écran ; redimensionné par script.js */
  height: 1123px;
  border: 0;
  display: block;
  transform-origin: top left;
  pointer-events: none; /* simple aperçu, le lien "voir en grand" ouvre la vraie page */
}

/* ---------- Cartes / grilles ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.dark .card { background: var(--ink-soft); border-color: var(--line-dark); }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.97rem; }
.dark .card p { color: var(--muted-light); }

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--red);
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 14px;
}

/* Familles de certification */
.family { display: flex; align-items: center; gap: 16px; padding: 22px 26px; }
.family h3 { margin: 0; font-size: 1.05rem; }
.family-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: rgba(23, 134, 75, 0.10);
  color: var(--red);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; text-align: center; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--red);
  line-height: 1;
}
.stat-label { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-light); margin-top: 12px; }

/* Bande CTA */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 680px; margin: 0 auto 18px; }
.cta-band p { max-width: 560px; margin: 0 auto 34px; }

/* ---------- Formulaires ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 42px;
}
fieldset { border: 0; margin-bottom: 44px; }
fieldset:last-of-type { margin-bottom: 0; }
legend {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.legend-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #fff;
  background: var(--red);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.fieldset-hint { font-size: 0.9rem; color: var(--muted); margin-bottom: 22px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.form-row .form-field { margin-bottom: 0; }
label { font-weight: 600; font-size: 0.92rem; }
.hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="number"], input[type="file"], select, textarea {
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(23, 134, 75, 0.14);
}
textarea { resize: vertical; min-height: 120px; }

.check-field { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font-size: 0.95rem; }
.check-field input { margin-top: 4px; accent-color: var(--red); width: 17px; height: 17px; flex-shrink: 0; }
.check-field label { font-weight: 400; }

/* ---------- Sélecteur de formule ---------- */
.plan-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
.plan-option { position: relative; cursor: pointer; }
.plan-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.plan-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 22px 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.plan-option:hover .plan-box { border-color: var(--muted-light); }
.plan-option input:checked + .plan-box {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(23, 134, 75, 0.14);
  background: var(--white);
}
.plan-option input:focus-visible + .plan-box { outline: 3px solid var(--red); outline-offset: 2px; }
.plan-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-check {
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: transparent;
  transition: all 0.15s ease;
}
.plan-option input:checked + .plan-box .plan-check { background: var(--red); border-color: var(--red); color: #fff; }
.plan-price { font-family: var(--font-mono); font-size: 0.85rem; color: var(--red); }
.plan-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* ---------- Vérification ---------- */
.verify-box { display: flex; gap: 12px; max-width: 560px; }
.verify-box input { font-family: var(--font-mono); letter-spacing: 0.04em; }
.result-demo { margin-top: 40px; max-width: 560px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--muted-light); padding: 70px 0 34px; border-top: 1px solid var(--line-dark); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 42px; margin-bottom: 50px; }
.site-footer h4 { color: #fff; font-family: var(--font-display); font-size: 0.95rem; margin-bottom: 16px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--muted-light); text-decoration: none; font-size: 0.93rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ---------- Divers ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.values-list { list-style: none; margin-top: 26px; }
.values-list li { display: flex; gap: 14px; margin-bottom: 18px; }
.values-list .dot { color: var(--red); font-weight: 700; flex-shrink: 0; }

.price-tag { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; margin: 14px 0 4px; }
.price-tag span { font-size: 0.95rem; font-weight: 500; color: var(--muted); font-family: var(--font-body); }
.card ul.features { list-style: none; margin-top: 18px; }
.card ul.features li { padding-left: 24px; position: relative; margin-bottom: 10px; font-size: 0.94rem; color: var(--muted); }
.card ul.features li::before { content: "✓"; color: var(--red); position: absolute; left: 0; font-weight: 700; }
.card.featured { border: 2px solid var(--red); position: relative; }
.badge-pop {
  position: absolute; top: -13px; left: 26px;
  background: var(--red); color: #fff;
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 44px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .section { padding: 68px 0; }
  .grid-3, .grid-4, .grid-2, .form-row, .stats, .plan-picker { grid-template-columns: 1fr; }
  .main-nav {
    display: none;
    position: absolute;
    top: 74px; left: 0; right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--line-dark);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .form-card { padding: 28px 22px; }
  .verify-box { flex-direction: column; }
  .cert-card { transform: none; }
}


/* ---------- Fiche enrichie (annuaire) ---------- */
.card-photo {
  width: calc(100% + 56px);
  margin: -32px -28px 20px;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}
.card.featured .card-photo { width: calc(100% + 52px); margin: -30px -26px 20px; }

/* ---------- Back-office ---------- */
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--paper); }
.admin-table td form { display: inline-block; margin: 0 4px 0 0; }
.admin-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 26px; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.tag { font-family: var(--font-mono); font-size: 0.7rem; padding: 3px 10px; border-radius: 999px; background: #eee; white-space: nowrap; }
.tag.valide, .tag.acceptee { background: #e7f5ec; color: #0d7a3f; }
.tag.expire, .tag.en_examen, .tag.suspendu { background: #fdf3dd; color: #9a6b00; }
.tag.retire, .tag.refusee { background: #fdecea; color: #b3261e; }
.tag.nouvelle { background: #e8f0fe; color: #1a56db; }
.admin-table select, .admin-table input { width: auto; padding: 6px 8px; font-size: 0.85rem; }
.cf-turnstile { margin: 8px 0 20px; }


/* ---------- Annuaire : lignes rectangulaires ---------- */
.dir-list { display: flex; flex-direction: column; gap: 18px; }
.dir-row {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  position: relative;
}
.dir-row.featured { border: 2px solid var(--red); }
.dir-photo {
  width: 190px;
  height: 120px;
  object-fit: contain;      /* l'image entière est visible, jamais coupée */
  background: var(--white);
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.dir-main { flex: 1; min-width: 0; }
.dir-main h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.dir-meta { color: var(--muted); font-size: 0.95rem; }
.dir-desc { color: var(--muted); font-size: 0.93rem; margin-top: 8px; }
.dir-links { margin-top: 10px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.dir-links a { color: var(--red); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.dir-links .dir-cert { font-family: var(--font-mono); font-weight: 400; font-size: 0.78rem; }
.badge-inline {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--red);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Filtres annuaire ---------- */
.annuaire-filter { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 16px; align-items: end; }
.annuaire-filter .form-field { margin-bottom: 0; }

/* ---------- Pages légales ---------- */
.legal { max-width: 780px; }
.legal h2 { font-size: 1.35rem; margin: 44px 0 14px; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: var(--ink); font-size: 0.98rem; margin-bottom: 12px; }
.legal ul { margin: 0 0 12px 22px; }
.legal .maj { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-top: 40px; }

@media (max-width: 680px) {
  .dir-row { flex-direction: column; align-items: stretch; padding: 20px; }
  .dir-photo { width: 100%; height: 160px; }
  /* Carte certificat : chaque info sur sa ligne, sceau rond garanti */
  .cert-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cert-status { white-space: nowrap; }
  .cert-id { font-size: 0.85rem; }
  .cert-bottom { align-items: flex-end; gap: 14px; }
  .cert-seal { width: 62px; height: 62px; font-size: 0.5rem; }
  .cert-seal-img { width: 60px; height: 60px; }
  .annuaire-filter { grid-template-columns: 1fr; }
  .annuaire-filter .btn { width: 100%; justify-content: center; }
}


/* ---------- Bandeau cookies ---------- */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 560px;
  margin: 0 auto;
  z-index: 90;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.cookie-banner p { font-size: 0.88rem; color: var(--muted-light); margin-bottom: 14px; }
.cookie-banner a { color: #fff; }
.cookie-banner .btn-ghost { color: #fff; border-color: var(--line-dark); }
.cookie-banner .btn-ghost:hover { border-color: #fff; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 680px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 16px; }
  .cookie-actions .btn { flex: 1; justify-content: center; }
}
