/* Pricing (report.php), checkout (checkout-payment.php) and redeem-code UI.
   Mobile-first: base rules are for phones, min-width queries add the desktop layout. */

:root {
    --pr-brand: #667eea;
    --pr-brand-dark: #4c51bf;
    --pr-ink: #1e293b;
    --pr-muted: #64748b;
    --pr-line: #e2e8f0;
    --pr-bg: #f5f7fa;
    --pr-ok: #16a34a;
    --pr-no: #dc2626;
    --pr-popular: #f6c851;
    --pr-pay: #16a34a;
}

body.pr-page { background: var(--pr-bg); }

.pr-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px 16px 24px; /* body already pads for the fixed header */
}

.pr-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--pr-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.pr-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--pr-ink);
    margin: 4px 0 4px;
    line-height: 1.25;
}
.pr-sub {
    color: var(--pr-muted);
    font-size: 0.95rem;
    margin: 0 0 16px;
}
.pr-reg {
    display: inline-block;
    background: #ffd500;
    color: #111;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #111;
}

/* ── Plan cards ───────────────────────────────────────────── */
.pr-plans {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pr-card {
    position: relative;
    display: block;
    background: #fff;
    border: 2px solid var(--pr-line);
    border-radius: 14px;
    padding: 16px;
    color: var(--pr-ink);
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    -webkit-tap-highlight-color: transparent;
}
.pr-card:hover, .pr-card:focus-within { border-color: var(--pr-brand); }
.pr-card:active { transform: scale(0.995); }
/* The whole card is the tap target: the CTA link's ::after covers it. */
.pr-stretch::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.pr-more { position: relative; z-index: 2; }

.pr-card--popular {
    border-color: var(--pr-popular);
    padding-top: 40px;
    box-shadow: 0 6px 22px rgba(246, 200, 81, 0.35);
}
.pr-ribbon {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: var(--pr-popular);
    color: #3b2f00;
    font-weight: 800;
    font-size: 0.85rem;
    text-align: center;
    padding: 6px;
    border-radius: 11px 11px 0 0;
}
.pr-card--basic { box-shadow: none; background: #fbfcfe; }

.pr-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.pr-name { font-size: 1.15rem; font-weight: 800; margin: 0; }
.pr-badge {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: #dcfce7;
    color: #166534;
}
.pr-badge--none { background: #f1f5f9; color: var(--pr-muted); }

.pr-price { margin: 8px 0 2px; line-height: 1.1; }
.pr-price strong { font-size: 2rem; font-weight: 800; }
.pr-price span { color: var(--pr-muted); font-size: 0.95rem; }
.pr-total { font-size: 0.9rem; color: var(--pr-muted); margin: 0 0 10px; }
.pr-total s { color: var(--pr-no); margin-left: 4px; }

.pr-features {
    list-style: none;
    margin: 0 0 12px;
    padding: 10px 0 0;
    border-top: 1px solid var(--pr-line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    font-size: 0.9rem;
}
.pr-features li { display: flex; align-items: center; gap: 6px; }
.pr-features .yes::before { content: "\2713"; color: var(--pr-ok); font-weight: 800; }
.pr-features .no { color: var(--pr-no); text-decoration: line-through; }
.pr-features .no::before { content: "\2715"; color: var(--pr-no); font-weight: 800; text-decoration: none; display: inline-block; }
.pr-features .pr-extra { display: none; }
.pr-card.is-open .pr-features .pr-extra { display: flex; }

.pr-more {
    background: none;
    border: 0;
    padding: 0;
    min-height: 44px;
    color: var(--pr-brand-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.pr-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    border-radius: 10px;
    background: var(--pr-ink);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
}
.pr-cta:hover { color: #fff; }
.pr-card--popular .pr-cta { background: var(--pr-brand); }

.pr-trust {
    margin: 20px 0 0;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--pr-line);
    font-size: 0.9rem;
    color: var(--pr-ink);
}
.pr-trust p { margin: 0 0 6px; }
.pr-trust p:last-child { margin: 0; }
.pr-trust i { color: var(--pr-ok); width: 18px; }

/* ── Checkout ─────────────────────────────────────────────── */
.co-wrap { max-width: 560px; }

.co-summary {
    background: #fff;
    border: 1px solid var(--pr-line);
    border-radius: 12px;
    margin-bottom: 14px;
}
.co-summary summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-height: 52px;
    cursor: pointer;
    font-weight: 700;
}
.co-summary summary::-webkit-details-marker { display: none; }
.co-summary summary .co-amt { font-size: 1.15rem; color: var(--pr-ink); white-space: nowrap; }
.co-summary summary .co-chev { transition: transform 0.2s; color: var(--pr-muted); }
.co-summary[open] summary .co-chev { transform: rotate(180deg); }
.co-summary dl { margin: 0; padding: 0 16px 12px; font-size: 0.92rem; }
.co-summary dl div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.co-summary dt { color: var(--pr-muted); font-weight: 500; }
.co-summary dd { margin: 0; font-weight: 600; text-align: right; }

.co-card {
    background: #fff;
    border: 1px solid var(--pr-line);
    border-radius: 12px;
    padding: 16px;
}

.co-label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 6px;
}
.co-hint { color: var(--pr-muted); font-size: 0.85rem; margin: 4px 0 0; }

/* 16px+ stops iOS Safari zooming into the field on focus */
.co-input {
    width: 100%;
    font-size: 16px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--pr-ink);
}
.co-input:focus { outline: none; border-color: var(--pr-brand); box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); }

.co-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--pr-muted);
    font-size: 0.85rem;
    margin: 16px 0;
}
.co-divider::before, .co-divider::after { content: ""; flex: 1; height: 1px; background: var(--pr-line); }

