/* ==========================================================================
   Bibliothèque de composants
   Chaque bloc correspond à un composant documenté dans docs/COMPONENTS.md.
   Préfixe `sp-` pour éviter toute collision avec un futur framework.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Bouton (sp-btn)
   Variantes : --primary (pilule pleine), --outline (bordure grise),
   --accent (couleur de l'abonnement), --full (pleine largeur).
   -------------------------------------------------------------------------- */
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 32px;
  border: 0;
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  will-change: transform;
  transition: background-color var(--duration-base) var(--ease-productive),
    border-color var(--duration-base) var(--ease-productive),
    transform var(--duration-base) var(--ease-productive);
}

@media (prefers-reduced-motion: no-preference) {
  .sp-btn:hover {
    transform: scale(var(--button-hover-scale));
    transition-duration: var(--duration-fast);
  }
}
.sp-btn:active {
  transform: scale(1);
}

/* Pilule pleine sur fond sombre : fond blanc, texte noir. */
.sp-btn--primary {
  background-color: var(--text-base);
  color: var(--bg-base);
}
.sp-btn--primary:hover {
  background-color: #f0f0f0;
}

/* Bouton secondaire du hero : fond transparent, filet gris. */
.sp-btn--outline {
  background-color: transparent;
  color: var(--text-base);
  border: 1px solid var(--border-button-secondary);
}
.sp-btn--outline:hover {
  border-color: var(--text-base);
}

/* Bouton coloré : reprend l'accent de l'abonnement courant.
   La couleur est fournie par la carte parente via --plan-accent. */
.sp-btn--accent {
  background-color: var(--plan-accent, var(--text-base));
  color: #000;
}
.sp-btn--accent:hover {
  filter: brightness(1.06);
}

.sp-btn--full {
  width: 100%;
  border-radius: var(--radius-cta-card);
}
.sp-btn--full:hover {
  transform: none; /* pas de zoom sur un bouton pleine largeur */
}

/* --------------------------------------------------------------------------
   2. Badge promotionnel (sp-lozenge)
   Étiquette "0 € pour 1 mois" ancrée dans le coin haut-gauche d'une carte.
   -------------------------------------------------------------------------- */
.sp-lozenge {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: var(--radius-badge);
  background: var(--plan-accent, var(--text-base));
  color: #000;
  font-size: var(--fs-marginal);
  font-weight: 700;
  line-height: 13.75px;
}

/* --------------------------------------------------------------------------
   3. Carte d'abonnement (sp-plan)
   -------------------------------------------------------------------------- */
.sp-plan {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  border-radius: var(--radius-card);
  background-color: var(--bg-card);
  overflow: hidden;
}

.sp-plan__head {
  padding: 0 16px 16px;
}

/* Le badge doit toucher les bords haut et gauche de la carte. */
.sp-plan__head .sp-lozenge {
  margin: 0 0 0 -16px;
}

/* Ligne "Premium" + pastille vérifiée. */
.sp-plan__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: var(--fs-body);
}
.sp-plan__brand svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

.sp-plan__name {
  margin: 0;
  font-size: var(--fs-title-m);
  font-weight: 700;
  line-height: 145%;
  color: var(--plan-accent);
}

.sp-plan__price {
  margin-top: 4px;
  font-size: var(--fs-body);
  font-weight: 700;
}

.sp-plan__price-note {
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--text-marginal);
}

.sp-plan__divider {
  height: 1px;
  margin: 16px 16px 0;
  border: 0;
  background: var(--border-card-divider);
}

/* Liste des bénéfices : puces "•" alignées comme sur la source. */
.sp-plan__features {
  flex: 1;
  padding: 20px 16px;
}
.sp-plan__features li {
  display: flex;
  gap: 10px;
  line-height: 22px;
}
.sp-plan__features li + li {
  margin-top: 4px;
}
.sp-plan__features li::before {
  content: "•";
  flex: 0 0 auto;
  color: var(--text-base);
}

.sp-plan__cta {
  padding: 0 16px 4px;
  text-align: center;
}

