/* ==========================================================================
   LEGAL EXPERTS — B2B SUBSCRIPTION & ECOSYSTEM STYLES
   ========================================================================== */

:root {
    --sub-primary: #121e33;
    --sub-primary-light: #1a2b48;
    --sub-accent: #c5a059;
    --sub-accent-hover: #b38f48;
    --sub-accent-soft: rgba(197, 160, 89, 0.12);
    --sub-accent-gradient: linear-gradient(135deg, #d4af37 0%, #aa8232 100%);
    --sub-card-bg: #ffffff;
    --sub-card-border: #e2e8f0;
    --sub-text: #1e293b;
    --sub-muted: #64748b;
    --sub-success: #10b981;
    --sub-danger: #ef4444;
    --sub-warning: #f59e0b;
    --sub-info: #3b82f6;
    --sub-radius-sm: 8px;
    --sub-radius-md: 14px;
    --sub-radius-lg: 20px;
    --sub-shadow: 0 10px 30px -5px rgba(18, 30, 51, 0.08);
    --sub-shadow-hover: 0 20px 40px -8px rgba(18, 30, 51, 0.16);
}

/* ==========================================================================
   1. PRICING SECTION & TOGGLES
   ========================================================================== */
.pricing-section {
    padding: 4.5rem 0 5.5rem;
    background: #f8fafc;
}

.pricing-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 3rem;
}

.pricing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sub-accent-soft);
    color: #926f23;
    border: 1px solid rgba(197, 160, 89, 0.3);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.pricing-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    color: var(--sub-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.pricing-lead {
    font-size: 1.1rem;
    color: var(--sub-muted);
    line-height: 1.6;
}

/* Period Billing Switch (Monthly / Yearly) */
.billing-switcher-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 3.5rem;
}

.billing-switch {
    display: inline-flex;
    align-items: center;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 999px;
    position: relative;
    user-select: none;
}

