/* ═══════════════════════════════════════════════════
   tm-subscriptions.css — Abonnements & Crédits TMP
   ═══════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────── */
:root {
    --tm-radius:    12px;
    --tm-shadow:    0 4px 24px rgba(0,0,0,.10);
    --tm-orange:    #f49c3b;
    --tm-green:     #28a745;
    --tm-red:       #e74c3c;
    --tm-grey:      #6c757d;
    --tm-bg:        #f8f9fa;
    --tm-border:    #e0e0e0;
    --tm-text:      #333;
}

/* ── Solde ──────────────────────────────────────── */
.tm-credit-balance {
    display:        flex;
    align-items:    center;
    gap:            12px;
    background:     #fff;
    border:         1px solid var(--tm-border);
    border-radius:  var(--tm-radius);
    padding:        14px 20px;
    margin-bottom:  28px;
    font-size:      1rem;
    box-shadow:     var(--tm-shadow);
    flex-wrap:      wrap;
}
.tm-balance-icon { font-size: 1.5rem; }
.tm-plan-badge {
    display:        inline-block;
    padding:        4px 12px;
    border-radius:  20px;
    color:          #fff;
    font-size:      .85rem;
    font-weight:    600;
    margin-left:    auto;
}
/* ── Grille des packs ───────────────────────────── */
.tm-plans-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap:                   24px;
    margin-bottom:         40px;
}

/* Couleur prix pack max */
.tm-plan-card[data-plan="max"] .tm-price-amount {
    color: #3D73D6 !important;
}

/* Badge populaire */
.tm-plan-card.tm-popular {
    position: relative;
    border: 2px solid #3D73D6;
}

