/**
 * AI Wallet section
 * AI credit pricing: free trial, spend estimator and cost tables.
 */

/* The site's cards use a barely-there light edge and lean on the shadow for
   definition. --card-border goes black in the light theme, so it is avoided
   here in favour of these two local tokens. */
.ai-wallet-section {
    --wallet-edge: rgba(255, 252, 252, 0.1);
    --wallet-rule: rgba(255, 255, 255, 0.12);
    /* Controls still need a readable outline, unlike card edges. */
    --wallet-control: rgba(255, 255, 255, 0.28);
}

[data-theme="light"] .ai-wallet-section {
    --wallet-edge: rgba(255, 255, 255, 0.6);
    --wallet-rule: rgba(0, 0, 0, 0.07);
    --wallet-control: rgba(0, 0, 0, 0.16);
}

.ai-wallet-section {
    padding: 80px 20px;
    position: relative;
    z-index: 1;
}

.wallet-header {
    max-width: 980px;
    margin: 0 auto 48px;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 28px;
    align-items: center;
}

.wallet-header-art {
    width: 150px;
    aspect-ratio: 1 / 1;
}

.wallet-header-art canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.wallet-eyebrow {
    display: inline-block;
    font-family: var(--font-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-color);
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--lightfilled-btn);
    margin-bottom: 14px;
}

.wallet-title {
    font-family: var(--font-primary);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: var(--text-color);
    margin: 0 0 16px;
    line-height: 1.3;
}

.wallet-subtitle {
    font-family: var(--font-secondary);
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--secondary-text-color);
    line-height: 1.7;
    margin: 0;
}

.wallet-subtitle strong {
    color: var(--text-color);
    font-weight: 600;
}

#ai-wallet-mount {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ---------------------------------------------------------------- *
 * Free trial banner
 * ---------------------------------------------------------------- */

.wallet-trial {
    background: var(--card-background);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border: 1px solid var(--wallet-edge);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    padding: 36px 28px;
    text-align: center;
}

.wallet-trial-badge {
    display: inline-block;
    font-family: var(--font-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--lightfilled-btn);
    color: var(--text-color);
    margin-bottom: 16px;
}

.wallet-trial-title {
    font-family: var(--font-primary);
    font-size: clamp(1.5rem, 5.5vw, 2.8rem);
    color: var(--text-color);
    margin: 0 0 10px;
    line-height: 1.25;
    text-wrap: balance;
}

/* "FREE" is the word people scan for, so it carries the brand gradient.
   Same size as the rest of the line - only the colour sets it apart. */
.wallet-trial-free {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.wallet-trial-worth {
    font-family: var(--font-secondary);
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 500;
    color: var(--secondary-text-color);
    margin: 0 0 14px;
}

.wallet-trial-sub {
    font-family: var(--font-secondary);
    font-size: clamp(0.88rem, 2vw, 1rem);
    color: var(--text-color);
    line-height: 1.7;
    margin: 0 auto 10px;
    max-width: 620px;
}

.wallet-trial-note {
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    margin: 0;
}

.wallet-topup {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--wallet-rule);
}

.wallet-topup-line {
    display: block;
    font-family: var(--font-primary);
    font-size: clamp(1.05rem, 3vw, 1.6rem);
    color: var(--text-color);
    line-height: 1.45;
    max-width: 640px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------- *
 * Blocks
 * ---------------------------------------------------------------- */

.wallet-block {
    background: var(--card-background);
    backdrop-filter: var(--card-blur);
    -webkit-backdrop-filter: var(--card-blur);
    border: 1px solid var(--wallet-edge);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    padding: 28px 24px;
}

.wallet-block-title {
    font-family: var(--font-primary);
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    color: var(--text-color);
    margin: 0 0 10px;
    line-height: 1.4;
}

.wallet-block-sub {
    font-family: var(--font-secondary);
    font-size: 0.88rem;
    color: var(--secondary-text-color);
    line-height: 1.65;
    margin: 0 0 22px;
}

/* ---------------------------------------------------------------- *
 * Tables
 * ---------------------------------------------------------------- */

.wallet-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wallet-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-secondary);
    min-width: 480px;
}

.wallet-table thead th {
    text-align: left;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--secondary-text-color);
    font-weight: 600;
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--wallet-rule);
    white-space: nowrap;
}

