/**
 * @file pricing-modal.css
 * @description Modal de pricing para usuários Free - Superchart
 *
 * Contém:
 *  - .pricing-overlay (backdrop do modal)
 *  - .pricing-modal (container principal)
 *  - .pricing-grid (grid de planos)
 *  - .pricing-card (card individual de plano)
 *  - .billing-toggle (switch monthly/yearly)
 *
 * Depende de: variables.css
 */

/* ── Pricing Overlay ────────────────────────────────────── */

.pricing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: pricingOverlayFadeIn 0.2s ease-out;
    box-sizing: border-box;
}

.pricing-overlay.open {
    display: flex;
}

@keyframes pricingOverlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Pricing Modal ─────────────────────────────────────── */

.pricing-modal {
    background: #0a0c0f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 1000px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    animation: pricingModalSlideUp 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes pricingModalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pricing-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pricing-modal-title {
    flex: 1;
}

.pricing-modal-title h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.pricing-modal-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
    max-width: 600px;
}

.pricing-modal-close {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.pricing-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

.pricing-modal-body {
    padding: 0 32px 40px 32px;
    background: transparent;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 280px);
}

/* ── Billing Toggle ────────────────────────────────────── */

.pricing-billing-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 15px;
    margin-top: 10px;
    justify-content: center;
    /* background: rgba(255, 255, 255, 0.02); */
    padding: 12px;
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    /* border: 1px solid rgba(255, 255, 255, 0.03); */
}

.pricing-billing-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

.pricing-billing-label.active {
    color: #ffffff;
    font-weight: 600;
}

/* Clean, consistent toggle/switch */
.pricing-switch {
    width: 44px;
    height: 24px;
    background: #1a1d23;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
    display: inline-block;
    box-sizing: border-box;
}

.pricing-switch:active { transform: scale(0.995); }

.pricing-switch.active {
    background: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 75%, rgba(255,255,255,0.05));
}

