/* ==========================================================================
   Design system — inspiré de malvaai.com/pdf
   Thème sombre, cartes épurées, accent corail/rouge
   ========================================================================== */

/* ==========================================================================
   SWITCHER DE THÈMES — 3 fonds au choix, pilotés par [data-theme] sur <html>.
   Thème par défaut (aucun attribut / valeur "dark") = style sombre original.
   Le script anti-flash (renderer.tsx) pose l'attribut avant le 1er paint.
   ========================================================================== */
:root,
html[data-theme='dark'] {
  --background: 222 18% 4%;
  --background-elevated: 222 16% 6%;
  --foreground: 220 15% 96%;
  --card: 222 16% 7%;
  --card-hover: 222 16% 9%;
  --card-foreground: 220 15% 96%;
  --muted-foreground: 220 10% 64%;
  --muted-foreground-dim: 220 8% 48%;
  --border: 222 12% 14%;
  --border-hover: 222 14% 20%;
  --primary: 0 76% 50%;
  --primary-hover: 0 76% 58%;
  --primary-foreground: 0 0% 100%;
  --accent-violet: 262 60% 62%;
  --btn-on-primary: 0 0% 100%;
  --modal-form-bg-from: 0 0% 100%;
  --modal-form-bg-to: 220 20% 96%;
  --radius: 0.9rem;
  --radius-lg: 1.25rem;
  --shadow-card: 0 1px 2px hsl(0 0% 0% / 0.4), 0 8px 24px -8px hsl(0 0% 0% / 0.5);
  --shadow-elevated: 0 20px 60px -15px hsl(0 0% 0% / 0.7);
}

/* Thème CLAIR — fond blanc, texte sombre très lisible */
html[data-theme='light'] {
  --background: 0 0% 100%;
  --background-elevated: 220 25% 97%;
  --foreground: 222 20% 12%;
  --card: 0 0% 100%;
  --card-hover: 220 30% 98%;
  --card-foreground: 222 20% 12%;
  --muted-foreground: 220 10% 38%;
  --muted-foreground-dim: 220 8% 50%;
  --border: 220 15% 88%;
  --border-hover: 220 15% 78%;
  --primary: 0 76% 46%;
  --primary-hover: 0 76% 40%;
  --primary-foreground: 0 0% 100%;
  --accent-violet: 262 55% 52%;
  --btn-on-primary: 0 0% 100%;
  --modal-form-bg-from: 0 0% 100%;
  --modal-form-bg-to: 220 20% 96%;
  --shadow-card: 0 1px 2px hsl(220 20% 10% / 0.06), 0 8px 24px -8px hsl(220 20% 10% / 0.12);
  --shadow-elevated: 0 20px 60px -15px hsl(220 20% 10% / 0.22);
}

/* Thème INTERMÉDIAIRE (Dim) — neutre gris, épuré */
html[data-theme='dim'] {
  --background: 222 12% 14%;
  --background-elevated: 222 12% 18%;
  --foreground: 220 12% 92%;
  --card: 222 12% 19%;
  --card-hover: 222 12% 22%;
  --card-foreground: 220 12% 92%;
  --muted-foreground: 220 8% 66%;
  --muted-foreground-dim: 220 8% 52%;
  --border: 222 10% 27%;
  --border-hover: 222 10% 34%;
  --primary: 0 70% 54%;
  --primary-hover: 0 70% 60%;
  --primary-foreground: 0 0% 100%;
  --accent-violet: 262 50% 64%;
  --btn-on-primary: 0 0% 100%;
  --modal-form-bg-from: 220 12% 92%;
  --modal-form-bg-to: 220 15% 86%;
  --shadow-card: 0 1px 2px hsl(0 0% 0% / 0.25), 0 8px 24px -8px hsl(0 0% 0% / 0.35);
  --shadow-elevated: 0 20px 60px -15px hsl(0 0% 0% / 0.5);
}

