.subscription-message {
    padding: 12px 20px;
    margin: 20px 0;
    border-radius: 6px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscription-message.success {
    background: #d4edda;
    padding: 10px 15px;
    border: 1px solid #c3e6cb;
    color: #155724;
    margin: 15px 0;
    border-radius: 5px;
}

.subscription-message.warning {
    background: #fff3cd;
    padding: 10px 15px;
    border: 1px solid #ffeeba;
    color: #856404;
    margin: 15px 0;
    border-radius: 5px;
}

.subscription-message.error {
    background: #f8d7da;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    color: #721c24;
    margin: 15px 0;
    border-radius: 5px;
}


.subscription-message.info {
    background-color: #e8f4fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.subscription-message .icon {
    font-size: 20px;
}

/* ✅ Messages */
.alert {
    padding: 12px 18px;
    margin: 20px 0;
    border-radius: 5px;
    font-size: 14px;
}

.alert-success {
    background-color: #e6f4ea;
    color: #206b37;
    border: 1px solid #b4dfc0;
}

.alert-warning {
    background-color: #fff8e6;
    color: #8a6d3b;
    border: 1px solid #ffe0a3;
}

.alert-danger {
    background-color: #fdecea;
    color: #a94442;
    border: 1px solid #f5c6cb;
}

/* ✅ Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

input[type="file"] {
    display: none;
}

.custom-file-upload {
    display: inline-block;
    padding: 8px 14px;
    cursor: pointer;
    background-color: #2e6da4;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
}

.custom-file-upload:hover {
    background-color: #204d74;
}

/* ✅ Table preview */
.table-preview {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
}

.table-preview th,
.table-preview td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    font-size: 14px;
}

.table-preview th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.table-preview tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table-preview tr:hover {
    background-color: #eef5ff;
}

.subscription-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
    background-color: #fff;
}

.subscription-table th,
.subscription-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.subscription-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subscription-table th {
    background-color: #f2f2f2;
    font-weight: 600;
    text-align: left;
}

.subscription-table td .user-name {
    font-weight: 500;
    display: block;
}

.subscription-table td .user-email {
    font-size: 12px;
    color: #666;
}

.disabled-btn {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.subscription-card {
    background-color: #f9f9f9;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 100%;
    margin: 10px 0 10px 0; /* haut-bas 30px, gauche-droite 0 */
}

/* Sur les petits écrans, on centre le bloc */
@media screen and (max-width: 768px) {
    .subscription-card {
        margin: 30px auto;
    }
}

/* Centrage mobile des cards d'abonnement quand elles sont dans une grille Bootstrap */
@media (max-width: 767.98px){
  .row:has(.subscription-card){
    justify-content: center !important;
  }
  .row:has(.subscription-card) > [class*="col-"]{
    display:flex;
    flex: 0 1 560px;
    max-width:560px;
  }
  .row:has(.subscription-card) > [class*="col-"] > .subscription-card{
    width:100%;
    margin: 16px 0;  /* respiration verticale */
  }
}

.ls-plans-page.container { max-width: 1200px; }
@media (max-width: 767.98px){
  .ls-plans-page .row { justify-content: center !important; }
  .ls-plans-page .row > [class*="col-"]{ display:flex; flex:0 1 560px; max-width:560px; }
}


/* Styles généraux pour les icônes d'action */
.action-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Conteneur des actions (si utilisé en bloc) */
.subscription-actions a {
    display: inline-block;
    margin: 0 6px;
}

/* Effet temporaire lors du chargement AJAX */
.toggleplan.disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Optionnel : survol plus doux */
.subscription-actions a:hover {
    opacity: 0.8;
}

.action-icon:hover {
    transform: scale(1.5);
    opacity: 1;
}

tr.plan-inactive {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    font-style: italic;
    opacity: 0.8;
}

#plan-details-box {
    border: 1px solid #ccc;
    padding: 1em;
    background: #f9f9f9;
    border-radius: 4px;
}
#plan-details-box table {
    width: 100%;
    border-collapse: collapse;
}
#plan-details-box th,
#plan-details-box td {
    padding: 0.4em 0.6em;
    text-align: left;
}

.popover {
    max-width: 700px;
    min-width: 400px;
    width: auto !important; /* largeur auto dans une plage définie */
}

.popover .popover-body {
    max-width: 700px;
    min-width: 400px;
    width: auto !important; /* largeur auto dans une plage définie */
}


.popover .popover-plan-content {
    width: 100%; /* prend toute la largeur du popover */
}


.popover .popover-plan-content table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* important pour répartir proprement */
}

.popover .popover-plan-content td {
    padding: 6px 8px;
    vertical-align: top;
}

.popover .popover-plan-content td:first-child {
    font-weight: bold;
    width: 150px; /* réduit la largeur de la colonne gauche */
    white-space: nowrap;
}