.wallet-table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--wallet-rule);
    color: var(--text-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.wallet-table tbody tr:last-child td {
    border-bottom: none;
}

.wallet-cell-what {
    min-width: 240px;
}

.wallet-action-title {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.wallet-action-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    line-height: 1.55;
}

.wallet-cell-credits,
.wallet-cell-money {
    white-space: nowrap;
}

.wallet-cell-credits strong {
    font-size: 1.05rem;
    color: var(--text-color);
}

.wallet-cell-money {
    color: var(--secondary-text-color);
}

.wallet-free-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--lightfilled-btn);
    color: var(--text-color);
    font-size: 0.78rem;
    font-weight: 600;
}

.wallet-muted {
    color: var(--secondary-text-color);
    font-size: 0.8rem;
}

.wallet-table-compact tbody td {
    padding: 12px 16px;
}

.wallet-table-compact strong {
    font-size: 1rem;
    color: var(--text-color);
}

/* ---------------------------------------------------------------- *
 * Estimator
 * ---------------------------------------------------------------- */

.wallet-estimator-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 28px;
    align-items: start;
}

.wallet-sliders {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.wallet-slider-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-slider-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.wallet-slider-head label {
    font-family: var(--font-secondary);
    font-size: 0.86rem;
    color: var(--text-color);
}

.wallet-slider-value {
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    min-width: 2.5ch;
    text-align: right;
}

/* Range input, restyled consistently across browsers. */
.wallet-slider {
    --wallet-fill: 30%;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        #4a76ef 0%,
        #4a76ef var(--wallet-fill),
        var(--card-bg) var(--wallet-fill),
        var(--card-bg) 100%
    );
    outline: none;
    cursor: pointer;
}

.wallet-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #4a76ef;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.wallet-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #4a76ef;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.wallet-slider:focus-visible {
    box-shadow: 0 0 0 3px rgba(74, 118, 239, 0.4);
}

.wallet-length-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--wallet-rule);
}

.wallet-length-label {
    font-family: var(--font-secondary);
    font-size: 0.86rem;
    color: var(--text-color);
    padding-top: 8px;
}

.wallet-length-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wallet-length-btn {
    font-family: var(--font-secondary);
    font-size: 0.82rem;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--wallet-control);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wallet-length-btn:hover {
    border-color: #4a76ef;
}

.wallet-length-btn.is-active {
    background: var(--lightfilled-btn);
    border-color: #4a76ef;
    font-weight: 600;
}

/* Result panel */
.wallet-result {
    background: var(--card-bg);
    border: 1px solid var(--wallet-edge);
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    position: sticky;
    top: 100px;
}

.wallet-result-line {
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    color: var(--secondary-text-color);
}

.wallet-result-credits {
    font-family: var(--font-primary);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: var(--text-color);
    margin: 6px 0 12px;
    line-height: 1.3;
}

.wallet-result-money {
    font-family: var(--font-primary);
    font-size: clamp(1.6rem, 4.5vw, 2.3rem);
    color: var(--text-color);
    margin: 6px 0 14px;
    line-height: 1.2;
}

.wallet-result-foot {
    font-family: var(--font-secondary);
    font-size: 0.78rem;
    color: var(--secondary-text-color);
    padding-top: 12px;
    border-top: 1px solid var(--wallet-rule);
}

.wallet-result-suggest {
    font-family: var(--font-secondary);
    font-size: 0.84rem;
    color: var(--text-color);
    line-height: 1.55;
    margin-top: 14px;
}

.wallet-result-suggest:empty {
    margin-top: 0;
}

.wallet-suggest-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary-text-color);
    margin-top: 4px;
}

/* ---------------------------------------------------------------- *
 * Footnote
 * ---------------------------------------------------------------- */

.wallet-footnote {
    max-width: 760px;
    margin: 32px auto 0;
    font-family: var(--font-secondary);
    font-size: 0.78rem;
    color: var(--secondary-text-color);
    line-height: 1.7;
    text-align: center;
}

/* ---------------------------------------------------------------- *
 * Responsive
 * ---------------------------------------------------------------- */

@media (max-width: 860px) {
    .wallet-header {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .wallet-header-art {
        width: 120px;
    }

    .wallet-estimator-grid {
        grid-template-columns: 1fr;
    }

    .wallet-result {
        position: static;
    }
}

@media (max-width: 560px) {
    .ai-wallet-section {
        padding: 56px 16px;
    }

    .wallet-block,
    .wallet-trial {
        padding: 24px 18px;
    }
}