html { transition: background-color 0.25s ease; }
html, html * { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

#app-root { min-height: 100vh; display: flex; flex-direction: column; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------------- */
/* HEADER                                                                  */
/* ---------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid hsl(var(--border));
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid hsl(var(--border-hover));
  flex-shrink: 0;
}

.brand-accent { color: hsl(var(--primary)); }

.header-nav { display: flex; align-items: center; gap: 8px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border-color: hsl(var(--border));
}

.nav-link-cta {
  background: hsl(var(--primary));
  color: white;
}

.nav-link-cta:hover {
  background: hsl(var(--primary-hover));
  color: white;
}

/* ------------------------------------------------------------------------ */
/* GROUPE D'ACTIONS DU HEADER (theme switcher + menu) — aligné à droite     */
/* ------------------------------------------------------------------------ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ------------------------------------------------------------------------ */
/* SWITCHER DE THÈME — icône en haut à droite du header                     */
/* ------------------------------------------------------------------------ */
.theme-switcher {
  position: relative;
}

.theme-switcher-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.theme-switcher-btn:hover,
.theme-switcher-btn[aria-expanded='true'] {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: white;
}

.theme-switcher-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.theme-switcher-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-option i {
  width: 18px;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}
.theme-option:hover {
  background: hsl(var(--background-elevated));
  color: hsl(var(--primary));
}
.theme-option:hover i { color: hsl(var(--primary)); }
.theme-option.active {
  background: hsl(var(--primary) / 0.14);
  color: hsl(var(--primary));
}
.theme-option.active i { color: hsl(var(--primary)); }

/* ------------------------------------------------------------------------ */
/* BANNIÈRE COMPTEUR DYNAMIQUE — sous le header, valeur calculée en JS      */
/* ------------------------------------------------------------------------ */
.header-counter-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: hsl(var(--primary) / 0.12);
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--primary));
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header-counter-banner i { font-size: 12px; }

/* ------------------------------------------------------------------------ */
/* MENU HEADER DÉROULANT — icône carrée en haut à droite (Coaching / Formations / Se connecter) */
/* ------------------------------------------------------------------------ */
.header-menu {
  position: relative;
}

.header-menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-size: 17px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.header-menu-btn:hover,
.header-menu-btn[aria-expanded="true"] {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: white;
}

.header-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.header-menu-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.header-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-menu-item i {
  width: 18px;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}

.header-menu-item:hover {
  background: hsl(var(--background-elevated));
  color: hsl(var(--primary));
}
.header-menu-item:hover i { color: hsl(var(--primary)); }

/* ---------------------------------------------------------------------- */
/* HERO                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 72px 24px 56px;
  overflow: hidden;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, hsl(var(--primary) / 0.25), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
}

.hero-title {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.hero-title-accent {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent-violet)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------------------ */
/* PREUVE SOCIALE DYNAMIQUE — avatars superposés + compteur d'inscrits      */
/* ------------------------------------------------------------------------ */
.hero-social-proof {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}

.social-proof-avatars {
  display: flex;
  align-items: center;
}

.social-proof-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(var(--card));
  box-shadow: 0 2px 6px hsl(0 0% 0% / 0.25);
  margin-left: -12px;
  flex-shrink: 0;
  background: hsl(var(--background-elevated));
}
.social-proof-avatar:first-child { margin-left: 0; }

.social-proof-text {
  font-size: 13.5px;
  font-weight: 700;
  color: hsl(var(--foreground));
  white-space: nowrap;
}
.social-proof-text i { color: hsl(var(--primary)); margin-right: 4px; }

@media (max-width: 480px) {
  .hero-social-proof { flex-wrap: wrap; justify-content: center; padding: 10px 14px; }
  .social-proof-text { white-space: normal; text-align: center; }
}

.hero-subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  margin: 0 0 36px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.hero-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: hsl(var(--primary));
}

.hero-stat-label {
  font-size: 13px;
  color: hsl(var(--muted-foreground-dim));
}

/* ---------------------------------------------------------------------- */
/* CATALOG GRID                                                            */
/* ---------------------------------------------------------------------- */
.catalog-section { flex: 1; padding: 0 24px 100px; }

.catalog-inner { max-width: 1180px; margin: 0 auto; }

/* ------------------------------------------------------------------------ */
/* BARRE DE RECHERCHE — filtrage en temps réel du catalogue                */
/* ------------------------------------------------------------------------ */
.search-bar-wrapper { margin-bottom: 16px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-bar:focus-within {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.15);
}

.search-bar-icon { color: hsl(var(--muted-foreground-dim)); font-size: 14px; flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
}
.search-input::placeholder { color: hsl(var(--muted-foreground-dim)); }

