/**
 * Corner Subscription — feuille de style.
 *
 * SOMMAIRE
 *   01. Variables partagées & réinitialisations communes
 *   02. Bouton d'abonnement          [corner_subscription formule="…"]
 *   03. Habillage des formules       (dégradés bronze / silver / gold, prix)
 *   04. Tableau des abonnements      [corner_subscription_liste]
 *   05. Menu ⋮ du tableau
 *   06. Mon abonnement               [corner_subscription_mon_abonnement]
 *   07. Carte de membre — QR & plein écran   [corner_subscription_carte]
 *   08. Page de la carte de membre   (page autonome, hors thème)
 *   09. Media queries                (600px → 400px)
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=La+Belle+Aurore&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

/* ============================================
   01. VARIABLES PARTAGÉES & RÉINITIALISATIONS
   ============================================ */

/* Les trois dégradés de formule servent à deux endroits : les blocs
   .back_* du site et le bandeau de la carte de membre. Une seule source. */
:root {
  --cs-grad-bronze: linear-gradient(155deg, #d9a066, #8c5a2b);
  --cs-grad-silver: linear-gradient(155deg, #c7d0d4, #8f9ba1);
  --cs-grad-gold: linear-gradient(155deg, #f4d78a, #b5852a);
}

/* Le thème ajoute deux petites barres blanches (::before / ::after) à tous
   les boutons. On les neutralise une fois pour toutes sur les boutons du
   plugin, plutôt que de le répéter dans chaque bloc. */
.cs-menu-toggle::before,
.cs-menu-toggle::after,
.cs-qr-open::before,
.cs-qr-open::after,
.cs-qr-full__close::before,
.cs-qr-full__close::after,
.cs-card-page .cs-card__btn::before,
.cs-card-page .cs-card__btn::after {
  content: none !important;
  display: none !important;
}

/* ============================================
   02. BOUTON D'ABONNEMENT
   ============================================ */

.corner-subscription-button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1px solid #05dbb2;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #05dbb2;
}

.corner-subscription-button:hover {
  color: white;
  background: #05dbb2;
}

.corner-subscription-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Alertes visibles des seuls administrateurs : clé de formule inconnue,
   tarif Stripe manquant. */
.corner-subscription-notice {
  padding: 0.9rem 1.1rem;
  border-left: 3px solid currentColor;
  background: rgba(0, 0, 0, 0.04);
}

/* ============================================
   03. HABILLAGE DES FORMULES
   ============================================ */

.back_bronze {
  background: var(--cs-grad-bronze);
}

.back_silver {
  background: var(--cs-grad-silver);
}

.back_gold {
  background: var(--cs-grad-gold);
}

.month {
  font-family: "Aloevera Display";
  text-transform: uppercase;
  font-size: 16px;
}

.price_subscription h2 {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ============================================
   04. TABLEAU DES ABONNEMENTS
   ============================================ */

/* Indispensable : .lc-status-badge est en position absolue pour les cards
   de réservation. Dans un tableau, la pastille doit rester dans sa cellule. */
.lc-subscription-list .lc-status-badge {
  position: static !important;
  right: auto !important;
  display: inline-block;
}

.lc-subscription-list .lc-ligue-standings-filter {
  margin-top: 15px;
}

/* Abonnements résiliés, impayés ou expirés : en retrait */
.lc-subscription-list tr.is-inactive {
  opacity: 0.5;
}

/* Colonne d'actions : juste assez large pour le bouton ⋮ */
.lc-subscription-list .lc-subscription-col-actions {
  width: 40px;
  text-align: right;
}

/* --- Vignette photo -------------------------------------------------
   Purement informative : le changement de photo passe par le menu ⋮. */

.lc-subscription-list .lc-subscription-col-photo {
  width: 56px;
}

.cs-photo {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #f2f2f2;
}

.cs-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-photo__vide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px dashed #ccc;
  border-radius: 50%;
  color: #bbb;
  font-size: 16px;
  line-height: 1;
}

/* ============================================
   05. MENU ⋮ DU TABLEAU
   ============================================ */

.cs-menu {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.cs-menu-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 26px !important;
  height: 26px !important;
  padding: 4px !important;
  border: none !important;
  border-radius: 50% !important;
  background: none !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  color: #000 !important;
  line-height: 1;
  cursor: pointer !important;
}

.cs-menu-toggle:hover,
.cs-menu-toggle:focus {
  background: #f5f5f5 !important;
  color: #15493f !important;
}

/* L'état fermé est écrit dans le HTML, pas ici : un CSS absent ne doit
   jamais laisser le menu ouvert en permanence. */
.cs-menu-list {
  min-width: 220px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.cs-menu-list a {
  display: block;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
  text-align: left;
}

.cs-menu-list a:last-child {
  border-bottom: none;
}

.cs-menu-list a:hover {
  background: #f5f5f5;
  color: #15493f;
}

/* Pastille de couleur par type d'action */
.cs-menu-list a::before {
  content: "●";
  margin-right: 8px;
}

.cs-menu-list .is-use::before {
  color: #ffb600;
}

.cs-menu-list .is-gift::before {
  color: #00c951;
}

.cs-menu-list .is-cancel::before {
  color: #fc4649;
}

.cs-menu-list .is-revoke::before {
  color: #9e9e9e;
}

.cs-menu-list .is-card::before {
  color: #15493f;
}

.cs-menu-list .is-photo::before {
  color: #7a7a7a;
}

/* ============================================
   06. MON ABONNEMENT (espace membre)
   ============================================ */

/* .cs-abo--none : variante affichée quand le membre n'a pas d'abonnement. */
.cs-abo,
.cs-abo--none {
  max-width: 620px;
}

/* --- En-tête : formule et état -------------------------------------- */

.cs-abo__eyebrow {
  margin: 0;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aaa;
}

/* Contient soit le logo de la formule, soit son nom en texte. */
.cs-abo__plan {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 0;
  font-family: "Nicon Black", Sans-serif;
  font-size: 42px;
  line-height: 1.05;
  text-transform: uppercase;
  color: #15493f;
}

/* Logo défini dans inc/config/plans.php. Sans lui, le nom s'affiche. */
.cs-abo__logo {
  display: block;
  width: auto;
  height: 90px !important;
}

.cs-abo__state {
  font-family: "obviously-narrow", Sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #05dbb2;
}

.cs-abo--ending .cs-abo__state {
  color: #d08700;
}

/* --- Jetons et compteur ---------------------------------------------
   Un jeton par créneau : plein s'il reste, pointillé s'il est utilisé. */

.cs-abo__tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 14px;
}

.cs-abo__tokens span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.cs-abo__tokens .is-free {
  background: #05dbb2;
}

.cs-abo__tokens .is-used {
  background: transparent;
  border: 2px dashed #d8d8d8;
}

.cs-abo__count {
  margin: 0;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 17px;
  color: #15493f;
}

.cs-abo__count strong {
  margin-right: 4px;
  font-family: "Nicon Black", Sans-serif;
  font-size: 26px;
}

.cs-abo__gift {
  margin: 14px 0 0;
  padding-left: 14px;
  border-left: 3px solid #05dbb2;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 14px;
  color: #0f6e56;
}

/* --- Renouvellement et actions -------------------------------------- */

.cs-abo__renew {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid #ececec;
  font-family: "Aloevera Display", Sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}

.cs-abo__renew strong {
  color: #15493f;
  font-weight: 700;
}

.cs-abo__action {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 0;
}

.cs-abo__link {
  background-color: var(--e-global-color-secondary);
  font-size: var(--e-global-typography-accent-font-size);
  font-weight: var(--e-global-typography-accent-font-weight);
  text-transform: var(--e-global-typography-accent-text-transform);
  font-family: var(--e-global-typography-accent-font-family), Sans-serif;
  color: #fff;
  border-radius: 10px !important;
  padding: 12px 24px;
}

.cs-abo__link:hover {
  color: #fff !important;
}

.cs-abo__hint {
  font-family: "obviously-narrow", Sans-serif;
  font-size: 12px;
  color: #b0b0b0;
}

/* --- Historique ------------------------------------------------------ */

.cs-abo__history {
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid #ececec;
}

.cs-abo__list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.cs-abo__list li {
  display: flex;
  gap: 18px;
  padding: 9px 0;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 14px;
}

.cs-abo__date {
  flex-shrink: 0;
  width: 120px;
  color: #15493f;
  font-weight: 700;
}

.cs-abo__detail {
  color: #999;
}

.cs-abo__empty {
  margin: 14px 0 0;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 14px;
  color: #b0b0b0;
}

/* ============================================
   07. CARTE DE MEMBRE — QR & PLEIN ÉCRAN
   ============================================ */

/* Le QR, côté membre */
.cs-abo__card {
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid #ececec;
}

.cs-abo__card--seul {
  max-width: 620px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.cs-abo__qr-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.cs-qr {
  flex-shrink: 0;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.cs-abo__qr-side {
  flex: 1;
  min-width: 200px;
}

.cs-abo__qr-note {
  margin: 0;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #888;
}

/* Bouton d'agrandissement */
.cs-qr-open {
  margin-top: 12px;
  padding: 10px 18px !important;
  border: 1px solid #15493f !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #15493f !important;
  cursor: pointer;
}

.cs-qr-open:hover {
  background: #15493f !important;
  color: #fff !important;
}

/* --- Surcouche plein écran ------------------------------------------
   Pensée pour être scannée : fond blanc franc et QR aussi grand que
   l'écran le permet. */

.cs-qr-full {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: #fff;
}

.cs-qr-full[hidden] {
  display: none;
}

.cs-qr-full__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cs-qr-full .cs-qr {
  width: min(78vw, 78vh, 460px);
  height: auto;
  border: 0;
  padding: 0;
}

.cs-qr-full__name {
  margin: 0;
  font-family: "Nicon Black", Sans-serif;
  font-size: 24px;
  text-transform: uppercase;
  color: #15493f;
}

.cs-qr-full__close {
  padding: 12px 26px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #15493f !important;
  font-family: "obviously-narrow", Sans-serif;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  color: #fff !important;
  cursor: pointer;
}

/* ============================================
   08. PAGE DE LA CARTE DE MEMBRE
   Page autonome, hors thème. Tout est porté par .cs-card-page pour ne rien
   déborder sur le site ; quelques !important parce que l'en-tête du thème
   est chargé avant cette feuille.
   ============================================ */

.cs-card-page {
  --cs-vert: #15493f;
  --cs-menthe: #05dbb2;
  --cs-titre: "Nicon Black", "obviously-narrow", Impact, sans-serif;
  --cs-accent: "obviously-narrow", Arial, sans-serif;
  --cs-texte: "Aloevera Display", Arial, sans-serif;
  --cs-bande: linear-gradient(150deg, #1d6153, #0e332c);

  margin: 0;
  min-height: 100vh;
  padding: 30px 16px 44px !important;
  background: radial-gradient(circle at 50% 0%, #1d6153 0%, #0d2d27 70%) !important;
  font-family: var(--cs-texte);
  color: #fff;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cs-card-page *,
.cs-card-page *::before,
.cs-card-page *::after {
  box-sizing: border-box;
}

/* --- La carte -------------------------------------------------------- */

.cs-card-page .cs-card {
  width: 100%;
  max-width: 400px;
  padding-bottom: 30px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  color: var(--cs-vert);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* Bandeau coloré selon la formule, repris des dégradés du site. */
.cs-card-page .cs-card__top {
  position: relative;
  padding: 20px;
  background: var(--cs-bande);
}

.cs-card-page .cs-card--bronze .cs-card__top {
  background: var(--cs-grad-bronze);
}

.cs-card-page .cs-card--silver .cs-card__top {
  background: var(--cs-grad-silver);
}

.cs-card-page .cs-card--gold .cs-card__top {
  background: var(--cs-grad-gold);
}

/* Un voile diagonal, pour éviter le dégradé plat. */
.cs-card-page .cs-card__top::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.cs-card-page .cs-card__label {
  position: relative;
  z-index: 1;
  display: block;
  font-family: var(--cs-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.cs-card-page .cs-card__logo {
  position: relative;
  z-index: 1;
  display: block;
  height: 40px;
  width: auto;
  margin: 14px auto 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.cs-card-page .cs-card__photo img,
.cs-card-page .cs-card__nophoto {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  margin: 18px auto -66px;
  display: block;
  border-radius: 50%;
  border: 5px solid #fff;
  object-fit: cover;
  background: #f0f0f0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.cs-card-page .cs-card__nophoto {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cs-accent);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #b0b0b0;
}

/* --- Le corps -------------------------------------------------------- */

.cs-card-page .cs-card__body {
  padding: 60px 26px 0;
}

.cs-card-page .cs-card__name {
  margin: 0 0 3px;
  font-family: var(--cs-titre);
  font-size: 28px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cs-card-page .cs-card__mail {
  margin: 0 0 18px;
  font-family: var(--cs-accent);
  font-size: 12px;
  color: #9aa5a2;
}

.cs-card-page .cs-card__state {
  display: inline-block;
  margin: 0 0 18px;
  padding: 8px 20px;
  border-radius: 999px;
  font-family: var(--cs-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.cs-card-page .is-ok {
  background: #e1f5ee;
  color: #0f6e56;
}

.cs-card-page .is-warn {
  background: #fff3d6;
  color: #8a5c00;
}

.cs-card-page .is-ko {
  background: #ffe3e3;
  color: #a11d1d;
}

.cs-card-page .cs-card__count {
  margin: 0 0 4px;
  font-family: var(--cs-accent);
  font-size: 14px;
  letter-spacing: 0.3px;
}

.cs-card-page .cs-card__count strong {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 72px;
  color: var(--cs-menthe);
  font-weight: 900;
  line-height: 0.9;
}

.cs-card-page .cs-card__note {
  margin: 0 0 24px;
  font-size: 13px;
  color: #8b9794;
}

/* --- Actions --------------------------------------------------------- */

.cs-card-page .cs-card__btn {
  display: block !important;
  margin: 0 auto;
  padding: 13px 20px;
  max-width: 300px;
  background: var(--cs-vert) !important;
  border-radius: 10px;
  font-family: var(--cs-accent);
  font-size: 15px;
  font-weight: 900;
  color: #fff !important;
  text-decoration: none;
}

.cs-card-page .cs-card__btn.is-ghost {
  background: #fff !important;
  color: var(--cs-vert) !important;
  border: 2px solid var(--cs-vert);
  box-shadow: none;
}

.cs-card-page .cs-card__since {
  margin: 18px 0 0;
  font-family: var(--cs-accent);
  font-size: 13px;
  color: #b8c2bf;
}

/* --- Messages et retour ---------------------------------------------- */

.cs-card-page .cs-card__flash {
  width: 100%;
  max-width: 400px;
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 8px;
  font-family: var(--cs-accent);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.cs-card-page .cs-card__flash.is-ok {
  background: var(--cs-menthe);
  color: var(--cs-vert);
}

.cs-card-page .cs-card__back {
  margin-top: 26px;
  font-family: var(--cs-accent);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.cs-card-page .cs-card__back:hover {
  color: var(--cs-menthe);
}

/* ============================================
   09. MEDIA QUERIES
   Ordre : du plus large au plus étroit (600 → 400)
   ============================================ */

/* -------------------- max 600px : espace membre -------------------- */
@media (max-width: 600px) {
  .cs-abo__plan {
    font-size: 32px;
  }

  /* !important nécessaire : la règle de base l'utilise aussi. */
  .cs-abo__logo {
    height: 48px !important;
  }

  .cs-abo__tokens span {
    width: 22px;
    height: 22px;
  }

  .cs-abo__list li {
    flex-direction: column;
    gap: 2px;
  }

  .cs-abo__date {
    width: auto;
  }
}

/* ----------------- max 400px : page carte de membre ---------------- */
@media (max-width: 400px) {
  .cs-card-page .cs-card__photo img,
  .cs-card-page .cs-card__nophoto {
    width: 112px;
    height: 112px;
    margin-bottom: -56px;
  }

  .cs-card-page .cs-card__body {
    padding-top: 72px;
  }

  .cs-card-page .cs-card__count strong {
    font-size: 60px;
  }
}
