/* ==========================================================================
   echeckin.ma — Site vitrine (marketing)
   --------------------------------------------------------------------------
   Feuille autonome (app.css n'est PAS chargé sur le vitrine) : les valeurs
   de marque reprennent les tokens de l'application — bleu marine #1a2e4a et
   doré #c9a84c (voir assets/css/tokens.css) — pour une identité cohérente.
   Mobile-first : styles de base pour téléphone, media queries en min-width.
   ========================================================================== */

:root {
  --navy-900: #1a2e4a;
  --navy-700: #243d61;
  --navy-500: #2e4f7c;
  --navy-100: #d5e0ed;
  --navy-50:  #eef2f7;

  --gold-500: #c9a84c;
  --gold-400: #dbb96a;
  --gold-100: #f7edcc;
  --gold-50:  #fdf8ee;

  --ink-900:   #111827;
  --ink-700:   #374151;
  --slate-500: #6b7280;
  --slate-400: #9ca3af;

  --success-500: #22c55e;

  --paper-50:  #f8f9fc;
  --surface:   #ffffff;
  --hairline:  #e5e7eb;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --header-h: 3.75rem;
}

/* --- Reset minimal ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body.site {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--surface);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.75rem; }
p { margin: 0 0 1rem; }
a { color: var(--navy-500); }

.site-container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.site-container--narrow { max-width: 46rem; }

/* --- Boutons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }

.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-400); }

.btn-navy { background: var(--navy-900); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }

.btn-outline { border-color: rgb(255 255 255 / 0.55); color: #fff; }
.btn-outline:hover { border-color: #fff; background: rgb(255 255 255 / 0.08); }

.btn-ghost { color: var(--navy-900); }
.btn-ghost:hover { background: var(--navy-50); }

/* --- Header ------------------------------------------------------------- */
/* Fixe et superposé, fond blanc opaque en permanence (logo marine, liens
   foncés) — y compris au-dessus du hero. Le hero réserve la hauteur du header
   dans son padding, il n'est donc jamais masqué. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);

  /* Palette « header opaque » (fond clair), constante. */
  --hdr-logo: var(--navy-900);
  --hdr-link: var(--ink-700);
  --hdr-ghost: #5b6b82;         /* Connexion : gris-bleu discret */
  --hdr-ghost-strong: var(--navy-900);
  --hdr-toggle: var(--navy-900);
}

/* Fine bordure zellige dorée en bas du header : réseau de losanges obtenu
   par deux trames diagonales croisées. ~5px, volontairement discret. */
.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background-image:
    repeating-linear-gradient(45deg,  var(--gold-500) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, var(--gold-500) 0 1px, transparent 1px 8px);
  opacity: 0.5;
  pointer-events: none;
}

/* Pages sans hero : réserver la hauteur du header fixe. */
body:not(:has(.hero)) main { padding-top: var(--header-h); }

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}
.site-logo { display: flex; align-items: center; text-decoration: none; }
/* Logo image (icône + « echeckin.ma »), un seul élément dont le JS échange le
   src selon l'état du header. Compact sur mobile ; agrandi un peu sur desktop
   (voir le media query). */
.site-logo-img { display: block; height: 2.5rem; max-height: 55px; width: auto; }

/* Conservé pour le pied de page (texte seul, sans image). */
.site-logo-text { font-size: 1.2rem; font-weight: 700; color: var(--hdr-logo); }
.site-logo-dot { color: var(--gold-500); }

/* Bouton hamburger : à droite du header (dernier enfant flex, aligné avec le
   logo grâce à justify-content: space-between). Les 3 barres se muent en croix
   quand le tiroir est ouvert. */