.search-clear-btn {
  border: none;
  background: hsl(var(--background-elevated));
  color: hsl(var(--muted-foreground));
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.search-clear-btn:hover { background: hsl(var(--primary)); color: white; }

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: hsl(var(--border-hover));
  color: hsl(var(--foreground));
}

.filter-chip.active {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: white;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1080px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------------ */
/* CARTE — structure façon Malva AI :                                      */
/*   1. Bannière miniature YouTube pleine largeur (16:9) en haut            */
/*   2. Badges "VOL. X" / "NEW" superposés en overlay sur la miniature      */
/*   3. Titre dynamique (oEmbed) sous la bannière                          */
/*   4. Deux boutons côte à côte en bas de carte                          */
/* ------------------------------------------------------------------------ */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--border-hover));
  background: hsl(var(--card-hover));
  box-shadow: var(--shadow-elevated);
}

/* ---- Bannière miniature (16:9) ---- */
.card-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: hsl(var(--background-elevated));
  overflow: hidden;
  flex-shrink: 0;
}

.card-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-thumb { transform: scale(1.04); }

.card-thumb-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, hsl(var(--background-elevated)), hsl(var(--card)));
}

.card-thumb-placeholder-icon {
  font-size: 34px;
  color: hsl(var(--muted-foreground-dim));
}

/* Voile sombre en bas de la miniature pour garantir la lisibilité des
   badges superposés, indépendamment de la couleur de la miniature */
.card-thumb-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, hsl(0 0% 0% / 0.15) 0%, transparent 22%, transparent 78%, hsl(0 0% 0% / 0.1) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Bouton lecture centré sur la miniature (overlay), lecture libre au clic */
.card-thumb-play-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(0 0% 0% / 0);
  border: none;
  padding: 0;
  transition: background 0.2s ease;
}
.card-thumb-play-btn:hover { background: hsl(0 0% 0% / 0.25); }
.card-thumb-play-btn i {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: hsl(0 0% 100% / 0.92);
  color: hsl(var(--primary));
  font-size: 18px;
  box-shadow: 0 6px 18px -4px hsl(0 0% 0% / 0.5);
  transition: transform 0.2s ease, background 0.2s ease;
}
.card-thumb-play-btn:hover i {
  transform: scale(1.08);
  background: hsl(var(--primary));
  color: white;
}

/* ---- Badges superposés sur la miniature ---- */
.card-badge-overlay-left {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  margin: 0;
}

.card-badge-overlay-right {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

/* ---------------------------------------------------------------------- */
/* BADGE "NEW" — appliqué sur les 4 premiers éléments de la liste triée   */
/* ---------------------------------------------------------------------- */
.new-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, hsl(var(--accent-violet)), hsl(var(--primary)));
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px -3px hsl(var(--primary) / 0.6);
  animation: newBadgePulse 2.2s ease-in-out infinite;
  white-space: nowrap;
}
.new-badge i { font-size: 10px; }

@keyframes newBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.volume-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: hsl(0 0% 0% / 0.55);
  backdrop-filter: blur(4px);
  color: hsl(0 0% 100%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid hsl(0 0% 100% / 0.15);
  white-space: nowrap;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: hsl(var(--background-elevated));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 15px;
}

/* ---- Corps de carte (sous la bannière) ---- */
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-title {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: hsl(var(--card-foreground));
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: hsl(var(--background-elevated));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.card-spacer { flex: 1; }

/* ---------------------------------------------------------------------- */
/* BUTTONS                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background: hsl(var(--primary));
  color: white;
  box-shadow: 0 4px 14px -4px hsl(var(--primary) / 0.5);
}

.btn-primary:hover {
  background: hsl(var(--primary-hover));
  transform: translateY(-1px);
}

.btn-secondary {
  background: hsl(var(--background-elevated));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-secondary:hover { border-color: hsl(var(--border-hover)); }

.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }

.btn-ghost-link {
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-weight: 600;
  width: auto;
  padding: 8px 0;
}
.btn-ghost-link:hover { color: hsl(var(--primary)); }

.btn-unlock {
  background: hsl(var(--primary));
  color: white;
  border-color: hsl(var(--primary));
  box-shadow: 0 4px 14px -4px hsl(var(--primary) / 0.5);
}
.btn-unlock:hover {
  background: hsl(var(--primary-hover));
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------------ */
/* DEUX BOUTONS D'ACTION CÔTE À CÔTE (style Malva AI), EN BAS DE CARTE      */
/* Gauche  : "Regarder la vidéo" (sombre, icône play) — lecture libre       */
/* Droite  : "Débloquer le résumé PDF" (rouge/corail, icône cadenas)        */
/* ------------------------------------------------------------------------ */
.card-actions-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: auto;
}

