/* =============================================
   pricing.css - Styles used ONLY on pricing.html
   All classes prefixed with pr-
   Text colors meet 4.5:1 on the dark background: white text sits on the
   deeper orange (--accent-strong), small print uses --text-muted.
   Flat on purpose (de-slop pass): solid panels, hairline borders, no glows,
   no featured plan, sentence-case labels.
   ============================================= */

.pr-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero */
.pr-hero {
    max-width: 1240px;
    margin: 0 auto;
    padding: 72px var(--spacing-lg) 8px;
    text-align: center;
}

.pr-hero h1 {
    font-family: var(--font-display);
    font-size: 3.6rem;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--text);
    text-wrap: balance;
    margin: 0 0 var(--spacing-sm) 0;
    animation: fadeInUp 0.6s ease-out both;
    line-height: 1.02;
}

.pr-hero .pr-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

/* Banners (?feature=car-search, ?checkout=canceled) */
.pr-banners {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.pr-banner {
    margin-top: var(--spacing-md);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--panel-muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    text-align: center;
}

.pr-banner p {
    margin: 0;
    font-size: 0.95rem;
}

.pr-banner--search {
    border-color: rgba(240, 180, 41, 0.45);
    background: rgba(240, 180, 41, 0.08);
}

.pr-banner--problem {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.pr-banner .pr-billing-btn {
    margin-top: 12px;
}

.pr-banner a {
    color: #FDBA74;
    font-weight: 600;
}

/* Billing Toggle */
.pr-toggle-wrap {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
    animation: fadeInUp 0.6s ease-out 0.15s both;
}

.pr-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--panel);
    border: 1px solid var(--border-subtle);
    border-radius: calc(var(--radius-btn) + 5px);
    padding: 5px;
}

.pr-toggle-btn {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
    min-height: 44px;
}

.pr-toggle-btn:hover {
    color: var(--text);
}

.pr-toggle-btn.pr-active {
    background: var(--accent-strong);
    color: var(--text);
}

.pr-toggle-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.pr-toggle-btn:disabled {
    cursor: wait;
}

/* "2 months free": plain small text, not a badge */
.pr-save-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: #34D399;
    white-space: nowrap;
}

.pr-toggle-btn.pr-active .pr-save-badge {
    color: var(--text);
}

/* Grid */
.pr-section {
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xl);
}

.pr-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-md);
    max-width: 1240px;
    margin: 0 auto;
    align-items: stretch;
}

.pr-noscript {
    text-align: center;
    color: var(--text-muted);
}

/* Cards: every plan gets the same flat card */
.pr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 32px 26px 26px;
    animation: fadeInUp 0.6s ease-out both;
}

.pr-card:nth-child(1) { animation-delay: 0.1s; }
.pr-card:nth-child(2) { animation-delay: 0.18s; }
.pr-card:nth-child(3) { animation-delay: 0.26s; }
.pr-card:nth-child(4) { animation-delay: 0.34s; }

/* The visitor's own plan: a green hairline and "Your plan" in the corner */
.pr-card--current {
    border-color: rgba(52, 211, 153, 0.6);
}

/* "Your plan": plain small text in the card's top padding, so it never
   moves the plan name or lines up badly with the other cards */
.pr-flag {
    position: absolute;
    top: 10px;
    right: 26px;
    color: #34D399;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

/* Card content */
.pr-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px 0;
}

/* "Dealerships" after the Diesel name: plain small text */
.pr-audience {
    margin-left: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pr-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 0 var(--spacing-md) 0;
    min-height: 3.2em; /* two lines, so prices line up across cards */
}

.pr-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 2px 0;
}

.pr-amount {
    font-family: var(--font-display);
    font-size: 2.9rem;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--text);
    line-height: 1;
}

.pr-per {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pr-billed {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-height: 1.4em;
    margin: 0 0 var(--spacing-md) 0;
}

.pr-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-lg) 0;
    flex-grow: 1;
}

.pr-features li {
    padding: 9px 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    line-height: 1.5;
}

.pr-features li:last-child {
    border-bottom: none;
}

.pr-features li::before {
    content: '\2713';
    color: var(--text-muted);
    font-weight: 700;
    flex-shrink: 0;
    width: 16px;
    display: inline-block;
}

/* CTA buttons */
.pr-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 46px;
    padding: 12px var(--spacing-md);
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}

.pr-cta:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--field-border);
}

.pr-cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.pr-cta:disabled {
    cursor: wait;
    opacity: 0.75;
}

/* A member's natural next step (white text on the deeper orange: 5.2:1) */
.pr-cta--primary {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--text);
}