.site-nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0.6rem;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 62; /* au-dessus du tiroir pour rester cliquable */
}
.site-nav-toggle span {
  width: 22px; height: 2px;
  background: var(--hdr-toggle);
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
/* Hamburger ouvert : croix. Le tiroir est blanc, la croix doit rester marine. */
.site-nav-toggle.is-open span { background: var(--navy-900); }
.site-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.site-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Fond semi-transparent cliquable derrière le tiroir. */
.site-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.site-nav-backdrop.is-open { opacity: 1; visibility: visible; }
body.site-nav-lock { overflow: hidden; }

/* Menu mobile : tiroir latéral coulissant depuis la droite, par-dessus le
   contenu (il ne pousse plus la page vers le bas). */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(82vw, 320px);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 4.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
.site-nav.is-open { transform: translateX(0); }

/* Liens de menu (5 ancres) : soulignement doré qui se déploie au survol.
   Dans le tiroir (fond blanc) les liens sont toujours foncés ; sur desktop le
   media query rétablit la couleur pilotée par l'état du header. */
.site-nav > a {
  position: relative;
  padding: 0.55rem 0.25rem;
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 500;
}
.site-nav > a::after {
  content: '';
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  bottom: 0.2rem;
  height: 2px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.site-nav > a:hover::after,
.site-nav > a:focus-visible::after { transform: scaleX(1); }
/* Section visible pendant le scroll : soulignement permanent plus discret. */
.site-nav > a.is-active::after { transform: scaleX(1); opacity: 0.7; }

/* Actions : « Connexion » (texte discret) nettement séparé du bouton doré.
   Dans le tiroir (fond blanc) « Connexion » est foncé ; desktop rétablit la
   couleur pilotée par l'état du header. */
.site-nav-actions { display: flex; gap: 0.75rem; padding-top: 0.75rem; }
.site-nav-actions .btn { flex: 1; }
.site-nav-actions .btn-ghost {
  color: #5b6b82;
  background: none;
  font-weight: 500;
}
.site-nav-actions .btn-ghost:hover {
  color: var(--navy-900);
  background: var(--navy-50);
}

@media (min-width: 56rem) {
  /* Éléments propres au tiroir mobile : masqués sur desktop. */
  .site-nav-toggle,
  .site-nav-backdrop { display: none; }

  /* Le tiroir redevient une barre de navigation horizontale dans le flux. */
  .site-nav {
    position: static;
    transform: none;
    display: flex;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 1.4rem;
    padding: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
  }
  .site-nav > a { color: var(--hdr-link); padding: 0.25rem 0; }
  .site-nav > a::after { left: 0; right: 0; bottom: -0.15rem; }
  /* Hiérarchie : au moins le double de l'espacement d'origine (0.75rem). */
  .site-nav-actions { padding: 0; margin-left: 1.25rem; gap: 1.6rem; }
  .site-nav-actions .btn { flex: none; }
  .site-nav-actions .btn-ghost {
    color: var(--hdr-ghost);
    padding-left: 0;
    padding-right: 0;
  }
  .site-nav-actions .btn-ghost:hover { color: var(--hdr-ghost-strong); background: none; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
  .site-nav > a::after { transition: none; }
  .site-nav,
  .site-nav-backdrop,
  .site-nav-toggle span { transition: none; }
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--navy-500) 100%);
  color: #fff;
  /* Le header fixe se superpose : on dégage sa hauteur en haut du hero. */
  padding: calc(var(--header-h) + 1.25rem) 0 3.25rem;
}
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-eyebrow {
  color: var(--gold-400);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.hero h1 { font-size: 1.7rem; font-weight: 800; }
.hero-sub { color: var(--navy-100); font-size: 1.05rem; margin: 1rem 0 1.5rem; }
.hero-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.hero-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  padding: 0;
  margin: 1.5rem 0 0;
  font-size: 0.88rem;
  color: var(--navy-100);
}
.hero-trust li { display: flex; align-items: center; gap: 0.4rem; }
.hero-trust .check-ico { color: var(--gold-400); }
.check-ico { width: 1em; height: 1em; flex: none; }

.hero-visual img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 56rem) {
  .hero { padding: calc(var(--header-h) + 2.5rem) 0 5rem; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 3.5rem; }
  .hero h1 { font-size: 2.4rem; }
  .hero-actions { flex-direction: row; }
}