.card-actions-row .btn {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  font-size: 11.5px;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
  gap: 5px;
}
.card-actions-row .btn i { flex-shrink: 0; font-size: 11px; }

.btn-card-watch {
  background: hsl(var(--background-elevated));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-card-watch:hover:not(:disabled) {
  border-color: hsl(var(--border-hover));
  background: hsl(var(--card-hover));
}
.btn-card-watch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-card-watch i { color: hsl(var(--muted-foreground)); }
.btn-card-watch:hover:not(:disabled) i { color: hsl(var(--foreground)); }

.pdf-cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-cta { width: auto; flex: 1; min-width: 220px; padding: 14px 24px; }

.btn-cta-full {
  width: 100%;
  padding: 15px 24px;
  font-size: 15px;
  margin-bottom: 14px;
}

.btn-youtube {
  background: hsl(0 100% 50%); /* Rouge officiel YouTube (#FF0000) */
  color: white;
  box-shadow: 0 4px 14px -4px hsl(0 100% 50% / 0.55);
}
.btn-youtube:hover {
  background: hsl(0 100% 42%);
  transform: translateY(-1px);
}
.btn-youtube i { font-size: 17px; }

/* ------------------------------------------------------------------------ */
/* BOUTON BLEU — Guide Recommandé (animation pulse/survol, prix dynamique)  */
/* ------------------------------------------------------------------------ */
.btn-recommended {
  background: linear-gradient(135deg, hsl(214 90% 54%), hsl(224 90% 58%));
  color: white;
  box-shadow: 0 4px 18px -4px hsl(214 90% 54% / 0.6);
  animation: recommendedPulse 2.4s ease-in-out infinite;
  font-size: 15px;
}
.btn-recommended:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 8px 24px -4px hsl(214 90% 54% / 0.75);
  animation-play-state: paused;
}
.btn-recommended i { color: white; }

@keyframes recommendedPulse {
  0%, 100% { box-shadow: 0 4px 18px -4px hsl(214 90% 54% / 0.6); }
  50% { box-shadow: 0 4px 26px 0px hsl(214 90% 60% / 0.9); }
}

/* ------------------------------------------------------------------------ */
/* BOUTON PRINCIPAL — "Télécharger le résumé PDF gratuit"                   */
/* Premier bouton de la modale de téléchargement, verrouillé par défaut     */
/* (icône cadenas) jusqu'à ce que les 30 secondes de visionnage soient       */
/* atteintes, puis se déverrouille automatiquement (icône téléchargement). */
/* ------------------------------------------------------------------------ */
.btn-pdf-main {
  background: hsl(var(--background-elevated));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
}
.btn-pdf-main:hover {
  border-color: hsl(var(--border-hover));
  color: hsl(var(--foreground));
}
.btn-pdf-main[data-locked="true"] {
  cursor: not-allowed;
  opacity: 0.8;
}
.btn-pdf-main[data-locked="false"] {
  background: hsl(var(--primary));
  color: white;
  border-color: hsl(var(--primary));
  box-shadow: 0 4px 14px -4px hsl(var(--primary) / 0.5);
  opacity: 1;
}
.btn-pdf-main[data-locked="false"]:hover {
  background: hsl(var(--primary-hover));
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------------ */
/* BARRE DE PROGRESSION — visionnage 30 secondes                            */
/* ------------------------------------------------------------------------ */
.watch-progress {
  margin-bottom: 14px;
}
.watch-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--background-elevated));
  overflow: hidden;
  margin-bottom: 6px;
}
.watch-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent-violet)));
  transition: width 1s linear;
  border-radius: 999px;
}
.watch-progress-label {
  font-size: 12px;
  color: hsl(var(--muted-foreground-dim));
  display: block;
  text-align: center;
}

