/* ==========================================================================
   Bienvenue Ghana — feuille de style
   Palette : papier froid, encre vert-noir, vert forêt, or (accent rare)
   Typo : Bricolage Grotesque (titres) + Instrument Sans (texte)
   ========================================================================== */

:root {
  --paper: #f5f7f4;
  --white: #ffffff;
  --ink: #11221b;
  --muted: #55655d;
  --line: #dfe5e0;
  --forest: #0e5a3c;
  --forest-dark: #0a432d;
  --forest-tint: #e5f0ea;
  --gold: #e0a526;
  --gold-tint: #fbf1d8;
  --alert: #b3412e;
  --alert-tint: #f8e7e3;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-text: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
  --wrap: 1120px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--forest); text-underline-offset: 3px; }
a:hover { color: var(--forest-dark); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--white);
  padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100;
}
.skip:focus { top: 1rem; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}
h1 { font-size: clamp(2.5rem, 6.2vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 62ch; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 54ch; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 247, 244, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: 1rem;
}
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem;
  letter-spacing: -0.03em; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: .45rem;
}
.brand-mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px var(--gold-tint);
  transition: transform .5s var(--ease);
}
.brand:hover .brand-mark { transform: scale(1.35); }

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem;
  position: relative; padding: .3rem 0;
}
.nav a.btn-primary { color: var(--white); }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--forest); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:not(.btn):hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.menu-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .55rem .8rem; font: inherit;
  color: var(--ink); cursor: pointer;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: .85rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--forest); color: var(--white); }
.btn-primary:hover { background: var(--forest-dark); color: var(--white); transform: translateY(-2px); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--white); transform: translateY(-2px); }
.btn-alert { background: var(--alert); color: var(--white); }
.btn-alert:hover { background: #8f3323; color: var(--white); transform: translateY(-2px); }
.btn-sm { padding: .55rem 1.05rem; font-size: .95rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-head { margin-bottom: 2.5rem; max-width: 40rem; }
.section-head h2 + p { margin-top: 1rem; color: var(--muted); }
.band { background: var(--white); border-block: 1px solid var(--line); }

/* ---------- Accueil : hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.hero h1 { margin-bottom: 1.4rem; }
.hero .lead { margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.routes { width: 100%; height: auto; }
.routes .city-label {
  font-family: var(--font-text); font-size: 18px; fill: var(--ink); font-weight: 500;
}
.routes .city-dot { fill: var(--ink); }
.routes .route-line {
  fill: none; stroke: var(--forest); stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.routes .accra-dot { fill: var(--gold); }
.routes .accra-ring { fill: none; stroke: var(--gold); stroke-width: 2; transform-box: fill-box; transform-origin: center; opacity: 0; }
.routes .accra-label {
  font-family: var(--font-display); font-weight: 800; font-size: 22px; fill: var(--ink);
}
.routes .city { opacity: 0; }

/* Séquence d'arrivée : une seule scène orchestrée */
.routes.play .route-line {
  animation: draw 1.15s var(--ease) forwards;
  animation-delay: calc(0.5s + var(--i) * 0.16s);
}
.routes.play .city {
  animation: appear .5s var(--ease) forwards;
  animation-delay: calc(0.3s + var(--i) * 0.16s);
}
.routes.play .accra-ring {
  animation: ring 1.8s var(--ease) 3;
  animation-delay: 2.1s;
}
.routes .accra { opacity: 0; }
.routes.play .accra { animation: appear .6s var(--ease) 0.1s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes ring {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.2); }
}

/* ---------- Recherche rapide ---------- */
.quick-search {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: .8rem;
  box-shadow: 0 18px 40px -28px rgba(17, 34, 27, 0.35);
}

/* ---------- Champs ---------- */
label { font-weight: 600; font-size: .95rem; display: block; margin-bottom: .35rem; }
.field { display: flex; flex-direction: column; }
input[type="text"], input[type="tel"], input[type="email"], input[type="search"],
select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .8rem .9rem; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 130px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b9c4bd; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px var(--forest-tint);
}
.hint { font-size: .9rem; color: var(--muted); margin-top: .3rem; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .35rem; width: 1.15rem; height: 1.15rem; accent-color: var(--forest); flex: none; }