.popover .popover-plan-content td:last-child {
    width: auto !important; /* plus d’espace à droite */
    word-wrap: break-word;
}

.popover .popover-plan-content ul {
    padding-left: 18px;
    margin: 4px 0;
}


.user-subscriptions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.subscription-card {
  border-left: 4px solid #6f42c1;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  background-color: #f9f9fb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.subscription-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #442673;
  margin-bottom: 0.5rem;
}

.plan-icon {
  margin-right: 0.5rem;
}

.status-badge {
  padding: 0.2em 0.6em;
  border-radius: 0.5em;
  font-size: 0.75rem;
  color: white;
}

.status-badge.active {
  background-color: #198754;
}
.status-badge.inactive {
  background-color: #dc3545;
}

.subscription-details div {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.scope-label {
  text-decoration: underline dotted;
  cursor: help;
}

.subscription-card.border-success {
  border-color: #198754 !important; /* vert */
}
.subscription-card.border-danger {
  border-color: #dc3545 !important; /* rouge */
}
.badge.bg-success-color {
  background-color: #198754;
}
.badge.bg-danger-color {
  background-color: #dc3545;
}

.subscription-card {
  background: rgb(240, 236, 236);
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.plan-title-neutral {
  background-color: #ddeaff;
  color: #003366;
  padding: 12px;
  font-size: 1.1rem;
  width: 100%;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: bold;
}

.courselist {
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

.courselist li {
  margin-bottom: 0.3rem;
  color: #2e2350;
}

.course-desc p {
    font-size: 0.7rem !important;
    color: #555;
    line-height: 1.6;
    border-left: 3px solid #ccc;
    padding-left: 12px;
    margin-top: 6px;
}

.course-desc.d-none {
    display: none;
}

.plan-price-block {
  font-weight: bold;
  font-size: 1.35rem;
  color: #000;
}

.change-currency-link {
  font-size: 0.7rem;
  margin-left: 0.6rem;
}

.subscribe-button {
  background-color: #005f73;
  color: white;
  border: none;
  padding: 12px;
  font-size: 1.1rem;
  width: 100%;
  border-radius: 8px;
  font-weight: bold;
  transition: background-color 0.2s ease-in-out;
}

.subscribe-button:hover {
  background-color: #003f52;
  color: white;
}

.subscribe-button:active:hover {
  background-color: #013140;
  color: white;
}

/* états existants gardés */
.subscribe-button:disabled,
.subscribe-button[disabled] {
  background-color: #4b6b75; /* proche de ta palette, un peu grisé/atténué */
  color: #ffffff;
  border: none;
  opacity: 0.85;
  cursor: not-allowed;
}

.form-label .text-danger { margin-left: 4px; font-weight: 700; }

/* Discret, cohérent avec ta liste plans */
.courselist .coursename { display:inline-block; }
.courselist .course-desc { border-left: 3px solid #e6e6e6; padding-left: .75rem; }

/* Badges */
.ls-badge-popular, .ls-badge-premium {
  position: absolute; top: -10px; right: -10px;
  padding: .5rem .75rem; border-radius: 999px;
  font-weight: 700; z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,.12);
  border: 1px solid rgba(0,0,0,.06);
}
.ls-badge-popular { 
  background: linear-gradient(135deg,#faf2db,#ffc107);
  color:#111; }
.ls-badge-premium {
  background: linear-gradient(135deg,#b993ff,#7b2fff);
  color:#fff;
}

/* Titres */
.ls-title-popular {
  background:linear-gradient(135deg, rgba(255, 242, 174, 0.18), rgba(255, 226, 79, 0.18));
  border:1px solid #ffe58f;
  color:#875300;
}
.ls-title-premium {
  background:linear-gradient(135deg, rgba(185,147,255,.18), rgba(123,47,255,.18));
  border:1px solid rgba(123,47,255,.35);
  color:#2b1b5e;
}

/* Cards */
.ls-card-popular {
  box-shadow: 0 8px 28px rgba(251, 238, 173, 0.18);
}
.ls-card-premium {
  box-shadow: 0 8px 28px rgba(123,47,255,.18);
}

/* Boutons */
.subscribe-button {
  background-color:#005f73; color:#fff; border:none;
  padding:12px; font-size:1.1rem; border-radius:8px; font-weight:700;
  transition: background-color .2s ease-in-out;
}
.subscribe-button:hover  { background-color:#003f52; }
.subscribe-button:active:hover { background-color:#013140; }

/* Bouton "Popular" (or) */
.ls-btn-popular {
  background: linear-gradient(135deg,#faf2db,#ffc107) !important;
  color: #111 !important;
  border: none !important;
  padding: 12px;
  font-size: 1.1rem;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(251, 238, 173, 0.25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.ls-btn-popular:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(251, 238, 173, 0.35);
}
.ls-btn-popular:active:hover {
  transform: translateY(1px);
  box-shadow: 0 6px 18px rgba(251, 238, 173, 0.28);
}

/* Bouton premium (violet harmonisé) */
.ls-btn-premium {
  background: linear-gradient(135deg, #b993ff, #7b2fff) !important;
  color: #fff !important;
  border: none !important;
  padding: 12px;
  font-size: 1.1rem;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(123, 47, 255, .25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.ls-btn-premium:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(123, 47, 255, .35);
}
.ls-btn-premium:active:hover {
  transform: translateY(1px);
  box-shadow: 0 6px 18px rgba(123, 47, 255, .28);
}
/* Conteneur global (icône + nom + badge) */
.ls-provider-with-env{
  display:inline-flex;
  align-items:center;
  gap:.5rem;              /* espace entre nom et badge */
  vertical-align:middle;  /* s'aligne bien dans une cellule */
  white-space:nowrap;     /* évite les retours à la ligne */
  line-height:1.2;
}

/* Icône + nom */
.ls-provider-badge{
  display:inline-flex;
  align-items:center;
  gap:.375rem;            /* espace icône/nom */
}

/* Icône : élimine l’espace baseline des <img> */
.ls-provider-icon{
  width:18px;
  height:18px;
  display:block;          /* important : pas inline, sinon décalage vertical */
}

/* Nom : pas besoin d’une hauteur fixe, on laisse le flex centrer */
.ls-provider-name{
  line-height:1;
}

/* Badge d’environnement aligné et “pill” */
.ls-env-badge{
  display:inline-flex;
  align-items:center;
  height:18px;            /* même hauteur visuelle que l’icône */
  padding:0 .5rem;
  border-radius:9999px;
  font-size:.75rem;
  line-height:1;          /* évite le décalage vertical */
}

/* Couleurs (garde ce que tu avais) */
.ls-env-test{ background:#eef2ff; color:#3f51b5; }
.ls-env-live{ background:#e8f5e9; color:#2e7d32; }

/* Au cas où ta table force vertical-align: top; */
table.generaltable td { vertical-align: middle; }

.ls-policy { line-height:1.6; }
.ls-policy h2 { margin-top:1.25rem; }
.ls-policy h3 { margin-top:1rem; }

/* Colonne description (HTML riche) */
.plan-desc img {
  max-width: 100%;
  height: auto;
  display: block;
}
.scope-desc img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* local/subscriptions — liens “Description” en style texte */
.ls-plan-desc-link {
  text-decoration: none;
}
.ls-plan-desc-link:hover,
.ls-plan-desc-link:focus {
  text-decoration: underline;
}

/* ====== Plans – corrections mobile & badges ====== */

/* 1) Mobile : une carte par ligne, centrée, sans "trou" à droite */
@media (max-width: 767.98px){
  /* Le conteneur rendu par le renderer */
  .subscription-plan-grid{
    justify-content: center !important;   /* au centre, pas start */
    gap: 16px !important;                 /* gap régulier */
  }
  /* Les cards : pleine largeur (on écrase le style inline max-width:32%; min-width:300px) */
  .subscription-plan-grid .plan-card{
    flex: 1 1 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  /* Un peu moins haut : on compacte les espacements internes */
  .subscription-plan-grid .plan-card{ padding: 14px !important; }
  .subscription-plan-grid .plan-card .plan-title-neutral{
    padding: 8px 10px !important;
    margin-bottom: .5rem !important;
  }
  .subscription-plan-grid .plan-courselist{ margin-bottom: .75rem !important; }
  .subscription-plan-grid .courselist li{ margin-bottom: .25rem !important; }
  .subscription-plan-grid .bottom-zone{ margin-top: .5rem !important; }
}

/* 2) Badge "Populaire/Premium" : plus haut et un peu plus compact en mobile */
@media (max-width: 767.98px){
  .ls-badge-popular,
  .ls-badge-premium{
    top: -18px !important;       /* remonte le badge */
    right: -6px !important;
    padding: .35rem .6rem !important;
    font-size: .9rem !important;
  }
}

/* 3) Desktop : marges latérales "visuelles" pour ne pas prendre 100% */
@media (min-width: 768px){
  .subscription-plan-grid{
    margin-left: -12px;
    margin-right: -12px;
  }
  .subscription-plan-grid .plan-card{
    margin-left: 12px;
    margin-right: 12px;          /* ajoute un gutter par carte */
  }
}

/* si le conteneur est aussi .subscription-plan-grid sur la page publique */
@media (max-width: 767.98px){
  .subscription-plan-grid{ justify-content:center!important; }
  .subscription-plan-grid .plan-card{ flex:1 1 100%!important; max-width:100%!important; min-width:0!important; }
}