.pr-cta--primary:hover {
    background: var(--accent-strong-hover);
    border-color: var(--accent-strong-hover);
}

/* "Current plan": clearly not a button to press */
.pr-cta--current,
.pr-cta--current:disabled,
.pr-cta--current:hover {
    cursor: default;
    opacity: 1;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.45);
    color: #D1FAE5;
}

.pr-cta-note {
    margin: -12px 0 10px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Inline error message (stays in the page so screen readers hear it) */
.pr-error {
    margin: 10px 0 0 0;
    font-size: 0.85rem;
    color: #FECACA;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    text-align: center;
}

.pr-error:empty {
    margin: 0;
    padding: 0;
    border: 0;
}

.pr-error a {
    color: #fff;
    font-weight: 600;
}

/* Below the cards */
.pr-compare-jump {
    max-width: 1240px;
    margin: var(--spacing-lg) auto 0;
    text-align: center;
}

.pr-compare-jump a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #FDBA74;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pr-compare-jump a:focus-visible,
.pr-banner a:focus-visible,
.pr-error a:focus-visible {
    outline: 3px solid #FDBA74;
    outline-offset: 2px;
    border-radius: 4px;
}

.pr-billing {
    max-width: 560px;
    margin: var(--spacing-md) auto 0;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    background: var(--panel);
    text-align: center;
}

.pr-billing[hidden] {
    display: none;
}

.pr-billing p {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.pr-billing .pr-error {
    margin-bottom: 0;
}

.pr-billing-btn {
    min-height: 44px;
    padding: 10px 22px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.pr-billing-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--field-border);
}

.pr-billing-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.pr-footnote {
    max-width: 760px;
    margin: var(--spacing-lg) auto 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Full comparison table. The #compare jump clears the sticky nav through
   the site-wide scroll-padding-top in styles.css. */
.pr-compare {
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xl);
}

.pr-compare:focus {
    outline: none;
}

.pr-compare h2 {
    font-family: var(--font-display);
    text-align: center;
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 var(--spacing-md) 0;
    line-height: 1.05;
}

.pr-table-hint {
    display: none;
    margin: 0 0 10px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pr-table-outer {
    position: relative;
}

/* Set by pricing.js when the table is wider than the screen: a hint, and a
   fade that shows more plans are off to the right */
.pr-compare--scrolls .pr-table-hint {
    display: block;
}

.pr-compare--scrolls .pr-table-outer::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 28px;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    background: linear-gradient(to right, rgba(20, 24, 36, 0), #141824);
    pointer-events: none;
}

.pr-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: #141824;
}

.pr-table-wrap:focus-visible {
    outline: 3px solid #FDBA74;
    outline-offset: 2px;
}

.pr-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.pr-table th,
.pr-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pr-table tbody tr:last-child th,
.pr-table tbody tr:last-child td {
    border-bottom: none;
}

.pr-table thead th {
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

/* Row labels stay visible while the table scrolls sideways on phones */
.pr-table tbody th,
.pr-table-corner {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #141824;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 9.5em;
}

.pr-table td {
    color: var(--text);
    white-space: nowrap;
}

.pr-table .pr-row--wrap td {
    white-space: normal;
    min-width: 7em;
}

.pr-table .pr-col--current {
    background: rgba(52, 211, 153, 0.07);
}

/* "Your plan" in the table head: plain small text */
.pr-col-tag {
    margin-left: 6px;
    color: #34D399;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1100px) {
    .pr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 720px;
    }
}

@media (max-width: 640px) {
    .pr-hero {
        padding: 40px 16px 8px;
    }

    .pr-hero h1 {
        font-size: 2.6rem;
    }

    .pr-banners,
    .pr-toggle-wrap,
    .pr-section,
    .pr-compare {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pr-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        gap: var(--spacing-lg);
    }

    .pr-card {
        padding: 30px 20px 22px;
    }

    .pr-flag {
        right: 20px;
    }

    .pr-tagline {
        min-height: 0;
    }

    .pr-toggle-btn {
        padding: 9px 14px;
    }

    .pr-compare h2 {
        font-size: 1.9rem;
        margin-bottom: 8px;
    }

    /* Narrow screens: a tighter table */
    .pr-table {
        min-width: 500px;
        font-size: 0.86rem;
    }

    .pr-table th,
    .pr-table td {
        padding: 11px 12px;
    }

    .pr-table tbody th,
    .pr-table-corner {
        min-width: 7.5em;
    }
}

@media (max-width: 360px) {
    .pr-toggle-btn {
        padding: 8px 10px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .pr-save-badge {
        font-size: 0.75rem;
    }
}
