/* ---------- Identité : changez ces variables pour adapter la marque ---------- */
:root {
  --accent: #00B67A;        /* vert : boutons, étoiles, barres */
  --accent-dark: #00A06B;   /* survol des boutons */
  --accent-soft: #E6F7F1;   /* fonds légers (avatars, réponse) */
  --accent-ink: #00704B;    /* vert foncé pour le texte (contraste AA sur blanc) */
  --on-accent: #06281C;     /* texte posé sur le vert (le blanc n'est pas assez lisible) */
  --ink: #1B1B21;           /* texte principal */
  --muted: #5F6368;         /* texte secondaire (contraste AA sur blanc) */
  --bg: #F7F8F7;            /* fond de page */
  --card: #FFFFFF;
  --line: #E3E6E4;          /* bordures fines */
  --star-off: #D6DAD8;
  --radius: 14px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 248, 247, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand-logo { flex: none; color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  background: var(--accent); color: var(--on-accent);
  font: 600 16px/1.2 var(--font); text-decoration: none; text-align: center;
  border: 1px solid var(--accent); border-radius: 999px; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; white-space: nowrap; }
.btn-ghost { background: var(--card); color: var(--accent-ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- Étoiles (remplissage partiel via --pct) ---------- */
.stars {
  --pct: 0%;
  position: relative; display: inline-block; flex: none;
  font: 18px/1 Arial, "Segoe UI Symbol", sans-serif; letter-spacing: 2px;
  color: var(--star-off); white-space: nowrap;
}
.stars::before { content: "★★★★★"; }
.stars::after {
  content: "★★★★★"; position: absolute; top: 0; left: 0;
  width: var(--pct); overflow: hidden; color: var(--accent);
}
.stars-lg { font-size: 26px; letter-spacing: 3px; }

/* ---------- Bannière du site ---------- */
.site-banner { background: #06281C; color: #fff; text-align: center; padding: 32px 0 60px; }
.site-banner-title { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.site-banner-sub { margin-top: 8px; font-size: 15px; color: rgba(255, 255, 255, .82); }

/* ---------- Fiche de l'entreprise (chevauche la bannière) ---------- */
.hero { margin-top: -36px; }
.hero-in {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(6, 40, 28, .08);
}
.hero-logo {
  flex: none; width: 64px; height: 64px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; object-fit: contain;
}
.hero-text { flex: 1; min-width: 0; }
.hero-cta { width: 100%; }
.hero h1 { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 14px; color: var(--muted); min-height: 22px; }
.hero-link { display: inline-block; margin-top: 4px; padding: 2px 0; font-size: 14px; font-weight: 600; }

/* ---------- Résumé ---------- */
.summary { padding: 12px 0 8px; }
.summary-grid {
  display: grid; gap: 20px; margin-top: 18px; padding: 20px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.score { text-align: center; }
.score-num { font-size: 52px; line-height: 1; font-weight: 700; letter-spacing: -.03em; margin-bottom: 8px; }
.score-max { font-size: 20px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.score-count { margin-top: 6px; color: var(--muted); font-size: 14px; }

.bars { display: grid; gap: 2px; }
.summary-cta { grid-column: 1 / -1; width: 100%; }
.bar {
  display: grid; grid-template-columns: 34px 1fr 44px; align-items: center; gap: 10px;
  width: 100%; min-height: 40px; padding: 0 8px;
  background: none; border: 0; border-radius: 10px;
  font: 600 14px/1 var(--font); color: var(--ink); text-align: left; cursor: pointer;
}
.bar:hover:not(:disabled) { background: var(--accent-soft); }
.bar[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.bar:disabled { cursor: default; color: var(--muted); }
.bar-label span { color: var(--accent); font-family: Arial, sans-serif; }
.bar:disabled .bar-label span { color: var(--star-off); }
.bar-track { height: 10px; background: #ECEFED; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar-pct { text-align: right; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Barre d'outils ---------- */
.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.field-search { grid-column: 1 / -1; }
.toolbar input, .toolbar select {
  width: 100%; height: 46px; padding: 0 14px;
  font: 400 16px/1 var(--font); color: var(--ink);  /* 16px : évite le zoom auto sur iOS */
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  -webkit-appearance: none; appearance: none;
}
.toolbar select {
  padding-right: 34px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23645F6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.toolbar input::placeholder { color: var(--muted); opacity: 1; }
.toolbar input:focus-visible, .toolbar select:focus-visible { outline-offset: 0; border-color: var(--accent); border-radius: 12px; }

.status { margin: 14px 2px 10px; color: var(--muted); font-size: 14px; min-height: 22px; }
.status button {
  margin-left: 6px; padding: 4px 0; background: none; border: 0; cursor: pointer;
  font: 600 14px/1.2 var(--font); color: var(--accent-ink); text-decoration: underline;
}

/* ---------- Cartes d'avis ---------- */
.list { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 600; font-size: 15px; letter-spacing: .02em; text-transform: uppercase;
}
.who { min-width: 0; }
.name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.date { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.card h3 { margin-top: 10px; font-size: 16px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.body { margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.photo { display: inline-block; margin-top: 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); line-height: 0; }
.photo img { width: 88px; height: 88px; object-fit: cover; }
.reply {
  margin-top: 14px; padding: 12px 14px;
  background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  font-size: 15px;
}
.reply-head { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.reply-head time { font-weight: 400; color: var(--muted); }
.reply-body { white-space: pre-line; overflow-wrap: anywhere; }

.empty { padding: 32px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

.more { display: flex; justify-content: center; margin: 18px 0 0; }
.more .btn { width: 100%; max-width: 340px; }

/* ---------- Formulaire d'avis (fenêtre) ---------- */
.modal {
  width: min(100vw - 24px, 520px); max-height: calc(100dvh - 24px); padding: 20px 16px;
  background: var(--card); color: var(--ink); border: 0; border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(6, 40, 28, .3);
}
.modal::backdrop { background: rgba(6, 40, 28, .55); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 19px; line-height: 1.3; font-weight: 700; }
.modal-close {
  flex: none; width: 40px; height: 40px; margin: -6px -6px 0 0; background: none; border: 0; border-radius: 50%;
  font: 400 28px/1 Arial, sans-serif; color: var(--muted); cursor: pointer;
}
.modal-close:hover { background: var(--accent-soft); color: var(--ink); }
.rate { margin: 0 0 12px; padding: 0; border: 0; }
.rate legend, .form-field label { display: block; padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.optional { font-weight: 400; color: var(--muted); }
.rate-stars { display: flex; gap: 2px; }
.rate-stars label { position: relative; margin: 0; padding: 2px 4px; font: 36px/1 Arial, sans-serif; color: var(--star-off); cursor: pointer; border-radius: 8px; }
.rate-stars label.on { color: var(--accent); }
.rate-stars input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rate-stars label:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.form-field { margin-bottom: 12px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 11px 14px; font: 400 16px/1.5 var(--font); color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.form-msg { margin-bottom: 12px; padding: 10px 12px; font-size: 14px; color: #8C1D18; background: #FCEEED; border-radius: 10px; }
.form-done { margin: 6px 0 16px; font-weight: 600; }
.modal-submit { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- Présentation de l'entreprise ---------- */
.about {
  margin: 36px 0 0; padding: 20px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.about h2 { font-size: 18px; line-height: 1.3; font-weight: 700; margin-bottom: 10px; }
.about p { font-size: 15px; color: var(--muted); }
.about p + p { margin-top: 10px; }

/* ---------- Appel à l'action bas de page ---------- */
.cta {
  margin: 16px 0 0; padding: 28px 20px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.cta h2 { font-size: 20px; line-height: 1.3; font-weight: 700; margin-bottom: 16px; }
.cta .btn { width: 100%; max-width: 340px; }

.footer { padding-top: 24px; padding-bottom: 32px; text-align: center; color: var(--muted); font-size: 13px; }
.footer a { color: inherit; }
.noscript { max-width: 760px; margin: 0 auto 32px; padding: 0 16px; text-align: center; }

/* ---------- Écrans plus larges ---------- */
@media (min-width: 640px) {
  .site-banner { padding: 48px 0 80px; }
  .site-banner-title { font-size: 34px; }
  .site-banner-sub { font-size: 17px; }
  .hero { margin-top: -44px; }
  .hero-in { padding: 24px; gap: 20px; }
  .hero-logo { width: 80px; height: 80px; }
  .hero-cta { width: auto; }
  .hero h1 { font-size: 26px; }
  .summary-grid { grid-template-columns: 200px 1fr; align-items: center; gap: 28px; padding: 24px; }
  .toolbar { grid-template-columns: 1fr 180px 180px; }
  .field-search { grid-column: auto; }
  .card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