/* --- Bandeau confiance ---------------------------------------------------- */
.strip { background: var(--gold-50); border-bottom: 1px solid var(--gold-100); }
.strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: center;
  padding: 0.9rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-700);
}

/* --- Sections génériques -------------------------------------------------- */
.section { padding: 3.25rem 0; }
.section--alt { background: var(--paper-50); }
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--navy-900);
}
.section-sub {
  text-align: center;
  color: var(--slate-500);
  max-width: 40rem;
  margin: 0 auto 2.25rem;
}
@media (min-width: 56rem) {
  .section { padding: 4.5rem 0; }
  .section-title { font-size: 2rem; }
}

/* --- Comment ça marche ----------------------------------------------------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.step img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.step-num {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  display: grid;
  place-items: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: var(--radius-full);
  background: var(--gold-500);
  color: var(--navy-900);
  font-weight: 800;
}
.step h3 { font-size: 1.05rem; margin: 1rem 1.1rem 0.4rem; color: var(--navy-900); }
.step p { font-size: 0.92rem; color: var(--slate-500); margin: 0 1.1rem 1.2rem; }

@media (min-width: 40rem)  { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem)  { .steps { grid-template-columns: repeat(4, 1fr); } }

/* --- Fonctionnalités -------------------------------------------------------- */
.features-grid { display: grid; gap: 1.25rem; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--shadow-sm);
}
.feature-ico {
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--navy-50);
  color: var(--navy-500);
  margin-bottom: 1rem;
}
.feature-ico svg { width: 1.5rem; height: 1.5rem; }
.feature-card h3 { font-size: 1.05rem; color: var(--navy-900); }
.feature-card p { font-size: 0.92rem; color: var(--slate-500); margin: 0; }

@media (min-width: 40rem) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

/* --- Tarifs ------------------------------------------------------------------ */
.pricing-grid { display: grid; gap: 1.25rem; margin-bottom: 3rem; }
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-sm);
}
/* Carte Gratuit : LE point d'entrée — contour doré, ombre marquée, et
   légèrement surélevée quand les 4 cartes sont côte à côte. */
.plan-card--free {
  border: 2px solid var(--gold-500);
  background: var(--gold-50);
  box-shadow: var(--shadow-lg);
}
.plan-card--popular {
  border-color: var(--navy-500);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 64rem) {
  .plan-card--free { transform: translateY(-0.6rem); }
}
.plan-flag {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
}
.plan-flag--navy { background: var(--navy-900); color: #fff; }
.plan-name { font-size: 1.15rem; font-weight: 800; text-transform: capitalize; color: var(--navy-900); margin-bottom: 0.15rem; }
.plan-tagline { font-size: 0.85rem; color: var(--slate-500); margin-bottom: 1rem; }
.plan-price { margin: 0 0 1.1rem; }
.plan-price strong { font-size: 2rem; font-weight: 800; color: var(--navy-900); }
.plan-period { font-size: 0.85rem; color: var(--slate-500); margin-left: 0.35rem; }
.plan-points {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem;
  font-size: 0.9rem;
  flex: 1;
  display: grid;
  gap: 0.5rem;
}
.plan-points li { display: flex; align-items: baseline; gap: 0.5rem; }
.plan-points .check-ico { color: var(--success-500); position: relative; top: 0.1em; }

@media (min-width: 40rem) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .pricing-grid { grid-template-columns: repeat(4, 1fr); } }

.pricing-empty { text-align: center; color: var(--slate-500); }
.pricing-note { text-align: center; font-size: 0.8rem; color: var(--slate-400); margin-top: 1.5rem; }

