/*
 |----------------------------------------------------------------
 | billing-portal.css — static styles for the tenant billing portal
 |----------------------------------------------------------------
 |
 | Paired with resources/views/filament/pages/billing/billing-portal.blade.php
 | via <link rel="stylesheet" href="{{ asset('css/views/filament/pages/billing/billing-portal.css') }}">.
 |
 | All STATIC styles for the page live here.  The view still uses a
 | small number of inline style attributes for genuinely DYNAMIC
 | values that depend on PHP/Blade state at render time:
 |   - Status banner colors derived from $state_key
 |   - Seat-usage progress bar width / threshold colors
 |   - Per-plan card border/background based on isCurrent / highlight
 |   - Per-plan annual visibility toggled by JS data-billing-period
 |
 | Buyers can override any class by adding a higher-specificity rule
 | in a custom stylesheet — the panel-provider render hook loads
 | tenant stylesheets after this file.
 */

/* ─── Period toggle: hidden state (toggled by billing-portal.js) ───
   Replaces a previous inline style="display:none;" on the yearly
   price + yearly CTA so the Blade view contains zero inline styles
   with static values. The class is added/removed by JS based on the
   active period (data-billing-period / data-billing-cta). */
.bp-period-hidden {
    display: none;
}

/* ─── Error fallback ─── */
.bp-error-card {
    padding: 24px;
    background: #fef2f2;
    color: #7f1d1d;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* ─── Status banner (background + border are dynamic, set inline) ─── */
.bp-status-banner {
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}
.bp-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.bp-status-pill-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
/* fg + border are dynamic, set inline */
.bp-status-pill {
    display: inline-block;
    padding: 4px 12px;
    background: #ffffff;
    font-weight: 600;
    font-size: 13px;
    border-radius: 999px;
}
.bp-plan-headline {
    font-size: 18px;
    color: #111827;
}
.bp-plan-price-line {
    color: #6b7280;
    font-size: 14px;
}
.bp-next-event-line {
    color: #6b7280;
    font-size: 14px;
}
.bp-next-event-strong {
    color: #111827;
}
.bp-next-event-rel {
    color: #9ca3af;
}
.bp-actions-wrap {
    display: flex;
    gap: 8px;
}
.bp-cta-primary {
    display: inline-block;
    padding: 10px 18px;
    background: #4f46e5;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* ─── Main two-column grid ─── */
.bp-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.bp-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}
.bp-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
}

/* ─── Current plan block ─── */
.bp-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.bp-plan-name-large {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}
.bp-plan-desc {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}
.bp-price-block {
    text-align: right;
}
.bp-price-large {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}
.bp-price-period {
    color: #6b7280;
    font-size: 13px;
}

/* ─── Seat usage ─── */
.bp-seat-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.bp-seat-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}
.bp-seat-header-strong {
    color: #111827;
}
.bp-seat-bar-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
/* width + background are dynamic (kept inline) */
.bp-seat-bar-fill {
    height: 100%;
    transition: width 0.3s;
}
.bp-seat-warning {
    margin: 8px 0 0;
    color: #dc2626;
    font-size: 13px;
}

/* ─── Plan features list ─── */
.bp-features-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 12px;
}
.bp-features-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.bp-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 14px;
}
.bp-feature-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.bp-empty {
    color: #6b7280;
}

/* ─── Right column actions ─── */
.bp-gateway-info {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b7280;
}
.bp-gateway-info-strong {
    color: #111827;
}
.bp-actions-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bp-action-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #111827;
    font-size: 14px;
    font-weight: 500;
}
.bp-action-link-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #fecaca;
    border-radius: 8px;
    text-decoration: none;
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
}
.bp-action-arrow {
    color: #9ca3af;
}
.bp-support-hint {
    margin: 16px 0 0;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.5;
}

/* ─── Recent events ─── */
.bp-events-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}
.bp-event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 6px;
}
.bp-event-label {
    color: #111827;
    font-size: 14px;
}
.bp-event-time {
    color: #9ca3af;
    font-size: 12px;
}

/* ─── Available plans grid ─── */
.bp-plans-section {
    margin-top: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}
.bp-plans-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.bp-plans-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.bp-billing-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 3px;
    font-size: 13px;
    font-weight: 600;
}
.bp-toggle-btn-active {
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.bp-toggle-btn-inactive {
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}
.bp-save-badge {
    font-size: 11px;
    color: #10b981;
    font-weight: 700;
    margin-left: 4px;
}
.bp-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
/* per-card border + background are dynamic (kept inline) */
.bp-plan-card {
    border-radius: 12px;
    padding: 20px;
    position: relative;
}
.bp-plan-card-tag-recommended {
    position: absolute;
    top: -10px;
    right: 16px;
    padding: 2px 10px;
    background: #7c3aed;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
}
.bp-plan-card-tag-current {
    position: absolute;
    top: -10px;
    right: 16px;
    padding: 2px 10px;
    background: #4f46e5;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
}
.bp-plan-card-name {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.bp-plan-card-price {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}
.bp-plan-card-price-suffix {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}
.bp-plan-card-price-free {
    color: #10b981;
}
.bp-plan-card-save {
    font-size: 11px;
    color: #10b981;
    font-weight: 600;
    margin-top: 4px;
}

.bp-plan-card-description {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
}

/* ─── Upgrade/downgrade preview box inside a plan card ─── */
.bp-preview-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #374151;
}
.bp-preview-upgrade {
    color: #10b981;
}
.bp-preview-downgrade {
    color: #3b82f6;
}
.bp-preview-meta {
    color: #6b7280;
}

/* ─── Plan-card CTAs (Switch / Switch annual / Active) ─── */
.bp-switch-btn {
    display: block;
    text-align: center;
    padding: 8px 16px;
    background: #4f46e5;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.bp-active-label {
    text-align: center;
    padding: 8px 16px;
    color: #4f46e5;
    font-weight: 600;
    font-size: 14px;
}

/* ─── Billing details (VAT / business name) form card ─── */
.bp-billing-details {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}
.bp-billing-details-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}
.bp-billing-details-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px;
}
.bp-billing-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.bp-form-label {
    font-size: 12px;
    color: #374151;
    font-weight: 600;
}
.bp-form-label-full {
    grid-column: span 2;
}
.bp-form-input {
    margin-top: 4px;
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}
.bp-form-input-mono {
    font-family: ui-monospace, monospace;
}
.bp-form-input-uppercase {
    text-transform: uppercase;
}
.bp-form-input-textarea {
    resize: vertical;
}
.bp-form-error {
    color: #b91c1c;
    font-size: 11px;
}
.bp-form-submit-row {
    grid-column: span 2;
    text-align: right;
}
.bp-form-submit {
    padding: 10px 18px;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* ─── Annual-toggle JS-driven state classes ─── */
/* Replace JS button.style mutation with class toggling. */
.bp-toggle-btn-active[data-period],
[role="tab"][aria-selected="true"].bp-toggle-btn-active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
[role="tab"][aria-selected="false"].bp-toggle-btn-inactive {
    background: transparent;
    color: #6b7280;
    box-shadow: none;
}

/* ─── Mobile: collapse the 2/1 grid to a single column ─── */
@media (max-width: 768px) {
    .bp-grid,
    .lh-billing-grid {
        grid-template-columns: 1fr;
    }
    .bp-billing-form {
        grid-template-columns: 1fr;
    }
    .bp-form-label-full {
        grid-column: auto;
    }
    .bp-form-submit-row {
        grid-column: auto;
    }
}
