/* Page publique d'abonnement — Direction A (cartes-plans + souscription).
   Propriétés logiques uniquement (RTL-safe). Référence exclusivement les
   tokens --ef-* / --nav-* ; aucun hex en dur. */

/* ── Hero ──────────────────────────────────────────────────────────── */
.ef-billing-hero {
  padding-block: var(--ef-space-6) var(--ef-space-5);
  background: linear-gradient(180deg, var(--ef-surface-alt) 0%, var(--ef-surface) 100%);
}
.ef-billing-title {
  font-family: var(--ef-font);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-block-end: var(--ef-space-3);
  color: var(--ef-text);
}
.ef-billing-sub {
  color: var(--ef-text-muted);
  margin-block-end: var(--ef-space-5);
  font-size: var(--ef-fs-plan-sub);
}
.ef-billing-toggle { display: flex; justify-content: center; }
.ef-billing-secure { color: var(--ef-text-muted); font-size: var(--ef-fs-meta); }

/* ── Toggle cycle (segmented control) ──────────────────────────────── */
.ef-cycle {
  display: inline-flex;
  gap: var(--ef-space-1);
  padding: var(--ef-space-1);
  background: var(--ef-surface-alt);
  border: 1px solid var(--ef-border);
  border-radius: var(--nav-control-radius);
}
.ef-cycle-opt {
  margin: 0;
  cursor: pointer;
  border-radius: var(--ef-radius-sm);
}
.ef-cycle-label {
  display: inline-flex;
  align-items: center;
  gap: var(--ef-space-1);
  min-height: 44px;
  padding-inline: var(--ef-space-5);
  border-radius: var(--ef-radius-sm);
  font-weight: 600;
  color: var(--ef-text-muted);
  transition: background-color .15s ease, color .15s ease;
}
.ef-cycle-opt.is-active .ef-cycle-label {
  background: var(--ef-surface);
  color: var(--ef-primary);
  box-shadow: var(--ef-shadow);
}
.ef-cycle-opt:focus-within .ef-cycle-label { box-shadow: var(--nav-focus-ring); }
.ef-cycle-save {
  font-size: var(--ef-fs-meta);
  font-weight: 700;
  color: var(--ef-success);
  background: var(--ef-success-soft);
  border-radius: 999px;
  padding-inline: var(--ef-space-2);
  padding-block: 1px;
}

/* ── Carte de plan ─────────────────────────────────────────────────── */
.ef-plan-grid { align-items: stretch; }
.ef-plan {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--ef-space-4);
  padding: var(--ef-space-5);
  background: var(--ef-surface);
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius);
  box-shadow: var(--ef-shadow);
}
.ef-plan.is-recommended {
  border-color: var(--ef-primary);
  box-shadow: var(--ef-shadow-hover);
}
.ef-plan.is-current { border-color: var(--ef-success); }
.ef-plan-ribbon {
  position: absolute;
  inset-block-start: calc(-1 * var(--ef-space-3));
  inset-inline-end: var(--ef-space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--ef-space-1);
  padding-inline: var(--ef-space-3);
  padding-block: var(--ef-space-1);
  font-size: var(--ef-fs-meta);
  font-weight: 700;
  color: var(--ef-surface);
  background: var(--ef-primary);
  border-radius: 999px;
}
.ef-plan-head { display: flex; flex-direction: column; gap: var(--ef-space-2); }
.ef-plan-name {
  font-family: var(--ef-font);
  font-size: var(--ef-fs-h);
  margin: 0;
  color: var(--ef-text);
}
.ef-plan-desc { color: var(--ef-text-muted); margin: 0; font-size: var(--ef-fs-plan-desc); }
.ef-plan-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--ef-space-1);
  padding-inline: var(--ef-space-2);
  padding-block: 2px;
  border-radius: 999px;
  font-size: var(--ef-fs-meta);
  font-weight: 600;
}
.ef-plan-badge--active { color: var(--ef-success); background: var(--ef-success-soft); }