/* Tableau comparatif — scroll horizontal contenu sur mobile */
.compare-title { text-align: center; font-size: 1.2rem; font-weight: 700; color: var(--navy-900); margin-bottom: 1.25rem; }
.compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--hairline); border-radius: var(--radius-lg); }
.compare-table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: 0.9rem; background: var(--surface); }
.compare-table th, .compare-table td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--hairline); }
.compare-table thead th {
  background: var(--navy-900);
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
}
.compare-table thead th.compare-feature-col { text-align: left; }
.compare-price { display: block; font-size: 0.75rem; font-weight: 500; color: var(--navy-100); }
.compare-table tbody th { text-align: left; font-weight: 500; color: var(--ink-700); }
.compare-table td { text-align: center; color: var(--ink-700); }
.compare-table td.is-popular, .compare-table thead th.is-popular { background: var(--gold-50); }
.compare-table thead th.is-popular { background: var(--navy-700); box-shadow: inset 0 -3px 0 var(--gold-500); }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-yes { color: var(--success-500); }
.compare-yes .check-ico { width: 1.1em; height: 1.1em; }
.compare-no { color: var(--slate-400); }

/* --- FAQ ------------------------------------------------------------------ */
.faq-list { display: grid; gap: 0.75rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 0 1.1rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-900);
  padding: 0.95rem 0;
  list-style: none;
  position: relative;
  padding-right: 1.75rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--gold-500);
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { color: var(--slate-500); font-size: 0.95rem; padding-bottom: 1rem; margin: 0; }

/* --- Formulaire de contact ---------------------------------------------------- */
.contact-form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; margin: 0; }
@media (min-width: 40rem) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-field { display: grid; gap: 0.35rem; margin: 0; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-700); }
.form-field input,
.form-field textarea {
  font: inherit;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  width: 100%;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgb(46 79 124 / 0.15);
}
.form-field textarea { resize: vertical; min-height: 7rem; }
.contact-form .btn { justify-self: start; }

/* Honeypot : sorti de l'écran (PAS display:none, trop connu des bots) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
  margin: 0;
}

.form-alert {
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.form-alert--ok  { background: #dcfce7; color: #15803d; }
.form-alert--err { background: #fee2e2; color: #b91c1c; }

/* --- CTA final --------------------------------------------------------------- */
.cta-final {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
  color: #fff;
  text-align: center;
  padding: 3.5rem 0;
}
.cta-final h2 { font-size: 1.6rem; font-weight: 800; }
.cta-final p { color: var(--navy-100); max-width: 34rem; margin: 0 auto 1.5rem; }
.cta-alt { font-size: 0.9rem; margin-top: 1.25rem; }
.cta-alt a { color: var(--gold-400); }

/* --- Footer -------------------------------------------------------------------- */
.site-footer { background: var(--navy-900); color: var(--navy-100); padding: 2.75rem 0 1.5rem; }
.site-footer-grid { display: grid; gap: 2rem; margin-bottom: 2rem; }
.site-logo-text--footer { color: #fff; font-size: 1.25rem; }
.site-footer-brand p { font-size: 0.9rem; margin: 0.75rem 0 1rem; }
.site-footer-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.footer-badge {
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--gold-400);
}
.site-footer-col { display: grid; gap: 0.45rem; align-content: start; }
.site-footer-col h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-400);
  margin-bottom: 0.35rem;
}
.site-footer-col a { color: var(--navy-100); text-decoration: none; font-size: 0.92rem; }
.site-footer-col a:hover { color: #fff; }
.site-footer-copy {
  border-top: 1px solid var(--navy-700);
  padding-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--slate-400);
  margin: 0;
}
@media (min-width: 56rem) {
  .site-footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
}

/* --- Pages légales ---------------------------------------------------------------- */
.legal .section-title { text-align: left; }
.legal h2 { font-size: 1.15rem; color: var(--navy-900); margin-top: 2rem; }
.legal ul { color: var(--ink-700); padding-left: 1.25rem; }
.legal li { margin-bottom: 0.5rem; }