/* frontend/static/css/pricing.css */
:root {
    --bg: #0c1722;
    --panel: #101f2d;
    --surface: #142636;
    --surface-2: #162a3d;
    --line: #263a4d;
    --line-2: #2e465d;
    --text: #e6edf3;
    --muted: #9aafc0;
    --accent: #7da9d6;
}

:root[data-theme="light"] {
    --bg: #edf3f8;
    --panel: #f8fbff;
    --surface: #f1f7fd;
    --surface-2: #eaf2fa;
    --line: #c4d3e1;
    --line-2: #adc1d4;
    --text: #162433;
    --muted: #4d6276;
    --accent: #4f7daa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.page-shell {
    width: min(900px, calc(100vw - 32px));
    margin: 40px auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
    margin-bottom: 32px;
}

.brand img {
    /* CLS: keep stable logo slot before image decode. */
    width: 131px;
    height: 28px;
}

.top-links {
    display: flex;
    gap: 8px;
}

.pill-link {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    padding: 6px 14px;
    font-size: 13px;
    text-decoration: none;
}

.pill-link.active {
    color: var(--text);
    border-color: var(--accent);
}

.hero {
    text-align: center;
    margin-bottom: 26px;
}

.hero h1 {
    font-size: 24px;
    margin: 0 0 12px;
}

.hero p {
    color: var(--muted);
    font-size: 14px;
    max-width: 540px;
    margin: 0 auto 18px;
}

.hero-subnote {
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 12px;
    max-width: 620px;
}

.billing-toggle-container {
    display: flex;
    justify-content: center;
}

.billing-toggle {
    display: flex;
    background: var(--surface);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.billing-toggle input {
    display: none;
}

.billing-toggle label {
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--muted);
    /* Perf: avoid "transition: all" to reduce unnecessary style/layout work. */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.billing-toggle input:checked+label {
    background: var(--line);
    color: var(--text);
}

.section-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mini-note {
    font-size: 12px;
    color: var(--muted);
}

.mini-pill {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.account-status {
    margin: 0 0 22px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 18px;
    /* CLS: reserve vertical room for async account status updates. */
    min-height: 172px;
}

.account-status h2 {
    margin: 0;
    font-size: 18px;
}

.status-message {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.status-grid {
    margin: 14px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.status-item dt {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.status-item dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 34px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.card.is-current {
    border-color: rgba(125, 169, 214, 0.7);
    box-shadow: inset 0 0 0 1px rgba(125, 169, 214, 0.28);
}

.pro-card {
    border-color: var(--accent);
    background: var(--surface-2);
}

.card-header {
    margin-bottom: 16px;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.plan-name {
    display: block;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

.tag-accent {
    border-color: rgba(125, 169, 214, 0.65);
    color: var(--text);
    background: rgba(125, 169, 214, 0.12);
}

.tag-pro {
    border-color: rgba(125, 169, 214, 0.65);
    color: var(--text);
    background: rgba(125, 169, 214, 0.12);
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.amount {
    font-size: 32px;
    font-weight: 600;
}

.currency {
    font-size: 18px;
    color: var(--muted);
}

.billing-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.billing-subnote {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.plan-features li {
    font-size: 14px;
    color: var(--muted);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.plan-features strong {
    color: var(--text);
    font-weight: 600;
}

.btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-size: 14px;
}

.btn-muted {
    background: var(--panel);
    color: var(--text);
}

.btn-muted:hover:not(:disabled) {
    background: var(--line);
}

.btn-accent {
    background: var(--accent);
    color: var(--bg);
    border: none;
}

.btn-accent:hover {
    opacity: 0.92;
}

.btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.fineprint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.comparison-section {
    margin-top: 28px;
}

.addons-section {
    margin-top: 28px;
}

.history-section {
    margin-top: 22px;
}

.section-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.table-container {
    margin-top: 10px;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 620px;
}

.comparison-table th {
    text-align: center;
    padding: 12px;
    color: var(--text);
    font-weight: 700;
    border-bottom: 1px solid var(--line);
}

.comparison-table th:first-child {
    text-align: left;
}

.comparison-table td {
    padding: 12px;
    text-align: center;
    color: var(--muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-table td:first-child {
    text-align: left;
    color: var(--text);
}

.table-footnote {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.addons-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.addon-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 16px;
    display: grid;
    gap: 12px;
}

.addon-head h3 {
    margin: 0;
    font-size: 16px;
}

.addon-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.pack-list {
    display: grid;
    gap: 8px;
}

.pack-btn {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-weight: 700;
}

.pack-btn span {
    font-weight: 600;
    color: var(--muted);
}

.pack-btn:hover {
    background: rgba(125, 169, 214, 0.10);
    border-color: rgba(125, 169, 214, 0.55);
}

.legal-footer {
    margin-top: 42px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.disclaimers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}

.disclaimers p {
    margin: 0;
}

.legal-footer a {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 860px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .addons-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-shell {
        margin: 10px auto;
        padding: 16px;
    }

    .legal-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