/* ---------------------------------------------------------------------- */
/* SKELETON LOADING                                                       */
/* ---------------------------------------------------------------------- */
.card-skeleton { pointer-events: none; }

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, hsl(var(--background-elevated)) 25%, hsl(var(--card-hover)) 50%, hsl(var(--background-elevated)) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.skeleton-badge, .skeleton-line, .skeleton-btn {
  background: linear-gradient(90deg, hsl(var(--background-elevated)) 25%, hsl(var(--card-hover)) 50%, hsl(var(--background-elevated)) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 6px;
}

.skeleton-badge { width: 70px; height: 22px; border-radius: 999px; }
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line-title { height: 40px; border-radius: 8px; }
.skeleton-line-tag { width: 60%; }
.skeleton-btn { height: 38px; border-radius: 10px; flex: 1; }
.skeleton-actions-row { display: flex; gap: 8px; margin-top: 8px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------------------------------------------------------------------- */
/* EMPTY / ERROR STATES                                                    */
/* ---------------------------------------------------------------------- */
.empty-state, .error-state {
  text-align: center;
  padding: 80px 20px;
  color: hsl(var(--muted-foreground));
}
.empty-state i, .error-state i { font-size: 40px; margin-bottom: 16px; opacity: 0.6; display: block; }
.error-state .btn { width: auto; margin: 16px auto 0; padding: 10px 24px; }

/* ---------------------------------------------------------------------- */
/* MODAL — capture email                                                   */
/* ---------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: hsl(0 0% 0% / 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.is-visible { opacity: 1; }

.modal-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 32px 28px 26px;
  position: relative;
  box-shadow: var(--shadow-elevated);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.is-visible .modal-card { transform: translateY(0) scale(1); }

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background-elevated));
  color: hsl(var(--muted-foreground));
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 5;
}
.modal-close-btn:hover { color: hsl(var(--foreground)); border-color: hsl(var(--border-hover)); }

.modal-head { text-align: center; margin-bottom: 22px; }

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.2), hsl(var(--accent-violet) / 0.2));
  color: hsl(var(--primary));
  font-size: 20px;
}

.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 8px;
}

.modal-subtitle {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  margin: 0;
  line-height: 1.5;
}

/* ------------------------------------------------------------------------ */
/* HABILLAGE PREMIUM DU FORMULAIRE SYSTEME.IO                               */
/* L'iframe est cross-origin : impossible de cibler son DOM interne (input, */
/* bouton) en CSS/JS pour raisons de sécurité navigateur. On soigne donc au */
/* maximum le CADRE qui l'entoure pour un rendu "carte" premium, homogène   */
/* avec la charte sombre du site, et on masque visuellement toute bordure  */
/* ou fond parasite de l'iframe elle-même.                                  */
/* ------------------------------------------------------------------------ */
.modal-form-wrapper {
  min-height: 90px;
  position: relative;
  background: linear-gradient(160deg, hsl(var(--modal-form-bg-from)), hsl(var(--modal-form-bg-to)));
  border-radius: 16px;
  padding: 4px;
  box-shadow:
    0 0 0 1px hsl(var(--primary) / 0.25),
    0 12px 32px -12px hsl(0 0% 0% / 0.55),
    0 0 40px -10px hsl(var(--primary) / 0.35);
  overflow: hidden;
}

.modal-form-wrapper iframe {
  width: 100% !important;
  border: none !important;
  border-radius: 13px;
  background: transparent;
  display: block;
}

/* Masque tout logo/badge Systeme.io par défaut qui pourrait apparaître
   hors de l'iframe (le contenu interne de l'iframe étant cross-origin et
   donc non accessible en CSS depuis notre page). */
.modal-form-wrapper img[src*="systeme" i],
.modal-form-wrapper img[alt*="systeme" i],
.modal-form-wrapper a[href*="systeme.io" i]:not(iframe *),
.modal-form-wrapper [class*="systeme" i]:not(iframe),
.modal-form-wrapper [id*="systeme" i]:not(iframe) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

.modal-form-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  padding: 30px 0;
}

.modal-fallback {
  text-align: center;
  margin-top: 4px;
  border-top: 1px dashed hsl(var(--border));
  padding-top: 12px;
}

.modal-privacy {
  text-align: center;
  font-size: 11.5px;
  color: hsl(var(--muted-foreground-dim));
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------------------------------------------------------------------- */
/* MODALE D'AVERTISSEMENT — 30 secondes de visionnage requises            */
/* ---------------------------------------------------------------------- */
.modal-card-small {
  max-width: 400px;
  text-align: center;
}

.modal-icon-warning {
  background: linear-gradient(135deg, hsl(38 92% 50% / 0.2), hsl(0 76% 50% / 0.2));
  color: hsl(38 92% 55%);
}

/* ---------------------------------------------------------------------- */
/* MODALE LECTEUR VIDÉO LIBRE — lecture inline depuis les cartes du       */
/* catalogue, sans quitter le site, sans chrono ni règle de déblocage.    */
/* ---------------------------------------------------------------------- */
.video-modal-card {
  max-width: 860px;
  width: 100%;
  padding: 20px;
}

.video-modal-title {
  font-size: 17px;
  text-align: left;
  margin: 0 44px 14px 0;
}

.video-modal-overlay .video-frame {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------- */
/* MODALE DE TÉLÉCHARGEMENT (post-déblocage e-mail)                       */
/* C'est ICI, exclusivement, que s'applique la règle des 30 secondes.     */
/* ---------------------------------------------------------------------- */
.unlock-modal-card {
  max-width: 620px;
  width: 100%;
  padding: 28px 24px 22px;
  text-align: left;
}

.pdf-header { margin-bottom: 18px; padding-right: 32px; }

.pdf-volume-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.14);
  color: hsl(var(--primary));
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.pdf-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* VIDEO FRAME — Vidéo YouTube associée                                    */
/* ---------------------------------------------------------------------- */
.video-frame {
  background: hsl(var(--background-elevated));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}

#youtube-player,
#youtube-player-inner {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* L'API YouTube IFrame injecte parfois des attributs width/height inline
   (ex. 640x390) sur l'iframe générée : on force le format 16:9 fluide en
   !important pour garantir un rendu 100% responsive sur mobile. */
.video-frame iframe {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border: none;
  display: block;
  position: absolute;
  inset: 0;
}

.pdf-download-hint {
  text-align: center;
  font-size: 13px;
  color: hsl(var(--muted-foreground-dim));
  margin-top: 16px;
}
.pdf-download-hint a { color: hsl(var(--primary)); font-weight: 600; }
.pdf-download-hint a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------------ */
/* SECTION COACHING PRIVÉ / FORMULES (#formules)                            */
/* Cible du scroll fluide déclenché par le menu "Coaching Privé" et par le   */
/* bouton "Réserver un Coaching Privé" de la modale de téléchargement.      */
/* ------------------------------------------------------------------------ */
.formules-section {
  padding: 80px 24px;
  background: hsl(var(--background-elevated));
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
  text-align: center;
}

.formules-inner {
  max-width: 980px;
  margin: 0 auto;
}

.formules-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--primary));
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