.billing-switch-btn {
    padding: 0.55rem 1.35rem;
    font-size: 0.94rem;
    font-weight: 600;
    color: #475569;
    border: none;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.billing-switch-btn.is-active {
    background: #ffffff;
    color: var(--sub-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.discount-pill {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #bbf7d0;
}

/* ==========================================================================
   2. PRICING CARDS GRID
   ========================================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    align-items: stretch;
}

@media (max-width: 980px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin: 0 auto;
    }
}

.pricing-card {
    background: var(--sub-card-bg);
    border: 1px solid var(--sub-card-border);
    border-radius: var(--sub-radius-lg);
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--sub-shadow);
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sub-shadow-hover);
}

.pricing-card.is-popular {
    border-color: var(--sub-accent);
    box-shadow: 0 12px 35px -5px rgba(197, 160, 89, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
}

.popular-badge-ribbon {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sub-accent-gradient);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.3rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(170, 130, 50, 0.3);
}

.plan-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.plan-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sub-primary);
    margin: 0 0 0.25rem;
}

.plan-target {
    font-size: 0.88rem;
    color: var(--sub-muted);
    margin: 0;
}

.plan-price-wrap {
    margin: 1.25rem 0 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.plan-price {
    font-size: 2.35rem;
    font-weight: 800;
    color: var(--sub-primary);
    line-height: 1;
}

.plan-price-period {
    font-size: 0.95rem;
    color: var(--sub-muted);
}

.plan-savings {
    font-size: 0.82rem;
    color: #16a34a;
    font-weight: 600;
    min-height: 20px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    flex: 1;
}

.plan-features li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 0.85rem;
    font-size: 0.94rem;
    color: #334155;
    line-height: 1.45;
}

.plan-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.plan-cta-btn {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: var(--sub-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.plan-cta-primary {
    background: var(--sub-accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.35);
}

.plan-cta-primary:hover {
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.45);
    transform: translateY(-1px);
}

.plan-cta-outline {
    background: #ffffff;
    border: 1.5px solid var(--sub-primary);
    color: var(--sub-primary);
}

.plan-cta-outline:hover {
    background: var(--sub-primary);
    color: #ffffff;
}

/* ==========================================================================
   3. COMPARISON TABLE MATRIX
   ========================================================================== */
.comparison-section {
    padding: 4rem 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.comparison-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
    text-align: center;
    color: var(--sub-primary);
    margin-bottom: 2.5rem;
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: var(--sub-radius-md);
}

.sub-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    text-align: left;
}

.sub-matrix-table th,
.sub-matrix-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.sub-matrix-table th {
    background: #f8fafc;
    color: var(--sub-primary);
    font-weight: 700;
}

.sub-matrix-table th:first-child { width: 38%; }
.sub-matrix-table td:not(:first-child),
.sub-matrix-table th:not(:first-child) {
    text-align: center;
}

.sub-matrix-table tr:hover td {
    background: #fdfdfd;
}

.sub-matrix-table .col-highlight {
    background: #fffdf8;
    font-weight: 600;
}

.sub-check {
    color: #16a34a;
    font-weight: 800;
    font-size: 1.1rem;
}

.sub-dash {
    color: #94a3b8;
    font-weight: bold;
}

/* ==========================================================================
   4. MODAL: PUBLIC OFFER & EDS SIGNING
   ========================================================================== */
.sub-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.sub-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.sub-modal {
    background: #ffffff;
    border-radius: var(--sub-radius-lg);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.sub-modal-backdrop.is-open .sub-modal {
    transform: translateY(0);
}

.sub-modal-head {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.sub-modal-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--sub-primary);
}

.sub-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.sub-modal-close:hover {
    color: var(--sub-danger);
}

.sub-modal-body {
    padding: 1.75rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.sub-offer-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--sub-radius-sm);
    padding: 1.25rem;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    max-height: 240px;
    overflow-y: auto;
    color: #334155;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.sub-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
    .sub-form-grid { grid-template-columns: 1fr; }
}

.sub-modal-foot {
    padding: 1.25rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   5. ANALYTICS: LIMIT COUNTER & BLUR LEAD MAGNET
   ========================================================================== */
.analytics-sub-bar {
    background: #ffffff;
    border: 1px solid var(--sub-card-border);
    border-radius: var(--sub-radius-md);
    padding: 0.85rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.sub-bar-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.sub-bar-badge {
    background: var(--sub-primary);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
}

.sub-bar-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #334155;
}

.sub-meter-bar {
    width: 130px;
    height: 7px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.sub-meter-fill {
    height: 100%;
    background: var(--sub-accent);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Blur lead magnet on unauthorized view */
.gated-blur-section {
    position: relative;
    overflow: hidden;
    border-radius: var(--sub-radius-md);
}

.gated-blur-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    opacity: 0.6;
}

.gated-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    z-index: 10;
}

.gated-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--sub-accent-soft);
    color: #926f23;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
}

.gated-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sub-primary);
    margin: 0 0 0.5rem;
}

.gated-text {
    max-width: 440px;
    color: var(--sub-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   6. B2B CABINET: TARIFF WIDGET & TRACKERS
   ========================================================================== */
.cabinet-sub-widget {
    background: linear-gradient(135deg, var(--sub-primary) 0%, #1e3a5f 100%);
    color: #ffffff;
    border-radius: var(--sub-radius-lg);
    padding: 1.85rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(18, 30, 51, 0.12);
    position: relative;
    overflow: hidden;
}

.sub-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sub-widget-plan {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-widget-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
}

.sub-widget-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .sub-widget-stats { grid-template-columns: 1fr 1fr; }
}

.sub-stat-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--sub-radius-sm);
    padding: 1rem;
}

.sub-stat-label {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.sub-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

/* Legal Case Kanban / Tracker (Претензия -> Медиация -> Суд -> ЧСИ) */
.legal-case-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--sub-radius-md);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.legal-case-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.case-stepper {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    position: relative;
}

.case-stepper::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.case-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.case-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.case-step.is-done .case-step-num {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.case-step.is-current .case-step-num {
    background: var(--sub-accent);
    border-color: var(--sub-accent);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.2);
}

.case-step-label {
    font-size: 0.82rem;
    color: #475569;
    font-weight: 600;
}

/* Watchlist UI */
.watchlist-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.watchlist-safe { background: #dcfce7; color: #15803d; }
.watchlist-warn { background: #fef3c7; color: #b45309; }
.watchlist-danger { background: #fee2e2; color: #b91c1c; }
