/* ==========================================================================
   CostGuard – Public Pricing
   ──────────────────────────────────────────────────────────────────────────
   Rules only the public pricing page uses. The vocabulary it is built from —
   aliases, rhythm, type, the band, the quiet columns and the closing panel —
   lives in /css/costguard-public.css, which loads first.

   No colour literals below: every value resolves through --cg-*.

   The pricing-* names are the page's own, older vocabulary; tests find the
   featured card, its badge, the two comparison icons and the level badge by
   them, so they are kept and styled here. New shapes take cg-pricing-*.

   Green is money saved and amber is risk, so neither appears here: an
   included feature is an accent tick, a level is a neutral-to-accent chip.

   The page alternates five shapes so no two neighbours look alike:
     hero        centred statement and three reassurances, no box (.cg-pub-hero-center)
     plans       four cards on one grid, Enterprise as a wide row beneath
     comparison  full-bleed band, the table in one panel
     trust       heading beside its lead, three quiet columns under a hairline
     closing     centred statement, on ink in both themes (.cg-pub-promo-center)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Plans — the four cards share the rows of one grid, so the name, the price,
   the description, the action and the feature list line up across them
   however long a translation runs. Without subgrid each card is a column.
   -------------------------------------------------------------------------- */

.cg-pricing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--cg-pub-space-3);
}

@media (min-width: 768px) {
    .cg-pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .cg-pricing-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.cg-pricing .pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--cg-pub-space-4) var(--cg-pub-space-3);
    background: var(--cg-pub-panel-bg);
    border: 1px solid var(--cg-pub-panel-border);
    border-radius: var(--cg-pub-radius-lg);
    box-shadow: var(--cg-shadow-sm);
}

@supports (grid-template-rows: subgrid) {
    .cg-pricing-grid > .pricing-card {
        display: grid;
        grid-template-rows: subgrid;
        grid-row: span 5;
        row-gap: 0;
        align-items: start;
    }
}

/* The recommended plan: an accent hairline and a soft glow, not a filled card. */
.cg-pricing .pricing-card-featured {
    border-color: var(--cg-accent-text);
    background:
        radial-gradient(22rem 14rem at 50% 0, var(--cg-accent-soft), transparent 72%),
        var(--cg-pub-panel-bg);
    box-shadow: var(--cg-shadow-md);
}

.cg-pricing .pricing-badge-featured {
    position: absolute;
    top: 0;
    inset-inline-start: var(--cg-pub-space-3);
    transform: translateY(-50%);
    padding: 0.3125rem 0.75rem;
    border-radius: 50rem;
    background: var(--cg-accent);
    color: var(--cg-on-accent);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.cg-pricing .pricing-plan-head {
    margin-bottom: var(--cg-pub-space-3);
}

.cg-pricing .pricing-plan-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--cg-pub-ink);
}

.cg-pricing .pricing-plan-label {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--cg-accent-text);
}

.cg-pricing .pricing-price {
    margin-bottom: var(--cg-pub-space-2);
    font-family: var(--cg-font-display);
    font-weight: var(--cg-display-weight);
    font-size: clamp(2.25rem, 1.9rem + 1vw, 2.75rem);
    line-height: 1;
    letter-spacing: var(--cg-display-tracking);
    font-variant-numeric: lining-nums;
    color: var(--cg-pub-ink);
}

/* A price is a left-to-right run even inside a right-to-left card; it is
   isolated so the currency sign stays beside its figure, and pushed to the
   end of its own direction, which is the card's start. */
html[dir="rtl"] .cg-pricing .pricing-price {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: end;
}

.cg-pricing .pricing-price-sub {
    margin-bottom: var(--cg-pub-space-2);
    font-size: 0.875rem;
    color: var(--cg-pub-muted);
}

.cg-pricing .pricing-plan-desc {
    margin: 0 0 var(--cg-pub-space-3);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--cg-pub-muted);
}

.cg-pricing .pricing-card > .cg-button {
    width: 100%;
}

.cg-pricing .pricing-plan-features {
    display: grid;
    gap: 0.625rem;
    list-style: none;
    margin: var(--cg-pub-space-3) 0 0;
    padding: var(--cg-pub-space-3) 0 0;
    border-top: 1px solid var(--cg-border);
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--cg-pub-ink);
}

.cg-pricing .pricing-plan-features li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.625rem;
}

.cg-pricing .pricing-plan-features i {
    margin-top: 0.125rem;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--cg-accent-text);
}

/* Enterprise — a wide, quieter row: who it is for, what it adds, how to buy. */
.cg-pricing .cg-pricing-enterprise {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--cg-pub-space-3) 3rem;
    margin-top: var(--cg-pub-space-3);
    background: var(--cg-pub-band-bg);
    box-shadow: none;
}

.cg-pricing .cg-pricing-enterprise .pricing-plan-desc {
    margin-bottom: 0;
}

.cg-pricing .cg-pricing-enterprise .pricing-plan-features {
    margin-top: 0;
}

.cg-pricing .cg-pricing-enterprise .pricing-price {
    margin-bottom: 0.25rem;
}