/* ---------- Catégories ---------- */
.categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.category {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: border-color .3s, transform .3s var(--ease), background .3s;
}
.category:hover { border-color: var(--forest); transform: translateY(-4px); background: var(--forest-tint); color: var(--ink); }
.category svg { width: 30px; height: 30px; stroke: var(--forest); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.category strong { font-family: var(--font-display); font-size: 1.15rem; }
.category span { color: var(--muted); font-size: .95rem; line-height: 1.4; }

/* ---------- Cartes d'annonces ---------- */
.listings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; display: flex; flex-direction: column; gap: .7rem;
  animation: cardIn .45s var(--ease) both;
  animation-delay: calc(var(--n, 0) * 50ms);
  transition: border-color .3s, transform .3s var(--ease);
}
.card:hover { border-color: var(--forest); transform: translateY(-3px); }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0; font-size: 1rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.tag {
  font-size: .85rem; padding: .2rem .65rem; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); color: var(--muted);
}
.badge-certified {
  display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start;
  font-size: .85rem; font-weight: 600; color: var(--forest-dark);
  background: var(--forest-tint); padding: .25rem .7rem .25rem .5rem; border-radius: 999px;
}
.badge-certified svg { width: 16px; height: 16px; stroke: var(--forest); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.badge-example { background: var(--gold-tint); border-color: transparent; color: #7a5806; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Page annonces : filtres ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); margin-bottom: 1rem; }
.filters {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: .8rem; align-items: end;
  margin-bottom: 1.2rem;
}
.toggle { display: flex; align-items: center; gap: .6rem; padding-bottom: .85rem; font-weight: 500; cursor: pointer; }
.toggle input { accent-color: var(--forest); width: 1.15rem; height: 1.15rem; }
.result-count { color: var(--muted); margin-bottom: 1.2rem; }
.notice {
  background: var(--gold-tint); border-radius: var(--radius-sm); padding: .8rem 1rem;
  font-size: .98rem; margin-bottom: 1.6rem; max-width: none;
}
.empty {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 2.5rem 1.5rem;
  text-align: center; grid-column: 1 / -1; animation: cardIn .45s var(--ease) both;
}
.empty p { margin-inline: auto; }

/* ---------- Certification : séquence réelle ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 0; right: 0; top: 22px; height: 2px;
  background: var(--line); z-index: 0;
}
.steps::after {
  content: ""; position: absolute; left: 0; top: 22px; height: 2px; width: 100%;
  background: var(--forest); z-index: 0; transform: scaleX(0); transform-origin: left;
  transition: transform 1.6s var(--ease);
}
.steps.in::after { transform: scaleX(1); }
.step { position: relative; z-index: 1; }
.step-num {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 2px solid var(--line);
  font-family: var(--font-display); font-weight: 800; margin-bottom: 1rem;
  transition: border-color .5s, background .5s, color .5s;
}
.steps.in .step-num { border-color: var(--forest); background: var(--forest); color: var(--white); }
.steps.in .step:nth-child(1) .step-num { transition-delay: .1s; }
.steps.in .step:nth-child(2) .step-num { transition-delay: .7s; }
.steps.in .step:nth-child(3) .step-num { transition-delay: 1.3s; }
.step h3 { margin-bottom: .4rem; }
.step p { color: var(--muted); }

/* ---------- Appel à l'action ---------- */
.cta-block {
  background: var(--forest); color: var(--white); border-radius: calc(var(--radius) * 1.6);
  padding: clamp(2rem, 5vw, 3.5rem); display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 2rem; align-items: center;
}
.cta-block p { color: #d3e6dc; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; }
.cta-block .btn-primary { background: var(--gold); color: var(--ink); }
.cta-block .btn-primary:hover { background: #f0b83a; color: var(--ink); }
.cta-block .btn-ghost { border-color: var(--white); color: var(--white); }
.cta-block .btn-ghost:hover { background: var(--white); color: var(--forest-dark); }

/* ---------- Formulaires ---------- */
.form-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.aside-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; position: sticky; top: 90px;
}
.aside-card h3 { margin-bottom: .8rem; }
.aside-card ul { padding-left: 1.2rem; margin: 0; color: var(--muted); }
.aside-card li { margin-bottom: .5rem; }
.form-status {
  display: none; border-radius: var(--radius); padding: 1.4rem; background: var(--forest-tint);
}
.form-status.show { display: block; animation: cardIn .5s var(--ease) both; }
.form-status h3 { margin-bottom: .4rem; color: var(--forest-dark); }
.form-status p { margin: 0; }
.form-status .tick { width: 44px; height: 44px; margin-bottom: .7rem; }
.tick circle { fill: none; stroke: var(--forest); stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1; }
.tick path { fill: none; stroke: var(--forest); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.form-status.show .tick circle { animation: draw .6s var(--ease) forwards; }
.form-status.show .tick path { animation: draw .4s var(--ease) .45s forwards; }
.error-msg { color: var(--alert); font-size: .92rem; margin-top: .3rem; }
.alert-panel { border-left: 4px solid var(--alert); background: var(--alert-tint); padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.alert-panel p { margin: 0; }

/* ---------- Guides : liste de contrôle ---------- */
.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 1rem 0 .5rem; }
.progress > span {
  display: block; height: 100%; width: 0; background: var(--forest);
  border-radius: 999px; transition: width .6s var(--ease);
}
.progress-text { color: var(--muted); font-size: .95rem; margin-bottom: 2rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.checklist li {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .3s, background .3s;
}
.checklist li.done { background: var(--forest-tint); border-color: transparent; }
.checklist label {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.3rem; margin: 0; cursor: pointer; font-weight: 400;
}
.checklist input { margin-top: .4rem; width: 1.2rem; height: 1.2rem; accent-color: var(--forest); flex: none; }
.checklist strong { display: block; font-family: var(--font-display); font-size: 1.1rem; transition: opacity .3s; }
.checklist li.done strong { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .6; }
.checklist span { color: var(--muted); font-size: 1rem; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.guide-soon { background: var(--white); border: 1px dashed #b9c4bd; border-radius: var(--radius); padding: 1.3rem; }
.guide-soon h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.guide-soon p { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; margin-top: 2rem; background: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h3 { font-size: 1rem; margin-bottom: .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--forest); }
.footer-note { margin-top: 2rem; color: var(--muted); font-size: .9rem; max-width: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .form-layout, .cta-block { grid-template-columns: 1fr; }
  .cta-actions { justify-content: flex-start; }
  .categories { grid-template-columns: repeat(2, 1fr); }
  .listings, .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-search, .filters { grid-template-columns: 1fr 1fr; }
  .aside-card { position: static; }
}
@media (max-width: 720px) {
  .menu-toggle { display: inline-block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.2rem;
    display: none;
  }
  .nav.open { display: flex; animation: cardIn .3s var(--ease) both; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: .8rem; border-bottom: 2px solid transparent; }
  .listings, .guide-grid, .categories, .form-row, .footer-grid { grid-template-columns: 1fr; }
  .quick-search, .filters { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .steps::before, .steps::after { left: 22px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .steps::after { transform: scaleY(0); transform-origin: top; }
  .steps.in::after { transform: scaleY(1); }
  .step { padding-left: 4rem; }
  .step-num { position: absolute; left: 0; top: 0; margin: 0; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .routes .route-line { stroke-dashoffset: 0; }
  .routes .city, .routes .accra { opacity: 1; }
  .steps::after { transform: none; }
  .steps .step-num { border-color: var(--forest); background: var(--forest); color: var(--white); }
  .tick circle, .tick path { stroke-dashoffset: 0; }
}
