/* Billing Page Styles */

/* ── Scrollbar ─────────────────────────────── */
html { scroll-padding-top: 90px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(162,56,255,.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(162,56,255,.6); }

/* Header Specific */
.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.back-btn:hover {
    background: rgba(162, 56, 255, 0.1);
    border-color: var(--border-purple);
    color: var(--primary-color);
    transform: translateX(-2px);
}

.back-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.back-btn:hover .back-icon {
    transform: translateX(-2px);
}

/* Main Layout */
.billing-main {
    padding-top: 80px;
    min-height: 100vh;
    background: var(--gradient-background);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    animation: slideInDown 0.8s ease-out;
}

.page-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

/* Billing Sections */
.billing-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    animation: fadeInUp 0.5s ease-out;
}

.billing-section:hover {
    border-color: var(--border-purple);
    box-shadow: 0 8px 24px rgba(162, 56, 255, 0.08);
}

/* Subscription Overview */
.subscription-overview .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.subscription-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.subscription-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.subscription-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.subscription-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.plan-info {
    flex: 1;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 1rem;
    color: var(--text-secondary);
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.feature-check {
    color: #10b981;
    font-weight: 600;
    font-size: 1rem;
}

.billing-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.billing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.billing-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Libellé bouton avec sous-titre (ex: bouton annuler) */
.btn-label-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    text-align: left;
}

.btn-label-main {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.btn-label-sub {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.75;
    line-height: 1.2;
}

.btn-label-sub:empty {
    display: none;
}

/* Grille : 1 colonne par défaut, 2 colonnes sur desktop (≥1024px) */
.billing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.billing-col-left,
.billing-col-right {
    min-width: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: rgba(162, 56, 255, 0.1);
    border-color: var(--border-purple);
    transform: translateY(-1px);
}

.action-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1rem;
}