.cg-pricing .cg-pricing-enterprise-action > .cg-button {
    width: 100%;
    margin-top: var(--cg-pub-space-1);
}

@media (min-width: 992px) {
    .cg-pricing .cg-pricing-enterprise {
        grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(0, 3fr);
        align-items: center;
        padding: var(--cg-pub-space-4);
    }

    .cg-pricing .cg-pricing-enterprise .pricing-plan-features {
        padding-top: 0;
        border-top: 0;
    }
}

/* --------------------------------------------------------------------------
   Comparison — the table owns all of its styling. Bootstrap's .table paints
   every cell through a variable chain that no selector can beat, so it is
   not used.
   -------------------------------------------------------------------------- */

.cg-pricing-table-wrap {
    margin-top: 3rem;
    overflow-x: auto;
}

.cg-pricing-scroll-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: var(--cg-pub-space-3) 0 0;
    font-size: 0.875rem;
    color: var(--cg-pub-muted);
}

.cg-pricing-scroll-hint + .cg-pricing-table-wrap {
    margin-top: var(--cg-pub-space-2);
}

@media (min-width: 992px) {
    .cg-pricing-scroll-hint {
        display: none;
    }

    .cg-pricing-scroll-hint + .cg-pricing-table-wrap {
        margin-top: 3rem;
    }
}

.cg-pricing-table {
    width: 100%;
    min-width: 52rem;
    margin: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.cg-pricing-table th,
.cg-pricing-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--cg-border);
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    color: var(--cg-pub-muted);
}

.cg-pricing-table thead th {
    padding-block: 1.25rem;
    border-bottom-color: var(--cg-border-strong);
    font-size: 1rem;
    font-weight: 600;
    color: var(--cg-pub-ink);
}

.cg-pricing-table thead th:first-child,
.cg-pricing-table .pricing-row-title {
    text-align: start;
}

.cg-pricing-table .pricing-row-title {
    width: 26%;
    min-width: 13rem;
    font-weight: 500;
    color: var(--cg-pub-ink);
}

.cg-pricing-table .pricing-category-row th {
    padding-top: var(--cg-pub-space-4);
    padding-bottom: var(--cg-pub-space-1);
    border-bottom-color: var(--cg-border-strong);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-align: start;
    text-transform: uppercase;
    color: var(--cg-accent-text);
}

html[lang="fa"] .cg-pricing-table .pricing-category-row th,
html[lang="ar"] .cg-pricing-table .pricing-category-row th {
    letter-spacing: 0;
}

.cg-pricing-table tbody tr:last-child > * {
    border-bottom: 0;
}

/* The recommended plan's column. Category rows span it and stay clear. */
.cg-pricing-table .pricing-col-featured {
    background: var(--cg-accent-soft);
}

.cg-pricing-table thead .pricing-col-featured {
    color: var(--cg-accent-text);
}

/* Below lg the panel scrolls sideways; the feature column stays in view. */
@media (max-width: 991.98px) {
    .cg-pricing-table thead th:first-child,
    .cg-pricing-table .pricing-row-title {
        position: sticky;
        inset-inline-start: 0;
        z-index: 1;
        width: 10.5rem;
        min-width: 10.5rem;
        max-width: 10.5rem;
        background: var(--cg-pub-panel-bg);
        border-inline-end: 1px solid var(--cg-border);
    }
}

.cg-pricing .pricing-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 1.0625rem;
    line-height: 1;
}

.cg-pricing .pricing-feature-icon-success {
    background: var(--cg-accent-soft);
    color: var(--cg-accent-text);
}

.cg-pricing .pricing-feature-icon-muted {
    color: var(--cg-pub-muted);
}

.cg-pricing .pricing-level-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--cg-border-strong);
    border-radius: 50rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cg-pub-muted);
}

.cg-pricing .pricing-level-standard {
    color: var(--cg-pub-ink);
}

.cg-pricing .pricing-level-advanced {
    border-color: transparent;
    background: var(--cg-accent-soft);
    color: var(--cg-accent-text);
}

/* On the tinted column a tinted chip would disappear, so it takes the panel. */
.cg-pricing .pricing-col-featured .pricing-feature-icon-success,
.cg-pricing .pricing-col-featured .pricing-level-advanced {
    background: var(--cg-pub-panel-bg);
}

.cg-pricing .pricing-cell-text,
.cg-pricing .pricing-support-text {
    font-weight: 500;
    color: var(--cg-pub-ink);
}

.cg-pricing .pricing-support-enterprise {
    color: var(--cg-accent-text);
}

.cg-pricing-note {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    max-width: 48rem;
    margin: var(--cg-pub-space-3) 0 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--cg-pub-muted);
}

.cg-pricing-note i {
    color: var(--cg-accent-text);
}

/* --------------------------------------------------------------------------
   Trust — the heading beside its lead, then the shared quiet columns
   -------------------------------------------------------------------------- */

.cg-pricing-trust-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: var(--cg-pub-space-3) 4rem;
    margin-bottom: 3rem;
}

@media (min-width: 992px) {
    .cg-pricing-trust-head {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
}

.cg-pricing-trust-links {
    margin-top: var(--cg-pub-space-3);
}
