/* ===== Tarifs (index-new.html) =====
   1) Quatre cartes pour décider vite : prix lisible, public visé, 5 points clés.
   2) Comparatif complet replié derrière un bouton (divulgation progressive). */

.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  margin-top: 12px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 24px 28px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 80, 22, 0.35);
  box-shadow: 0 18px 40px -18px rgba(16, 40, 20, 0.35);
}

/* Plan mis en avant : carte sombre, légèrement surélevée */
.plan-card.is-featured {
  background: linear-gradient(165deg, #123A1A 0%, #0A2410 100%);
  border-color: transparent;
  color: #F4FBF5;
  box-shadow: 0 30px 60px -24px rgba(10, 36, 16, 0.75);
  transform: translateY(-14px);
}

.plan-card.is-featured:hover {
  transform: translateY(-18px);
  box-shadow: 0 36px 70px -24px rgba(10, 36, 16, 0.85);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #22C55E;
  color: #052E16;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px -6px rgba(34, 197, 94, 0.7);
}

.plan-badge svg { width: 12px; height: 12px; }

.plan-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.plan-for {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  min-height: 2.7em;
  margin-bottom: 20px;
}

/* Montant puis unité sur deux lignes : alignement identique quelle que soit la longueur du prix */
.plan-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.plan-amount {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.plan-unit {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.plan-billing {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  min-height: 3.6em;
  margin: 12px 0 20px;
}

.plan-saving {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--secondary);
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

/* Boutons */
.plan-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.93rem;
  white-space: nowrap;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.plan-cta svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.plan-cta:hover svg { transform: translateX(3px); }

.plan-cta-outline {
  background: #FFFFFF;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.plan-cta-outline:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.plan-cta-solid {
  background: #22C55E;
  color: #052E16;
  border: 1.5px solid #22C55E;
  box-shadow: 0 10px 24px -10px rgba(34, 197, 94, 0.8);
}

.plan-cta-solid:hover {
  background: #4ADE80;
  border-color: #4ADE80;
}

.plan-cta:focus-visible,
.plans-compare-btn:focus-visible {
  outline: 3px solid #22C55E;
  outline-offset: 3px;
}

.plan-includes {
  margin: 26px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.plan-features svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 3px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--primary);
}

/* Couleurs du plan mis en avant */
.plan-card.is-featured .plan-name,
.plan-card.is-featured .plan-amount,
.plan-card.is-featured .plan-includes { color: #FFFFFF; }

.plan-card.is-featured .plan-for,
.plan-card.is-featured .plan-unit,
.plan-card.is-featured .plan-billing,
.plan-card.is-featured .plan-features li { color: rgba(230, 245, 233, 0.8); }

.plan-card.is-featured .plan-saving { background: rgba(34, 197, 94, 0.2); color: #86EFAC; }
.plan-card.is-featured .plan-includes { border-top-color: rgba(255, 255, 255, 0.14); }
.plan-card.is-featured .plan-features svg { background: rgba(34, 197, 94, 0.22); color: #86EFAC; }

/* ── Bouton "Comparer" ───────────────────────────────── */
.plans-compare-cta {
  display: flex;
  justify-content: center;
  margin: 48px 0 8px;
}

.plans-compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.plans-compare-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px -10px rgba(16, 40, 20, 0.4);
}

.plans-compare-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.plans-compare-btn[aria-expanded="true"] .plans-compare-chevron {
  transform: rotate(180deg);
}

/* ── Tableau comparatif ──────────────────────────────── */
.plans-compare {
  margin-top: 24px;
}

.cmp-scroll {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #FFFFFF;
}

.cmp-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.cmp-table .cmp-feat-head { width: 28%; }

.cmp-table th,
.cmp-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid #F1F3F5;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.cmp-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
  width: 30%;
}

/* En-tête collé sous la barre de navigation pendant le défilement */
.cmp-table thead th {
  position: sticky;
  top: 64px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 18px 16px;
}

.cmp-table thead th:first-child { border-top-left-radius: 20px; }
.cmp-table thead th:last-child { border-top-right-radius: 20px; }

.cmp-feat-head {
  text-align: left !important;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cmp-plan {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cmp-price {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.cmp-group th {
  text-align: left !important;
  padding: 22px 16px 10px !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary) !important;
  background: #FAFBFA;
}

/* Colonne du plan mis en avant : teinte légère sur toute la hauteur */
.cmp-table .is-featured {
  background: rgba(34, 197, 94, 0.06);
  color: var(--text-primary);
  font-weight: 600;
}

.cmp-table thead th.is-featured {
  background: rgba(240, 253, 244, 0.97);
  box-shadow: inset 0 3px 0 #22C55E;
}

.cmp-yes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--primary);
}

.cmp-yes svg { width: 13px; height: 13px; }

.cmp-no {
  display: inline-block;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: #D1D5DB;
  vertical-align: middle;
}

.cmp-table tfoot td {
  padding: 20px 12px;
  border-bottom: none;
}

.plan-cta-sm {
  min-height: 44px;
  font-size: 0.85rem;
  padding: 0 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Services à la carte : alignés sur la palette des cartes ── */
.carte-section {
  margin-top: 72px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #FFFFFF;
}

.carte-section h3 svg { stroke: var(--primary); }

.carte-table {
  border: 1px solid var(--border);
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
}

.carte-table thead th {
  background: #FAFBFA;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.carte-table tbody td { border-bottom: 1px solid #F1F3F5; }
.carte-table tbody tr:last-child td { border-bottom: none; }
.carte-table tbody tr:nth-child(even) td { background: transparent; }

.carte-table tbody td:nth-child(2) {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.carte-note { font-style: normal; color: var(--text-secondary); }
.carte-note svg { stroke: var(--primary); }
.carte-note a { color: var(--primary) !important; font-weight: 600; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .plan-card.is-featured,
  .plan-card.is-featured:hover { transform: none; }
}

/* Sous 900 px, le tableau défile horizontalement dans son cadre ;
   la colonne des libellés reste visible. */
@media (max-width: 900px) {
  .cmp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cmp-table { min-width: 760px; font-size: 0.85rem; }
  .cmp-table thead th { position: static; }
  .cmp-table tbody th[scope="row"],
  .cmp-table .cmp-feat-head {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #FFFFFF;
    box-shadow: 1px 0 0 var(--border);
  }
}

@media (max-width: 640px) {
  .plans-grid { grid-template-columns: 1fr; gap: 28px; }
  .plan-for, .plan-billing { min-height: 0; }
  .carte-section { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .plan-card, .plan-cta, .plan-cta svg, .plans-compare-chevron { transition: none; }
  .plan-card:hover, .plan-card.is-featured:hover { transform: none; }
}