.pricing-switch-thumb {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: left 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.12s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.pricing-switch.active .pricing-switch-thumb {
    left: 23px;
    box-shadow: 0 4px 10px rgba(43,127,255,0.18);
}

.pricing-billing-discount {
    font-size: 12px;
    color: var(--ok);
    font-weight: 600;
    background: rgba(54, 211, 153, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

/* ── Pricing Grid ──────────────────────────────────────── */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding: 24px 20px;
    min-width: 0;
}

@media (max-width: 900px) {
    .pricing-grid {
    overflow: hidden; /* ensure rounded corners clip inner elements */
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ── Pricing Card ──────────────────────────────────────── */

.pricing-card {
    background: #111418;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* enforce consistent rounding and clipping for all cards */
.pricing-card,
.pricing-card.featured,
.pricing-card[data-plan="enterprise"] {
    border-radius: 12px;
    -webkit-border-radius: 12px;
    box-sizing: border-box;
    background-clip: padding-box;
}

.pricing-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: #161a20;
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Featured (Pro) */
.pricing-card.featured {
    border: 1px solid var(--accent);
    background: linear-gradient(180deg, rgba(43, 127, 255, 0.08) 0%, rgba(43, 127, 255, 0.02) 100%);
    box-shadow: 0 10px 30px rgba(43, 127, 255, 0.1);
}

/* Maxi (Trial) */
.pricing-card.featured.trial {
    border-color: rgba(255, 183, 77, 0.5);
    background: linear-gradient(180deg, rgba(255, 183, 77, 0.08) 0%, rgba(255, 183, 77, 0.02) 100%);
    box-shadow: 0 10px 30px rgba(255, 183, 77, 0.05);
}

/* Enterprise (Black Platinum) */
.pricing-card[data-plan="enterprise"] {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(180deg, #1a1d23 0%, #0a0c0f 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.pricing-card[data-plan="enterprise"]:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(180deg, #1e2229 0%, #0d0f14 100%);
}

/* removed complex ::after mask to avoid double borders and inconsistent rounding */

@media (max-width: 900px) {
    .pricing-card.featured {
        transform: scale(1);
    }
}

.pricing-card-badge {
    position: absolute;
    top: -12px;
    left: 24px;
    background: var(--accent);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(43, 127, 255, 0.3);
    z-index: 2;
}

.pricing-card-badge-trial {
    background: #ffb74d;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 183, 77, 0.3);
}

.pricing-card-header {
    margin-bottom: 20px;
}

.pricing-card-name {
    margin: 0 0 12px 0;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.pricing-card-price {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1;
    display: inline-block;
}

.pricing-card-period {
    font-size: 15px;
    color: var(--muted);
    margin: 0px;
    display: inline-block;
}

/* Colors by plan */
.pricing-card.featured .pricing-card-name {
    color: var(--accent);
}

.pricing-card.featured.trial .pricing-card-name {
    color: #ffb74d;
}

.pricing-card[data-plan="enterprise"] .pricing-card-name {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.pricing-card[data-plan="enterprise"] .pricing-card-price {
    background: linear-gradient(180deg, #ffffff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Features List ─────────────────────────────────────── */

.pricing-features {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    flex: 1;
}

.pricing-feature {
    font-size: 13px;
    color: #b0b3b8;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 12px;
}

.pricing-feature:last-child {
    border-bottom: none;
}

.pricing-feature::before {
    content: '✓';
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.pricing-card.featured.trial .pricing-feature::before {
    color: #ffb74d;
}

.pricing-card[data-plan="enterprise"] .pricing-feature::before {
    color: #ffffff;
}

/* ── Pricing CTA ────────────────────────────────────────── */

.pricing-cta {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    text-align: center;
}

.pricing-cta:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Pro CTA */
.pricing-card.featured .pricing-cta {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(43, 127, 255, 0.2);
}

.pricing-card.featured .pricing-cta:hover {
    background: #1a6ff2;
    box-shadow: 0 10px 24px rgba(43, 127, 255, 0.35);
}

/* Maxi CTA */
.pricing-card.featured.trial .pricing-cta {
    background: #ffb74d;
    color: #000;
    border-color: #ffb74d;
    box-shadow: 0 8px 20px rgba(255, 183, 77, 0.2);
}

.pricing-card.featured.trial .pricing-cta:hover {
    background: #ffa726;
    box-shadow: 0 10px 24px rgba(255, 183, 77, 0.35);
}

/* Enterprise CTA - Black Platinum */
.pricing-card[data-plan="enterprise"] .pricing-cta {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.pricing-card[data-plan="enterprise"] .pricing-cta:hover {
    background: #f0f0f0;
    box-shadow: 0 10px 24px rgba(255, 255, 255, 0.2);
}

/* ── Modal Footer ──────────────────────────────────────── */

.pricing-modal-footer {
    padding: 24px 32px;
    background: #07080a;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}

.pricing-footer-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pricing-footer-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.02);
}

.pricing-footer-btn.primary {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.pricing-footer-btn.primary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 640px) {
    .pricing-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .pricing-modal {
        width: 100%;
        max-width: calc(100vw - 20px);
        border-radius: 14px 14px 0 0;
        max-height: calc(100vh - 20px);
    }

    .pricing-modal-header {
        padding: 14px 16px;
        align-items: flex-start;
        gap: 12px;
    }

    .pricing-modal-title h2 {
        font-size: 18px;
        line-height: 1.15;
    }

    .pricing-modal-subtitle {
        font-size: 13px;
    }

    .pricing-billing-toggle {
        gap: 8px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .pricing-billing-label {
        font-size: 12px;
    }

    .pricing-modal-body {
        padding: 16px;
        max-height: calc(100vh - 160px);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .pricing-card {
        padding: 16px;
        border-radius: 12px;
    }

    .pricing-card.featured {
        transform: none;
    }

    .pricing-card-badge {
        left: 14px;
        top: -9px;
        font-size: 10px;
        padding: 3px 7px;
    }

    .pricing-card-header {
        margin-bottom: 16px;
        padding-top: 8px;
    }

    .pricing-card-name {
        font-size: 13px;
    }

    .pricing-card-price {
        font-size: 24px;
    }

    .pricing-feature {
        padding: 7px 0;
        font-size: 12px;
    }

    .pricing-modal-footer {
        padding: 12px 16px 16px;
        flex-direction: column;
    }

    .pricing-footer-btn {
        padding: 11px 14px;
        font-size: 13px;
    }

    .pricing-card.featured.trial .pricing-cta {
        box-shadow: 0 10px 24px rgba(255, 143, 31, 0.16);
    }

    .pricing-cta {
        padding: 11px 14px;
        font-size: 12px;
    }

    .pricing-modal-close {
        font-size: 20px;
    }
}

@media (max-width: 420px) {
    .pricing-overlay {
        padding: 6px;
    }

    .pricing-modal {
        width: 100%;
        max-width: calc(100vw - 12px);
        border-radius: 12px 12px 0 0;
    }

    .pricing-modal-header {
        padding: 12px 14px;
    }

    .pricing-modal-body {
        padding: 14px;
    }

    .pricing-modal-footer {
        padding: 10px 14px 14px;
    }

    .pricing-billing-toggle {
        justify-content: flex-start;
    }

    .pricing-card {
        padding: 14px;
    }

    .pricing-card-price {
        font-size: 22px;
    }

    .pricing-feature {
        font-size: 11px;
    }
}