.formules-title {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.formules-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  margin: 0 0 40px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.formules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
  text-align: left;
}

@media (max-width: 760px) {
  .formules-grid { grid-template-columns: 1fr; }
}

.formule-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.formule-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--border-hover));
}

.formule-card-highlight {
  border-color: hsl(var(--primary));
  box-shadow: 0 8px 28px -8px hsl(var(--primary) / 0.35);
}

.formule-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.18), hsl(var(--accent-violet) / 0.18));
  color: hsl(var(--primary));
  font-size: 18px;
  margin-bottom: 14px;
}

.formule-name {
  font-family: 'Sora', sans-serif;
  font-size: 16.5px;
  font-weight: 700;
  margin: 0 0 8px;
}

.formule-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.formules-cta {
  width: auto;
  display: inline-flex;
  padding: 15px 32px;
  font-size: 15px;
}

/* ---------------------------------------------------------------------- */
/* FOOTER                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground-dim));
  font-size: 13px;
}

/* ---------------------------------------------------------------------- */
/* SPINNER                                                                 */
/* ---------------------------------------------------------------------- */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------- */
/* TOAST NOTIFICATIONS — feedback visuel éphémère, bas-droite             */
/* ---------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-elevated);
  color: hsl(var(--foreground));
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}
.toast.is-visible { opacity: 1; transform: translateX(0); }
.toast.is-leaving { opacity: 0; transform: translateX(24px); }

.toast i { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.toast-success i { color: hsl(140 65% 48%); }
.toast-error i { color: hsl(var(--primary)); }
.toast-info i { color: hsl(var(--accent-violet)); }

@media (max-width: 480px) {
  .toast-container { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