#express-checkout:empty + .co-divider { display: none; }

.co-section { margin-top: 16px; }

.co-error {
    display: none;
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.92rem;
}
.co-error.is-shown { display: block; }

.co-code-toggle {
    background: none;
    border: 0;
    padding: 0;
    min-height: 44px;
    color: var(--pr-brand-dark);
    font-weight: 600;
    text-decoration: underline;
}
.co-code { display: none; margin-top: 4px; }
.co-code.is-open { display: block; }
.co-code-row { display: flex; gap: 8px; }
.co-code-row .co-input { text-transform: uppercase; letter-spacing: 1px; }
.co-code-btn {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--pr-ink);
    color: #fff;
    font-weight: 700;
}

.co-trust {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    font-size: 0.9rem;
    color: var(--pr-ink);
}
.co-trust li { padding: 3px 0; }
.co-trust i { color: var(--pr-ok); width: 18px; }

/* Pay bar: sticky at the bottom on phones */
.co-paybar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 16px -16px 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(245, 247, 250, 0.96);
    border-top: 1px solid var(--pr-line);
    backdrop-filter: blur(6px);
}
.co-pay {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 10px;
    background: var(--pr-pay);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.co-pay:disabled { opacity: 0.6; }
.co-secure { text-align: center; color: var(--pr-muted); font-size: 0.8rem; margin: 6px 0 0; }

/* ── Redeem code / credits blocks (report + My Account) ───── */
.pr-codes {
    background: #fffbeb;
    border: 2px solid var(--pr-popular);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 16px 0;
    color: var(--pr-ink);
}
.pr-codes h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; }
.pr-codes p { font-size: 0.92rem; margin: 0 0 10px; }
.pr-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.pr-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: #fff;
    border: 1px dashed #b45309;
    border-radius: 8px;
    padding: 8px 12px;
}
.pr-code.is-used { text-decoration: line-through; color: var(--pr-muted); border-color: var(--pr-line); }
.pr-copy {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--pr-ink);
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
}

/* Locked Premium section inside a Basic report */
.pr-locked {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 16px 0;
}
.pr-locked-txt { flex: 1 1 220px; }
.pr-locked-txt strong { display: block; font-size: 1rem; color: var(--pr-ink); }
.pr-locked-txt span { font-size: 0.88rem; color: var(--pr-muted); }
.pr-locked .pr-cta { flex: 1 1 100%; background: var(--pr-brand); color: #fff; text-decoration: none; }

/* ── Tablet / desktop ─────────────────────────────────────── */
@media (min-width: 768px) {
    .pr-wrap { padding-top: 24px; }
    .pr-title { font-size: 1.75rem; }
    .pr-plans { flex-direction: row; align-items: stretch; gap: 18px; }
    .pr-card { flex: 1 1 0; padding: 20px; display: flex; flex-direction: column; }
    .pr-card--popular { padding-top: 46px; }
    .pr-card .pr-features { flex: 1; align-content: start; }
    .pr-features .pr-extra { display: flex; }
    .pr-more { display: none; }
    .pr-trust { display: flex; gap: 24px; justify-content: center; }
    .pr-trust p { margin: 0; }

    .co-paybar { position: static; margin: 16px 0 0; padding: 0; background: none; border: 0; backdrop-filter: none; }
    .pr-locked .pr-cta { flex: 0 0 auto; width: auto; padding: 0 20px; }
}
