/*
 * The pricing cards (issue #812, Money 6/9 — PRD #805).
 *
 * Four cards: FREE, STARTER, GROWTH, PRO. GROWTH is the hero: it carries the
 * "most popular" badge, sits a little higher and has the brand border. That is
 * the whole point of the page — the jump from STARTER to GROWTH must read at a
 * glance (user story 32).
 *
 * Only design tokens are used. Brand vermilion #FD3F0F, cream #FFFBF7, text
 * #303030, Tajawal, English digits, light first. Dark mode is handled by the
 * panel dark layer through the same tokens.
 */

/*
 * Issue #1815 — the grid used to be one `repeat(auto-fit, minmax(230px, 1fr))`
 * at every width. At about 768px that fits THREE cards, so four plans read as
 * 3 + 1 and the fourth card sat alone on its own row, stretched to full width.
 *
 * Three steps now, and they use the two panel breakpoints (chore #1812):
 * one card a row on a phone, exactly two on a tablet, and the auto-fit grid
 * the desktop always had.
 */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
    margin: 0 auto;
    max-width: 1120px;
}

/* Tablet: two a row, so four plans read as 2 + 2 and five as 2 + 2 + 1. */
@media (min-width: 576px) and (max-width: 991.98px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .pricing-grid {
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    }
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #eef2f7);
    border-radius: 16px;
    padding: 22px 20px;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.pricing-card:hover {
    border-color: #FFD9CC;
    box-shadow: 0 6px 20px rgba(48, 48, 48, .06);
}

/* The hero card. */
.pricing-card--hero {
    border: 2px solid #FD3F0F;
    box-shadow: 0 10px 30px rgba(253, 63, 15, .12);
}

@media (min-width: 992px) {
    .pricing-card--hero {
        transform: translateY(-10px);
    }

    .pricing-card--hero:hover {
        transform: translateY(-12px);
    }
}

.pricing-badge {
    position: absolute;
    top: -12px;
    inset-inline-start: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FD3F0F;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

.pricing-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text, #303030);
    margin: 0 0 2px;
}

.pricing-sub {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 14px;
    min-height: 18px;
}

.pricing-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}

.pricing-amount bdi {
    font-size: 32px;
    font-weight: 700;
    color: var(--text, #303030);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.pricing-amount span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
}

/*
 * The local-currency hint (issue #1936, PRD #1934).
 *
 * Small and grey on purpose. The SAR number above stays the big one, because
 * that is the amount the card is charged; this is only an approximate reading
 * of it in the merchant's own money. A Saudi merchant gets no element at all,
 * so this rule then styles nothing and the card keeps today's spacing.
 */
.pricing-hint {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    line-height: 1.2;
    min-height: 14px;
}

/* One unbreakable run. A card is narrow, and a price split across two lines
   is unreadable. */
.pricing-hint .plan-price-hint {
    white-space: nowrap;
}

.pricing-hint .plan-price-hint bdi {
    font-variant-numeric: tabular-nums;
}

.pricing-period {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 14px;
    min-height: 16px;
}

/* The yearly رصيد gift. Added value, never written as a discount. */
.pricing-gift {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #FFF1EB;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 600;
    color: #303030;
}

.pricing-gift i {
    color: #FD3F0F;
    font-size: 12px;
    margin-top: 2px;
}

.pricing-features {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    flex: 1 1 auto;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text, #303030);
    padding: 5px 0;
}

.pricing-features li i {
    font-size: 11px;
    margin-top: 4px;
    flex: none;
    color: #16a34a;
}

.pricing-features li.is-off {
    color: var(--text-muted, #94a3b8);
}

.pricing-features li.is-off i {
    color: #cbd5e1;
}

.pricing-features bdi {
    font-variant-numeric: tabular-nums;
}

.pricing-action {
    display: block;
    text-align: center;
    background: #FD3F0F;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    padding: 11px 16px;
    text-decoration: none;
    transition: background .15s ease;
}

.pricing-action:hover,
.pricing-action:focus {
    background: #e03409;
    color: #fff;
    text-decoration: none;
}

.pricing-action--quiet {
    background: transparent;
    color: #FD3F0F;
    border: 1px solid #FFD9CC;
}

.pricing-action--quiet:hover,
.pricing-action--quiet:focus {
    background: #FFF1EB;
    color: #FD3F0F;
}

.pricing-action--current {
    background: #f1f5f9;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
}

/* The monthly / yearly switch. */
.pricing-switch {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 22px;
}

.pricing-switch button {
    /* Issue #1815: `padding: 8px` around 13px type made the button about 32px
       tall. A finger needs 44px, so the floor is stated. The pill around them
       has no height of its own, so it grows with them. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 9px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.pricing-switch button[aria-pressed="true"] {
    background: #fff;
    color: #FD3F0F;
    box-shadow: 0 1px 3px rgba(48, 48, 48, .1);
}