.tm-popular-badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background: #3D73D6;
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.tm-plan-card {
    background:    #fff;
...
    border:        2px solid var(--tm-border);
    border-radius: var(--tm-radius);
    padding:       28px 22px;
    box-shadow:    var(--tm-shadow);
    transition:    transform .2s, border-color .2s;
    display:       flex;
    flex-direction: column;
    gap:           14px;
}
.tm-plan-card:hover { transform: translateY(-4px); border-color: var(--plan-color, var(--tm-orange)); }
.tm-plan-card.tm-plan-current { border-color: var(--plan-color, var(--tm-orange)); background: #fffbf5; }

.tm-plan-header {
    display:     flex;
    align-items: center;
    gap:         10px;
}
.tm-plan-icon  { font-size: 1.8rem; }
.tm-plan-header h3 { margin: 0; font-size: 1.1rem; color: var(--tm-text); }

.tm-plan-price { display: flex; align-items: baseline; gap: 4px; }
.tm-price-amount { font-size: 2rem; font-weight: 700; color: var(--plan-color, var(--tm-orange)); }
.tm-price-period { color: var(--tm-grey); font-size: .9rem; }

.tm-plan-credits { font-size: .95rem; color: var(--tm-text); }

/* ── Boutons ────────────────────────────────────── */
.tm-btn {
    display:        inline-block;
    padding:        10px 18px;
    border-radius:  8px;
    border:         none;
    cursor:         pointer;
    font-weight:    600;
    font-size:      .95rem;
    transition:     background .2s, opacity .2s;
    text-align:     center;
    width:          100%;
}
.tm-btn:disabled { opacity: .55; cursor: not-allowed; }

.tm-btn-subscribe     { background: var(--plan-color, var(--tm-orange)); color: #fff; }
.tm-btn-subscribe:hover:not(:disabled) { background: #000; color: #fff; filter: none; }

.tm-btn-change        { background: var(--tm-grey); color: #fff; }
.tm-btn-change:hover:not(:disabled) { background: #555; }

.tm-btn-cancel        { background: transparent; color: var(--tm-red); border: 2px solid var(--tm-red); }
.tm-btn-cancel:hover:not(:disabled) { background: var(--tm-red); color: #fff; }

.tm-btn-cancel-confirm { background: var(--tm-red); color: #fff; }
.tm-btn-back           { background: var(--tm-grey); color: #fff; }

/* ── Modales ────────────────────────────────────── */
.tm-modal-overlay {
    position:       fixed;
    inset:          0;
    background:     rgba(0,0,0,.5);
    z-index:        99999;
    display:        flex;
    align-items:    center;
    justify-content: center;
    padding:        20px;
}
.tm-modal-box {
    background:    #fff;
    border-radius: var(--tm-radius);
    padding:       32px;
    max-width:     480px;
    width:         100%;
    position:      relative;
    box-shadow:    0 8px 40px rgba(0,0,0,.18);
}
.tm-modal-box h3  { margin: 0 0 12px; font-size: 1.2rem; }
.tm-modal-box p   { color: #555; margin: 0 0 16px; }

.tm-modal-close {
    position:   absolute;
    top:        14px;
    right:      18px;
    background: none;
    border:     none;
    font-size:  1.6rem;
    cursor:     pointer;
    color:      #888;
    line-height: 1;
}
.tm-modal-close:hover { color: #333; }

.tm-modal-actions { display: flex; gap: 12px; margin-top: 16px; }
.tm-modal-actions .tm-btn { flex: 1; }

.tm-modal-secure {
    text-align:  center;
    font-size:   .8rem;
    color:       #888;
    margin-top:  12px;
    margin-bottom: 0;
}

/* Stripe card element inside modal */
#tm-stripe-card-element {
    border:        1px solid var(--tm-border);
    border-radius: 8px;
    padding:       12px;
    background:    #fafafa;
    margin-top:    8px;
}
.tm-card-errors { color: var(--tm-red); font-size: .88rem; min-height: 20px; margin-top: 6px; }

/* ── Messages globaux ───────────────────────────── */
.tm-message     { padding: 12px 16px; border-radius: 8px; margin: 8px 0; font-size: .95rem; }
.tm-msg-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.tm-msg-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

#tm-sub-messages { margin-top: 12px; }

/* ── Toggle Mensuel/Annuel ────────────────────── */
.tm-billing-toggle {
    display:        flex;
    justify-content: center;
    gap:            10px;
    margin-bottom:  30px;
}
.tm-billing-toggle .tm-btn {
    width:          auto;
    background:     var(--tm-border);
    color:          var(--tm-text);
}
.tm-billing-toggle .tm-btn:hover,
.tm-billing-toggle .tm-btn.tm-toggle-active {
    background:     #000;
    color:          #fff;
}
.tm-payment-tabs {
    display:       flex;
    gap:           0;
    border-bottom: 2px solid var(--tm-border);
    margin-bottom: 16px;
}
.tm-tab-btn {
    background:    none;
    border:        none;
    padding:       10px 20px;
    cursor:        pointer;
    font-size:     .95rem;
    font-weight:   600;
    color:         var(--tm-grey);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition:    color .2s, border-color .2s;
}
.tm-tab-btn.tm-tab-active {
    color:         var(--tm-orange);
    border-bottom-color: var(--tm-orange);
}
.tm-tab-btn:hover:not(.tm-tab-active) { color: var(--tm-text); }

/* Contenu onglet crédits */
.tm-credit-pay-info {
    background:    #fffbf0;
    border:        1px solid #fde8b8;
    border-radius: 8px;
    padding:       14px 18px;
    margin-bottom: 12px;
}
.tm-credit-pay-info p { margin: 4px 0; font-size: .95rem; }
.tm-credit-note { font-style: italic; color: var(--tm-grey) !important; font-size: .85rem !important; }

.tm-balance-line { font-weight: 600; }
.tm-balance-line.tm-insufficient { color: var(--tm-red) !important; }

.tm-btn-pay-credit {
    display:       block;
    width:         100%;
    padding:       12px;
    background:    var(--tm-orange);
    color:         #fff;
    border:        none;
    border-radius: 8px;
    font-size:     1rem;
    font-weight:   700;
    cursor:        pointer;
    transition:    background .2s;
}
.tm-btn-pay-credit:hover:not(:disabled) { background: #d4831c; }
.tm-btn-pay-credit:disabled { opacity: .5; cursor: not-allowed; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 600px) {
    .tm-plans-grid { grid-template-columns: 1fr; }
    .tm-modal-box  { padding: 22px 16px; }
    .tm-modal-actions { flex-direction: column; }
}