.sp-plan__legal {
  padding: 12px 16px 16px;
  color: var(--text-marginal);
  font-size: var(--fs-marginal);
  line-height: 16px;
  text-align: center;
}
.sp-plan__legal a {
  color: var(--text-marginal);
  text-decoration: underline;
}
.sp-plan__legal a:hover {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. Tableau comparatif (sp-compare)
   -------------------------------------------------------------------------- */
.sp-compare {
  table-layout: fixed;
  width: 100%;
  max-width: 446px;
  margin: 0 auto;
  background: var(--bg-table);
  overflow-wrap: break-word;
}

.sp-compare th,
.sp-compare td {
  position: relative;
  padding: 16px 10px;
  background-color: var(--bg-base);
  border-bottom: 1px solid var(--border-table);
  text-align: center;
}

/* Colonne de gauche : intitulé du bénéfice. */
.sp-compare th.sp-compare__benefit {
  width: 42%;
  text-align: left;
  font-weight: 400;
}

/* En-têtes des deux colonnes de droite. */
.sp-compare th.sp-compare__col {
  width: 29%;
  padding: 32px 8px;
  text-align: left;
  vertical-align: bottom;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 22px;
  /* On annule la coupure de mot héritée du tableau : "Abonnements" doit rester
     entier, quitte à réduire le corps du texte en mobile. */
  overflow-wrap: normal;
}
@media (max-width: 767px) {
  .sp-compare th.sp-compare__col {
    padding: 24px 6px;
    font-size: var(--fs-small);
  }
}
/* Sous 400px la colonne tombe à ~88px : « abonnement » ne tient plus en 14px. */
@media (max-width: 400px) {
  .sp-compare th.sp-compare__col {
    padding: 20px 4px;
    font-size: 13px;
  }
}
.sp-compare__col-inner {
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: flex-end;
  min-width: 0;
}
/* min-width:0 indispensable : sans lui l'intitulé ne peut pas descendre sous sa
   largeur de mot le plus long et fait déborder le tableau en mobile. */
.sp-compare__col-inner > div {
  min-width: 0;
}
.sp-compare__col-inner svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: var(--text-base);
}

/* Intitulé souligné en pointillés (indique une info complémentaire).
   Corps fluide 14 → 16px, formule reprise telle quelle de la source. */
.sp-compare__label {
  display: inline-block;
  font-size: clamp(14px, calc(14px + 2 * ((100vw - 320px) / 1120)), 16px);
  line-height: 24px;
  text-decoration: underline dashed 1px;
  text-decoration-color: var(--text-subdued);
  text-underline-offset: 4px;
}

.sp-compare tbody tr:hover th,
.sp-compare tbody tr:hover td {
  background: var(--bg-highlight);
}

/* Marque "absent" : un simple tiret gris. */
.sp-compare__no {
  display: inline-block;
  width: 16px;
  height: 2px;
  background: var(--text-subdued);
  vertical-align: middle;
}

/* Marque "inclus" : pastille blanche + coche noire. */
.sp-compare__yes {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.sp-compare__yes svg {
  width: 100%;
  height: 100%;
  fill: var(--text-base);
}

/* --------------------------------------------------------------------------
   5. Moyens de paiement (sp-payments)
   -------------------------------------------------------------------------- */
.sp-payments {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.sp-payments li {
  padding: 4px;
  border-radius: var(--radius-payment);
  background-color: #fff;
}
.sp-payments img {
  display: block;
  width: 45px;
  height: 30px;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   6. Accordéon FAQ (sp-faq)
   Basé sur <details>/<summary> : ouverture native, sans JavaScript.
   -------------------------------------------------------------------------- */
.sp-faq {
  max-width: 1199px;
  margin: 0 auto;
}

.sp-faq__item {
  border-bottom: 1px solid var(--bg-tinted-highlight);
}
.sp-faq__item:last-child {
  border-bottom: 0;
}

.sp-faq__details {
  color: var(--text-base);
}
.sp-faq__details[open] {
  background-color: var(--bg-elevated-base);
}

.sp-faq__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  margin-top: 2px;
  font-size: var(--fs-lead);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}
.sp-faq__summary::-webkit-details-marker {
  display: none;
}
.sp-faq__item:hover .sp-faq__summary,
.sp-faq__details[open] .sp-faq__summary {
  background-color: var(--bg-elevated-highlight);
}
.sp-faq__item:hover .sp-faq__summary span,
.sp-faq__details[open] .sp-faq__summary span {
  text-decoration: underline;
}
.sp-faq__summary:focus-visible {
  outline: 2px solid var(--text-base);
  outline-offset: -2px;
  border-radius: 8px;
}

.sp-faq__chevron {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  fill: currentColor;
  transform: rotate(0deg);
  transition: transform 500ms var(--ease-productive);
}
.sp-faq__details[open] .sp-faq__chevron {
  transform: rotate(180deg);
}

.sp-faq__answer {
  padding: 15px 32px 32px;
}
.sp-faq__answer p + p {
  margin-top: 1em;
}
.sp-faq__answer a {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. Pastille réseau social (sp-social)
   -------------------------------------------------------------------------- */
.sp-social {
  display: flex;
  gap: 24px;
}
.sp-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-social);
}
.sp-social svg {
  width: 24px;
  height: 24px;
  fill: var(--text-base);
}
@media (min-width: 992px) {
  .sp-social a {
    width: 54px;
    height: 54px;
  }
}
