/* ============================================================
   COMPOSANTS
   ============================================================ */

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  padding: 0.9rem 1.4rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn--primary {
  background: var(--brass);
  color: var(--ink);
}
.btn--primary:hover { background: #dba951; }
.btn--secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn--secondary:hover { background: var(--line-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* --- En-tête / nav --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--line-dark);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px;
}
.logo { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; text-decoration: none; color: var(--paper); }
.logo-plume { color: var(--brass); flex: none; }
.nav { display: flex; align-items: center; gap: var(--sp-6); }
.nav__links { display: flex; gap: var(--sp-5); list-style: none; margin: 0; padding: 0; }
.nav__links a { text-decoration: none; font-size: var(--fs-small); color: var(--paper-soft); }
.nav__links a:hover { color: var(--paper); }
.burger { display: none; background: none; border: none; color: var(--paper); padding: var(--sp-2); }
@media (max-width: 768px) {
  .nav__links { position: fixed; inset: 72px 0 0 0; background: var(--ink); flex-direction: column; padding: var(--sp-6) var(--sp-5); gap: var(--sp-5); transform: translateX(100%); transition: transform 0.2s ease; }
  .nav__links[data-open="true"] { transform: translateX(0); }
  .nav .btn--primary { display: none; }
  .nav__links[data-open="true"] ~ .btn--primary,
  .burger { display: inline-flex; }
}

/* --- Héros (le calculateur intégré est l'audace du site) --- */
.hero { padding-block: var(--sp-9); position: relative; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero__bg .noeud-actif { transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .hero__bg .noeud-actif { animation: pulse-noeud 2.6s ease-in-out infinite; }
}
@keyframes pulse-noeud { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.4); } }
.hero__grid { position: relative; z-index: 1; display: grid; gap: var(--sp-8); grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.hero__texte p { color: var(--paper-soft); margin-top: var(--sp-4); max-width: 42ch; }
.hero__calc { display: flex; flex-direction: column; gap: var(--sp-4); background: var(--paper-2); }
.hero__calc .btn--secondary { color: var(--ink); }
.hero__calc .result-block { margin: var(--sp-2) 0; }
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}

/* --- Bandeau de confiance --- */
.trustbar { display: flex; flex-wrap: wrap; gap: var(--sp-6); padding-block: var(--sp-6); border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.trustbar__item { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-small); color: var(--paper-soft); }
.badge-live { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .badge-live { animation: pulse 2.4s ease-in-out infinite; }
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* --- Liste alternée « ce que j'automatise » : pas de grille de cartes --- */
.liste-alternee li {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: var(--sp-6);
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--line-light);
  align-items: baseline;
}
.liste-alternee li:nth-child(even) { grid-template-columns: 1fr 40%; }
.liste-alternee li:nth-child(even) h3 { order: 2; text-align: right; }
.liste-alternee li:nth-child(even) p { order: 1; text-align: right; }
.liste-alternee h3 { margin: 0; color: var(--brass-dark); }
.liste-alternee p { margin: 0; max-width: none; }
.liste-alternee .avant { color: var(--ink-soft); }
.liste-alternee .apres { color: var(--success); font-weight: 600; }
@media (max-width: 640px) {
  .liste-alternee li,
  .liste-alternee li:nth-child(even) { grid-template-columns: 1fr; gap: var(--sp-2); }
  .liste-alternee li:nth-child(even) h3,
  .liste-alternee li:nth-child(even) p { order: initial; text-align: left; }
}

/* --- Cartes --- */
.card { background: var(--paper-2); border: 1px solid var(--line-light); border-radius: var(--radius-md); padding: var(--sp-5); }
.card--avant-apres .avant { color: var(--ink-soft); text-decoration: line-through; }
.card--avant-apres .apres { color: var(--success); font-weight: 600; }

/* --- Emplacements de preuves en attente : une ligne discrète, pas 3 cadres égaux --- */
.preuves-attente {
  margin-top: var(--sp-5);
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  font-size: var(--fs-meta); color: var(--ink-soft);
  align-items: center;
}
.preuves-attente__item {
  border: 1px dashed var(--brass);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.7rem;
}

/* --- Champs de formulaire --- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.field .hint { font-size: var(--fs-meta); color: var(--ink-soft); font-weight: 400; }
.input, .select {
  font: inherit; font-size: 1rem;
  padding: 0.8rem 0.9rem; min-height: 44px;
  border: 1.5px solid var(--line-light);
  border-radius: var(--radius-sm);
  background: var(--paper-2); color: var(--ink);
}
.input:focus-visible, .select:focus-visible { border-color: var(--brass); }
.range {
  --fill: 50%;
  width: 100%; min-height: 44px;
  -webkit-appearance: none; appearance: none;
  background: transparent;
  margin: var(--sp-2) 0;
}
.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--brass) 0%, var(--brass) var(--fill), var(--line-light) var(--fill), var(--line-light) 100%);
}
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-light); }
.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--brass); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; margin-top: -9px;
  border-radius: 50%;
  background: var(--brass);
  border: 3px solid var(--paper-2);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  cursor: pointer;
}
.range::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brass); border: 3px solid var(--paper-2);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35); cursor: pointer;
}
.checkbox-row { display: flex; align-items: flex-start; gap: var(--sp-3); }
.checkbox-row input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--brass); flex: none; }
.error-msg { color: var(--danger); font-size: var(--fs-meta); font-weight: 600; }
.field[data-invalid="true"] .input { border-color: var(--danger); }
/* champ piège anti-robot : invisible pour un humain, ouvert aux bots */
.champ-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Accordéon FAQ --- */
.accordion__item { border-bottom: 1px solid var(--line-light); }
.accordion__trigger {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-5) 0; font: inherit; font-weight: 600; font-size: var(--fs-body); color: inherit;
}
.accordion__icon { transition: transform 0.15s ease; flex: none; margin-left: var(--sp-4); }
.accordion__trigger[aria-expanded="true"] .accordion__icon { transform: rotate(45deg); }
.accordion__panel { overflow: hidden; max-height: 0; transition: max-height 0.2s ease; }
.accordion__panel[data-open="true"] { max-height: 480px; }
.accordion__panel p { padding-bottom: var(--sp-5); color: var(--ink-soft); }

/* --- Barre d'action mobile --- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  background: var(--ink); border-top: 1px solid var(--line-dark);
}
.mobile-bar .btn { flex: 1; }
@media (max-width: 768px) {
  .mobile-bar[data-hidden="false"] { display: flex; }
}

/* --- Pied de page --- */
.site-footer { background: var(--ink); color: var(--paper-soft); }
.site-footer a { color: var(--paper-soft); }
.site-footer a:hover { color: var(--paper); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); font-size: var(--fs-small); }

/* --- État de bloc résultat (calculateur) --- */
.result-block { background: var(--paper-2); border: 1px solid var(--line-light); border-radius: var(--radius-md); padding: var(--sp-6); }
.result-block .label { font-size: var(--fs-meta); color: var(--ink-soft); }
.result-block .value { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 5vw, 2.75rem); font-variant-numeric: tabular-nums; }
.result-block--flou .value { filter: blur(6px); user-select: none; }
.result-block--negatif .value { color: var(--danger); }
.result-block--positif .value { color: var(--success); }

.status-msg { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-small); }
.status-msg[data-kind="erreur"] { color: var(--danger); }
.status-msg[data-kind="succes"] { color: var(--success); }