.ef-plan-pricing { display: flex; flex-direction: column; gap: var(--ef-space-2); }
.ef-plan-price { display: flex; align-items: baseline; gap: var(--ef-space-2); flex-wrap: wrap; }
.ef-plan-price-value {
  font-size: var(--ef-fs-plan-price);
  font-weight: 700;
  color: var(--ef-primary);
  line-height: 1;
}
.ef-plan-price-cur { font-weight: 600; color: var(--ef-text); font-size: var(--ef-fs-plan-cur); }
.ef-plan-price-suffix { color: var(--ef-text-muted); font-size: var(--ef-fs-plan-suffix); }
.ef-plan-save {
  align-self: flex-start;
  font-size: var(--ef-fs-meta);
  font-weight: 700;
  color: var(--ef-success);
  background: var(--ef-success-soft);
  border-radius: var(--ef-radius-sm);
  padding-inline: var(--ef-space-2);
  padding-block: 2px;
}
.ef-plan-hint { color: var(--ef-text-muted); font-size: var(--ef-fs-meta); }

.ef-plan-features { display: grid; gap: var(--ef-space-2); margin: 0; }
.ef-plan-feat {
  display: flex;
  align-items: center;
  gap: var(--ef-space-2);
  font-size: var(--ef-fs-plan-feat);
}
.ef-plan-feat.is-off { color: var(--ef-text-faint); }
.ef-feat-on { color: var(--ef-success); }
.ef-feat-off { color: var(--ef-text-faint); }

.ef-plan-cta { margin-block-start: auto; display: grid; gap: var(--ef-space-2); }
.ef-plan-renew { display: contents; }
.ef-plan-note { color: var(--ef-text-muted); font-size: var(--ef-fs-meta); text-align: center; margin: 0; }
.ef-cta {
  inline-size: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: var(--ef-radius-sm);
}

/* ── Code promo ────────────────────────────────────────────────────── */
.ef-promo { display: flex; flex-direction: column; gap: var(--ef-space-2); }
.ef-promo-label { font-weight: 600; color: var(--ef-text); margin: 0; }
.ef-promo-input { min-height: 44px; }
.ef-promo-btn { min-height: 44px; }
.ef-promo.is-applied .ef-promo-input {
  background: var(--ef-success-soft);
  border-color: var(--ef-success);
}
.ef-promo.is-error .ef-promo-input { border-color: var(--ef-danger); }
.ef-promo-feedback { font-size: var(--ef-fs-meta); }
.ef-promo.is-applied .ef-promo-feedback { color: var(--ef-success); }
.ef-promo.is-error .ef-promo-feedback {
  color: var(--ef-danger);
  background: var(--ef-danger-soft);
  border-radius: var(--ef-radius-sm);
  padding-inline: var(--ef-space-2);
  padding-block: var(--ef-space-1);
}
.ef-promo-spin { display: inline-block; animation: ef-spin 1s linear infinite; }
@keyframes ef-spin { to { transform: rotate(360deg); } }

/* ── Récap ─────────────────────────────────────────────────────────── */
.ef-recap {
  margin-block-start: var(--ef-space-4);
  padding: var(--ef-space-4);
  background: var(--ef-surface-alt);
  border-radius: var(--ef-radius);
}
.ef-recap-title { font-weight: 700; color: var(--ef-text); margin-block-end: var(--ef-space-2); }
.ef-recap-lines { margin: 0; }
.ef-recap-total-value { color: var(--ef-primary); }
.ef-recap-pay {
  display: flex;
  gap: var(--ef-space-4);
  flex-wrap: wrap;
  margin-block: var(--ef-space-3);
  color: var(--ef-text-muted);
  font-size: var(--ef-fs-meta);
}
.ef-recap-secure {
  margin-block-start: var(--ef-space-2);
  margin-block-end: 0;
  text-align: center;
  color: var(--ef-text-muted);
  font-size: var(--ef-fs-meta);
}
.ef-subscribe-cycle {
  display: flex;
  align-items: center;
  gap: var(--ef-space-3);
  margin-block-end: var(--ef-space-4);
  flex-wrap: wrap;
}
.ef-subscribe-cycle-label { font-weight: 600; color: var(--ef-text); }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  /* Réassignation des tokens typo abonnements au niveau des variables :
     l'override reste centralisé, les classes ne changent pas. */
  :root {
    --ef-fs-plan-price: 2.15rem;
    --ef-fs-plan-cur: 1.2rem;
    --ef-fs-plan-suffix: 1rem;
    --ef-fs-plan-desc: 1rem;
    --ef-fs-plan-feat: 1rem;
    --ef-fs-plan-sub: 1.05rem;
  }
  .ef-billing-toggle .ef-cycle { inline-size: 100%; }
  .ef-billing-toggle .ef-cycle-opt { flex: 1 1 0; }
  .ef-billing-toggle .ef-cycle-label { justify-content: center; inline-size: 100%; }
}
