/* Page « Ce que t'apporte un compte » (pages/avantages.php) et fenêtre d'invitation de /compte (.adv-modal, assets/js/compte.js). */
.adv { padding-bottom: 2rem; }
.adv-h { font-size: 1.35rem; margin: 2rem 0 0.9rem; color: var(--color-text); }
.adv-lead { margin: -0.3rem 0 1rem; color: var(--color-text-muted); }

.adv-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; padding: 1rem 1.2rem; border-radius: 14px; background: var(--color-primary-light); border: 1px solid var(--color-border, #e6dcc7); }
.adv-cta > div { flex: 1 1 240px; display: flex; flex-direction: column; gap: 0.15rem; }
.adv-cta span { font-size: 0.9rem; color: var(--color-text-muted); }
.adv-cta .btn { white-space: nowrap; }
.adv-cta-bottom { margin-top: 2rem; }

.adv-nav { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.9rem 0.1rem 0.3rem; margin: 0; scrollbar-width: thin; }
.adv-nav a { flex: 0 0 auto; padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--color-border, #e6dcc7); background: var(--color-surface, #fbf7ee); color: var(--color-text); font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.adv-nav a:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }

.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.adv-card { display: flex; flex-direction: column; padding: 1.2rem 1.2rem 1.1rem; background: var(--color-surface, #fbf7ee); border: 1px solid var(--color-border, #e6dcc7); border-radius: 16px; box-shadow: var(--shadow-sm); scroll-margin-top: 5rem; }
.adv-card h3 { margin: 0.3rem 0 0.5rem; font-size: 1.1rem; }
.adv-card p { margin: 0 0 0.7rem; line-height: 1.55; }
.adv-card ul { margin: 0 0 0.9rem; padding-left: 1.15rem; display: grid; gap: 0.3rem; font-size: 0.92rem; color: var(--color-text-muted); }
.adv-icon { width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--color-primary-light); display: grid; place-items: center; font-size: 1.4rem; }
.adv-more { margin-top: auto; font-weight: 600; color: var(--color-primary-dark); text-decoration: none; }
.adv-more:hover { text-decoration: underline; }

.adv-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
.adv-plan { padding: 1rem 1.1rem; border: 1px solid var(--color-border, #e6dcc7); border-radius: 14px; background: var(--color-surface, #fbf7ee); }
.adv-plan h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.adv-plan p { margin: 0; font-size: 0.93rem; line-height: 1.55; }
.adv-plan-main { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-light); }
.adv-note { margin: 0.9rem 0 0; font-size: 0.88rem; color: var(--color-text-muted); }

.adv-soon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.adv-soon-card { position: relative; padding: 1.2rem; border: 2px dashed var(--color-border, #e6dcc7); border-radius: 16px; background: var(--color-surface, #fbf7ee); }
.adv-soon-card h3 { margin: 0.5rem 0 0.4rem; font-size: 1.05rem; }
.adv-soon-card p { margin: 0; font-size: 0.93rem; line-height: 1.55; }
.adv-badge { position: absolute; top: 0.9rem; right: 0.9rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--color-accent); color: #1c2b42; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

.adv-extra { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; line-height: 1.55; }

/* Fenêtre d'invitation sur /compte */
.adv-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 1rem; background: rgba(20, 28, 44, 0.55); }
.adv-modal[hidden] { display: none; }
.adv-modal-box { width: min(100%, 460px); max-height: 100%; overflow: auto; padding: 1.6rem 1.5rem 1.3rem; background: var(--color-surface, #fbf7ee); color: var(--color-text); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); text-align: center; }
.adv-modal-box .adv-modal-icon { font-size: 2.4rem; line-height: 1; }
.adv-modal-box h2 { margin: 0.6rem 0 0.5rem; font-size: 1.3rem; }
.adv-modal-box p { margin: 0 0 0.8rem; line-height: 1.55; color: var(--color-text-muted); }
.adv-modal-box ul { list-style: none; padding: 0; margin: 0 0 1.1rem; display: grid; gap: 0.35rem; text-align: left; font-size: 0.93rem; }
.adv-modal-box li::before { content: "✓ "; color: var(--color-primary-dark); font-weight: 700; }
.adv-modal-actions { display: grid; gap: 0.5rem; }
.adv-modal-actions .btn { width: 100%; justify-content: center; text-align: center; }
.adv-modal-skip { background: none; border: 0; padding: 0.4rem; font: inherit; font-size: 0.88rem; color: var(--color-text-muted); text-decoration: underline; cursor: pointer; }
.cpt-adv-link { margin-top: 0.7rem; text-align: center; font-size: 0.88rem; }

@media (max-width: 520px) {
  .adv-cta .btn { width: 100%; text-align: center; }
  .adv-modal-box { padding: 1.3rem 1.1rem 1.1rem; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .adv-badge { color: #1c2b42; }
}

/* ---- Défilement (assets/js/avantages.js, 23/10) ---- */
/* Sommaire collé sous l'en-tête, rubrique lue mise en avant. Ordinateur : boutons gauche/droite ; mobile : défilement du doigt, libre. */
.adv-nav-wrap { position: sticky; top: var(--header-height, 64px); z-index: 20; margin: 0 -0.5rem; background: var(--color-bg, #f2ead9); }
.adv-nav-wrap .adv-nav { margin: 0; padding: 0.6rem 0.5rem; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.adv-nav-wrap .adv-nav::-webkit-scrollbar { display: none; }
.adv-nav a { transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s; }
.adv-nav a.is-active { background: var(--color-primary-dark, #8a6212); border-color: var(--color-primary-dark, #8a6212); color: #fff; font-weight: 600; transform: translateY(-1px) scale(1.04); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.adv-nav.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 2.2rem); mask-image: linear-gradient(90deg, transparent 0, #000 2.2rem); }
.adv-nav.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent 100%); mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent 100%); }
.adv-nav.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 2.2rem, #000 calc(100% - 2.2rem), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 2.2rem, #000 calc(100% - 2.2rem), transparent 100%); }

/* Boutons gauche / droite : ordinateur seulement, et seulement s'il reste des puces cachées */
.adv-arrow { display: none; }
@media (min-width: 768px) {
  .adv-nav-wrap.has-overflow .adv-nav { padding-left: 2.8rem; padding-right: 2.8rem; scroll-snap-type: x proximity; scroll-padding: 0 2.8rem; }
  .adv-nav-wrap.has-overflow .adv-nav a { scroll-snap-align: center; }
  .adv-nav-wrap.has-overflow .adv-arrow { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; margin-top: -1.05rem; padding: 0; border-radius: 50%; border: 1px solid var(--color-border, #e6dcc7); background: var(--color-surface, #fbf7ee); color: var(--color-primary-dark, #8a6212); font-size: 1.25rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm, 0 2px 6px rgba(0, 0, 0, 0.15)); transition: background 0.2s, color 0.2s, opacity 0.2s, transform 0.2s; }
  .adv-arrow-l { left: 0.3rem; }
  .adv-arrow-r { right: 0.3rem; }
  .adv-arrow:hover:not(:disabled) { background: var(--color-primary-dark, #8a6212); color: #fff; transform: scale(1.08); }
  .adv-arrow:focus-visible { outline: 2px solid var(--color-primary, #b8862a); outline-offset: 2px; }
  .adv-arrow:disabled { opacity: 0.3; cursor: default; }
}

/* Les ancres tiennent compte de l'en-tête + du sommaire collés */
.adv-card, .adv-soon, .adv-more-box { scroll-margin-top: 9.5rem; }
@media (prefers-reduced-motion: no-preference) {
  html:has(.adv) { scroll-behavior: smooth; }

  /* Apparition douce des cartes (seulement si le script est actif : sans lui, tout reste visible) */
  .adv-js .adv-card, .adv-js .adv-plan, .adv-js .adv-soon-card, .adv-js .adv-more-box, .adv-js .adv-cta-bottom { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
  .adv-js .is-in { opacity: 1; transform: none; }
}