/* Payment Method */
.payment-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.payment-card:hover {
    border-color: var(--border-purple);
    background: rgba(162, 56, 255, 0.06);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon {
    font-size: 1.5rem;
}

.card-brand {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-number {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.card-expiry {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.card-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-indicator.valid {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Billing History */
.history-filter,
.stats-period {
    display: flex;
    align-items: center;
}

.filter-select {
    padding: 0.5rem 1rem;
    background: rgba(42, 42, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 2.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.invoice-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.invoice-item:hover {
    border-color: var(--border-purple);
    background: rgba(162, 56, 255, 0.06);
    transform: translateY(-2px);
}

.invoice-info {
    min-width: 0;
}

.invoice-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.invoice-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.invoice-period {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Ligne du bas : montant + statut + actions */
.invoice-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invoice-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: auto;
}

.invoice-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.invoice-status.paid {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.invoice-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.invoice-actions {
    display: flex;
    gap: 0.5rem;
}

.invoice-action-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.invoice-action-btn:hover {
    background: rgba(162, 56, 255, 0.1);
    border-color: var(--border-purple);
    color: var(--primary-color);
}

.action-icon {
    font-size: 0.875rem;
}

.billing-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(162, 56, 255, 0.1);
    border: 1px solid rgba(162, 56, 255, 0.3);
    border-radius: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Usage Statistics */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.usage-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(42, 42, 42, 0.3);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.usage-card:hover {
    border-color: var(--primary-color);
    background: rgba(62, 62, 62, 0.4);
    transform: translateY(-2px);
}

.usage-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 12px;
    flex-shrink: 0;
}

.usage-content {
    flex: 1;
    min-width: 0;
}

.usage-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.usage-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.usage-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.usage-trend.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.usage-trend.neutral {
    color: var(--text-muted);
    background: rgba(136, 136, 136, 0.1);
}

.trend-icon {
    font-size: 0.875rem;
}

/* Usage Chart */
.usage-chart {
    margin-top: 2rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 2rem;
    height: 150px;
    margin-bottom: 1rem;
}

.chart-bar {
    width: 40px;
    background: linear-gradient(to top, var(--primary-color), var(--primary-light));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: end;
    justify-content: center;
    padding-bottom: 0.5rem;
}

.chart-bar:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(162, 56, 255, 0.3);
}

.chart-bar.active {
    background: var(--gradient-primary);
    box-shadow: 0 5px 15px rgba(162, 56, 255, 0.4);
}

.bar-label {
    position: absolute;
    bottom: -1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.chart-legend {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Billing Settings */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.setting-item:hover {
    border-color: var(--border-purple);
    background: rgba(162, 56, 255, 0.06);
}

.setting-info {
    flex: 1;
    margin-right: 1rem;
}

.setting-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.setting-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.setting-control {
    flex-shrink: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-slider:hover {
    box-shadow: 0 0 0 3px rgba(162, 56, 255, 0.1);
}

.setting-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.setting-btn:hover {
    background: rgba(162, 56, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Help Section */
.help-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    text-align: center;
}

.help-content {
    max-width: 500px;
    margin: 0 auto;
}

.help-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.help-icon {
    font-size: 1.5rem;
}

.help-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.help-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.help-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    min-width: 200px;
    justify-content: center;
}

.help-btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.help-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--shadow-primary);
}

.help-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.help-btn.secondary:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
    transform: translateY(-1px);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(4, 4, 10, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-purple);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(-8px);
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

.modal.large {
    max-width: 800px;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(62, 62, 62, 0.5);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
    justify-content: flex-end;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal-btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.modal-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px var(--shadow-primary);
}

.modal-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-btn.secondary:hover {
    background: rgba(162, 56, 255, 0.1);
    border-color: var(--border-purple);
}

/* Payment Form */
.payment-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(162, 56, 255, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.card-input-container {
    position: relative;
}

.card-icons {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.card-icon {
    font-size: 1.5rem;
    opacity: 0.6;
}

.card-icon.active {
    opacity: 1;
}

/* Invoice Viewer */
.invoice-viewer {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.invoice-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Button States */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-spinner.hidden {
    display: none;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    /* Correction pour les boutons d'abonnement */
    .subscription-main {
        gap: 1.5rem;
    }
    
    .subscription-actions {
        gap: 0.75rem;
        width: 100%; /* Assure que le conteneur prend toute la largeur */
        display: flex;
        flex-direction: column; /* Force l'affichage en colonne */
    }
    
    .action-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        width: 100%; /* Force les boutons à prendre toute la largeur */
        text-align: center; /* Centre le texte */
        justify-content: center; /* Centre le contenu */
    }
    
    /* Assure que les boutons cachés restent cachés */
    .action-btn[style*="display: none"] {
        display: none !important;
    }
    
    /* Usage grid */
    .usage-grid {
        grid-template-columns: 1fr;
    }
    
    /* Invoice actions pleine largeur sur mobile */
    .invoice-footer {
        width: 100%;
    }

    .invoice-actions {
        margin-left: auto;
    }
    
    /* Billing summary */
    .billing-summary {
        gap: 0.75rem;
    }
    
    /* Help actions */
    .help-actions {
        width: 100%;
    }
    
    .help-btn {
        width: 100%;
    }
    
    /* Form row */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Modal actions */
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .subscription-main {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }

    .billing-info {
        min-width: 240px;
        flex-shrink: 0;
    }

    /* Boutons en ligne à partir de 768px, avec wrap */
    .subscription-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: stretch;
    }

    .subscription-actions .action-btn {
        flex: 1 1 auto;
        min-width: 180px;
    }

    /* Bouton danger prend toute la largeur si seul sur sa ligne */
    .subscription-actions .action-btn.danger {
        align-items: center;
    }

    .usage-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .invoice-item {
        align-items: center;
    }

    .settings-grid {
        gap: 1rem;
    }

    .help-actions {
        flex-direction: row;
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
    }

    .billing-main {
        padding: 100px 0 40px;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .plan-name {
        font-size: 1.75rem;
    }

    .price-amount {
        font-size: 3rem;
    }

    /* Grille 2 colonnes : abonnement+paiement à gauche, historique+settings à droite */
    .billing-grid {
        display: grid;
        grid-template-columns: 1fr 420px;
        gap: 2rem;
        align-items: flex-start;
    }

    .billing-col-left,
    .billing-col-right {
        min-width: 0;
    }

    /* Les boutons d'action en colonne dans la sidebar (plus lisible) */
    .subscription-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .subscription-actions .action-btn {
        min-width: unset;
        flex: none;
        width: 100%;
    }
}