/*
 * SIL Connect — pricing screens.
 *
 * Linked per-page (pricing.blade.php, digitalmarketingPricing.blade.php), NOT
 * from assets/styleLink — class names here like .popup-wrapper and .promo-banner
 * are generic enough to collide if loaded site-wide.
 *
 * Brand tokens come from auth-modern.css, which styleLink loads first on every
 * page. Fallbacks are inlined so this file still renders correctly on its own.
 *
 * Markup contract: the plan cards are rendered from a DB @foreach and the
 * Monthly/Yearly switch is a Bootstrap pill nav — `.toggle-btn.active` is
 * toggled by both Bootstrap and the page's own jQuery. Don't rename these.
 */

:root {
    --price-purple: var(--auth-purple, #431657);
    --price-purple-deep: var(--auth-purple-deep, #2d0f3a);
    --price-purple-lift: var(--auth-purple-lift, #5a2072);
    --price-green: var(--auth-green, #3ba23f);
    --price-ink: var(--auth-ink, #1d1b22);
    --price-body: var(--auth-body, #55505f);
    --price-muted: var(--auth-muted, #86808f);
    --price-line: var(--auth-line, #e9e5ee);
    --price-radius: 22px;
    --price-ease: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================
   HERO
   ========================================================== */
.pricing-hero {
    position: relative;
    padding: 92px 0 64px;
    text-align: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(67, 22, 87, 0.12) 0%, transparent 48%),
        radial-gradient(circle at 85% 15%, rgba(59, 162, 63, 0.10) 0%, transparent 44%),
        linear-gradient(180deg, #fbf9fc 0%, #f2eff6 100%);
}

/* Deep bottom pad for pages that pull a card back up into the hero
   (pricing.blade.php's .free-trial-banner). The card has to land inside the
   tinted band rather than straddling its edge. digitalmarketingPricing.blade.php
   has no such card, so it keeps the base padding. */
.pricing-hero.has-overlap-card { padding-bottom: 132px; }

/* Soft seam so the band does not cut a hard line across the page */
.pricing-hero::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 90px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 100%);
    pointer-events: none;
}

.membership-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    margin-bottom: 22px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--price-purple);
    background: rgba(67, 22, 87, 0.07);
    border: 1px solid rgba(67, 22, 87, 0.14);
    border-radius: 999px;
}

.pricing-hero h1 {
    max-width: 760px;
    margin: 0 auto 16px;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -1.6px;
    color: var(--price-purple);
}

.pricing-hero p {
    max-width: 780px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--price-body);
}

/* ==========================================================
   FREE TRIAL BANNER
   ========================================================== */
.free-trial-banner {
    position: relative;
    z-index: 1;
    margin: -76px auto 52px;
    background: #fff;
    border: 1px solid var(--price-line);
    border-radius: var(--price-radius);
    box-shadow: 0 24px 60px -30px rgba(45, 15, 58, 0.28);
    overflow: hidden;
}

.trial-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 32px;
    font-size: 1.12rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--price-purple-lift) 0%, var(--price-purple-deep) 100%);
}

.trial-icon { font-size: 1.3rem; }

.trial-body { padding: 28px 32px 30px; }

.trial-body p {
    margin-bottom: 14px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--price-body);
}

.trial-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.trial-features span {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--price-ink);
}

.trial-features i {
    margin-top: 3px;
    color: var(--price-green);
}

/* ==========================================================
   PROMO BANNER
   ========================================================== */
.promo-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 640px;
    margin: 0 auto 34px;
    padding: 13px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    color: #7a4a06;
    background: linear-gradient(135deg, #fff5dc 0%, #ffeab8 100%);
    border: 1px solid #f3d99a;
    border-radius: 999px;
}

.promo-banner i { color: #d99b12; }

/* ==========================================================
   CATEGORY TABS
   ========================================================== */
.plan-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;

    /* Spacing is owned here, not by the .mb-5 utility in the markup: the
       active chip casts a 22px drop shadow, and with the utility alone the
       billing switch below ended up sitting in it. !important because .mb-5
       is itself an !important utility. */
    margin-bottom: 36px !important;
    padding-bottom: 4px;
}

.category-tab {
    padding: 11px 22px;
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--price-body);
    text-decoration: none;
    background: #fff;
    border: 1.5px solid var(--price-line);
    border-radius: 999px;
    transition: var(--price-ease);
}

.category-tab:hover {
    color: var(--price-purple);
    border-color: rgba(67, 22, 87, 0.35);
    transform: translateY(-1px);
}

.category-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--price-purple-lift) 0%, var(--price-purple-deep) 100%);
    border-color: transparent;
    box-shadow: 0 10px 22px -10px rgba(67, 22, 87, 0.55);
}

/* ==========================================================
   MONTHLY / YEARLY TOGGLE
   ========================================================== */
.billing-toggle {
    position: relative;   /* keeps the switch in flow and above the chip shadow */
    z-index: 1;
    display: flex;
    justify-content: center;
    margin: 0 0 40px;
}

.toggle-container {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    background: #efecf3;
    border-radius: 999px;
}

/* .nav-link is also on these buttons — override Bootstrap's padding/colour. */
.toggle-container .toggle-btn {
    padding: 10px 30px !important;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--price-body) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 999px !important;
    cursor: pointer;
    transition: var(--price-ease);
}

.toggle-container .toggle-btn:hover { color: var(--price-purple) !important; }

.toggle-container .toggle-btn.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--price-purple-lift) 0%, var(--price-purple-deep) 100%) !important;
    box-shadow: 0 8px 18px -8px rgba(67, 22, 87, 0.55);
}

/* ==========================================================
   PLAN CARDS
   ========================================================== */
.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 34px 30px 30px;
    background: #fff;
    border: 1.5px solid var(--price-line);
    border-radius: var(--price-radius);
    box-shadow: 0 18px 44px -28px rgba(45, 15, 58, 0.22);
    transition: var(--price-ease);
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: rgba(67, 22, 87, 0.22);
    box-shadow: 0 30px 60px -30px rgba(45, 15, 58, 0.35);
}

/* Highlighted plan */
.pricing-card.popular {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--price-purple), 0 34px 70px -28px rgba(45, 15, 58, 0.45);
}

/* Accent rail along the top edge of the highlighted plan */
.pricing-card.popular::before {
    content: "";
    position: absolute;
    top: 0;
    right: 22px;
    left: 22px;
    height: 4px;
    background: linear-gradient(90deg, var(--price-purple-lift) 0%, var(--price-green) 100%);
    border-radius: 0 0 4px 4px;
}

/* Lift the recommended plan above its neighbours on wide screens only --
   below that the cards stack and a scaled card just looks misaligned. */
@media (min-width: 992px) {
    .pricing-card.popular { transform: translateY(-10px) scale(1.02); }
    .pricing-card.popular:hover { transform: translateY(-14px) scale(1.02); }
}

.popular-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 7px 18px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(135deg, var(--price-purple-lift) 0%, var(--price-purple-deep) 100%);
    border-radius: 999px;
    box-shadow: 0 8px 18px -8px rgba(67, 22, 87, 0.6);
}

.card-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    font-size: 1.25rem;
    color: var(--price-purple);
    background: linear-gradient(135deg, #f3edf8 0%, #eae2f2 100%);
    border-radius: 15px;
}

.pricing-card.popular .card-icon-box {
    color: #fff;
    background: linear-gradient(135deg, var(--price-purple-lift) 0%, var(--price-purple-deep) 100%);
    box-shadow: 0 8px 18px -8px rgba(67, 22, 87, 0.55);
}

.pricing-card h3 {
    margin-bottom: 8px;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--price-ink);
}

.pricing-card p {
    margin-bottom: 22px;
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--price-muted);
}

/* ---- Price ---- */
.card-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.price-amount {
    font-size: 2.7rem;
    font-weight: 800;
    letter-spacing: -1.6px;
    line-height: 1.1;
    color: var(--price-purple);
}

.price-period {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--price-muted);
}

.old-price {
    font-size: 1.05rem;
    font-weight: 600;
    color: #a8a2b2;
    text-decoration: line-through;
}

.save-badge,
.save-badge-inline {
    padding: 4px 11px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #1d7a35;
    background: #e6f5e9;
    border: 1px solid #bfe5c8;
    border-radius: 999px;
}

.card-divider {
    height: 1px;
    margin: 24px 0 20px;
    background: var(--price-line);
}

/* ---- Feature list ---- */
.features-label {
    display: block;
    margin-bottom: 14px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--price-muted);
}

.card-features {
    flex: 1 1 auto;      /* pushes the button to a common baseline */
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
}

.card-features li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 12px;
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--price-body);
}

.check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    font-size: 10px;
    color: #1d7a35;
    background: #e6f5e9;
    border-radius: 50%;
}

/* ---- CTA ---- */
.btn-subscribe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 52px;
    margin-top: auto;
    font-size: 15px;
    font-weight: 700;
    color: var(--price-purple);
    text-decoration: none;
    background: #fff;
    border: 1.5px solid var(--price-purple);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--price-ease);
}

.btn-subscribe:hover {
    color: #fff;
    background: var(--price-purple);
    transform: translateY(-2px);
}

.btn-subscribe.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--price-purple-lift) 0%, var(--price-purple-deep) 100%);
    border-color: transparent;
    box-shadow: 0 12px 26px -10px rgba(67, 22, 87, 0.55);
}

.btn-subscribe.primary:hover {
    color: #fff;
    box-shadow: 0 18px 34px -12px rgba(67, 22, 87, 0.6);
}

/* ==========================================================
   AFTER SUBSCRIBING
   ========================================================== */
.after-sub-box {
    margin-top: 22px;
    padding: 30px 32px;
    background: #fff;
    border: 1px solid var(--price-line);
    border-radius: var(--price-radius);
    box-shadow: 0 18px 44px -30px rgba(45, 15, 58, 0.22);
}

.after-sub-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--price-ink);
}

.after-sub-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.after-sub-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 22px;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--price-purple);
    text-decoration: none;
    background: rgba(67, 22, 87, 0.05);
    border: 1.5px solid rgba(67, 22, 87, 0.16);
    border-radius: 12px;
    transition: var(--price-ease);
}

.after-sub-link:hover {
    color: #fff;
    background: var(--price-purple);
    border-color: transparent;
    transform: translateY(-2px);
}

/* ==========================================================
   CTA BANNER
   ========================================================== */
.cta-banner.premium-cta {
    /* This used to blend a patern.png overlay, but that file has never existed
       in public/images — the gradient alone was all that ever rendered. */
    background-color: var(--price-purple-deep);
    background-image: linear-gradient(135deg, #511874 0%, #2e0b44 100%);
    border: none;
    box-shadow: 0 24px 56px -26px rgba(46, 11, 68, 0.55);
}

.cta-banner.premium-cta .cta-title {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -1.1px;
    color: #fff;
}

.cta-banner.premium-cta .cta-text {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
}

.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 14px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: var(--price-ease);
}

.btn-glass:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-white-premium {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    color: var(--price-purple);
    text-decoration: none;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.45);
    transition: var(--price-ease);
}

.btn-white-premium:hover {
    color: var(--price-purple-deep);
    transform: translateY(-2px);
}

/* ==========================================================
   SUCCESS POPUP
   ==========================================================
   Display is driven inline by the page's JS (none <-> flex); this file must
   only describe how it looks once shown. */
.popup-wrapper {
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(29, 27, 34, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.popup-content {
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.5);
}

.popup-top-half {
    padding: 34px 28px 28px;
    text-align: center;
    background: linear-gradient(135deg, var(--price-purple-lift) 0%, var(--price-purple-deep) 100%);
}

.popup-icon-wrapper { margin-bottom: 14px; }

.popup-icon {
    width: 68px;
    height: 68px;
    fill: #7fd483;
}

.popup-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    color: #fff;
}

.popup-bottom-half { padding: 26px 28px 28px; }

.popup-bottom-half p {
    margin-bottom: 18px;
    font-size: 0.98rem;
    text-align: center;
    color: var(--price-body);
}

.popup-bottom-half .ud-btn {
    width: 100%;
    justify-content: center;
    border-radius: 12px !important;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 991.98px) {
    .pricing-hero { padding: 64px 0 48px; }
    .pricing-hero.has-overlap-card { padding-bottom: 108px; }
    .pricing-hero h1 { font-size: 2.3rem; }
    .free-trial-banner { margin: -66px auto 44px; }
    .cta-banner.premium-cta .cta-title { font-size: 1.8rem; }
}

/* ==========================================================
   MOBILE -- app shell
   ==========================================================
   Below 768px the page stops behaving like a web page: full-bleed panels,
   a segmented control instead of pills, snap-scrolling category chips, list
   rows with chevrons, and a bottom-sheet success modal. Everything sits clear
   of the floating tab bar from assets/mobile-footer-nav.blade.php.
   ========================================================== */
@media (max-width: 767.98px) {
    /* ---- Hero ---- */
    .pricing-hero { padding: 34px 0 40px; }
    .pricing-hero.has-overlap-card { padding-bottom: 88px; }

    .pricing-hero h1 {
        font-size: 1.95rem;
        letter-spacing: -1px;
    }

    .pricing-hero p {
        font-size: 0.96rem;
        line-height: 1.62;
    }

    .membership-badge {
        margin-bottom: 16px;
        padding: 7px 15px;
        font-size: 11.5px;
    }

    .pricing-hero::after { height: 60px; }

    /* ---- Trial card ---- */
    .free-trial-banner {
        margin: -62px auto 32px;
        border-radius: 20px;
    }

    .trial-header {
        padding: 16px 20px;
        font-size: 1rem;
    }

    .trial-body { padding: 20px 20px 22px; }

    .trial-body p {
        font-size: 0.94rem;
        line-height: 1.62;
    }

    .trial-features { gap: 11px; }
    .trial-features span { font-size: 0.9rem; }

    .promo-banner {
        margin-bottom: 26px;
        padding: 11px 18px;
        font-size: 0.86rem;
        line-height: 1.4;
    }

    /* ---- Category chips: swipeable rail, edge-to-edge ----
       Negative margins let the rail bleed past the container so chips scroll
       off the screen edge instead of stopping short of it, the way a native
       segmented rail does. */
    .plan-categories {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        margin: 0 -12px 24px !important;
        padding: 2px 12px 8px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .plan-categories::-webkit-scrollbar { display: none; }

    .category-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
        padding: 10px 16px;
        font-size: 0.85rem;
        border-width: 1px;
    }

    .category-tab:hover { transform: none; }   /* no hover state on touch */

    /* ---- Billing switch: iOS-style segmented control ---- */
    .billing-toggle { margin-bottom: 26px; }

    .toggle-container {
        display: flex;
        width: 100%;
        gap: 0;
        padding: 4px;
        background: #efecf3;
        border-radius: 14px;
    }

    .toggle-container .toggle-btn {
        flex: 1 1 0;
        padding: 11px 8px !important;
        font-size: 0.92rem;
        border-radius: 11px !important;
    }

    .toggle-container .toggle-btn.active {
        background: #fff !important;
        color: var(--price-purple) !important;
        box-shadow: 0 2px 6px rgba(45, 15, 58, 0.16);
    }

    /* ---- Plan cards: full-width panels with press feedback ---- */
    .pricing-card {
        padding: 26px 20px 22px;
        border-radius: 20px;
        box-shadow: 0 10px 30px -18px rgba(45, 15, 58, 0.3);
        transition: transform 0.18s ease;
    }

    .pricing-card:hover { transform: none; }
    .pricing-card:active { transform: scale(0.99); }

    .pricing-card.popular { margin-top: 14px; }
    .pricing-card.popular::before { right: 18px; left: 18px; }

    .card-icon-box {
        width: 44px;
        height: 44px;
        margin-bottom: 16px;
        font-size: 1.05rem;
        border-radius: 13px;
    }

    .pricing-card h3 { font-size: 1.2rem; }

    .pricing-card p {
        margin-bottom: 18px;
        font-size: 0.9rem;
    }

    .price-amount { font-size: 2.4rem; }

    .card-divider { margin: 20px 0 16px; }

    .card-features li {
        margin-bottom: 11px;
        font-size: 0.91rem;
    }

    /* 50px clears the 44px minimum comfortably for a primary action */
    .btn-subscribe {
        height: 50px;
        font-size: 15px;
        border-radius: 13px;
    }

    .btn-subscribe:hover { transform: none; }
    .btn-subscribe:active { transform: scale(0.985); }

    /* ---- After subscribing: app list rows ---- */
    .after-sub-box {
        padding: 20px 18px;
        border-radius: 20px;
    }

    .after-sub-title {
        margin-bottom: 14px;
        font-size: 1.02rem;
    }

    .after-sub-links {
        flex-direction: column;
        gap: 8px;
    }

    .after-sub-link {
        width: 100%;
        justify-content: space-between;
        min-height: 50px;
        padding: 12px 16px;
        background: #fff;
        border-color: var(--price-line);
        border-radius: 13px;
    }

    .after-sub-link:hover { transform: none; }
    .after-sub-link:active { transform: scale(0.99); }

    /* ---- CTA ---- */
    .cta-banner.premium-cta .cta-title { font-size: 1.55rem; }
    .cta-banner.premium-cta .cta-text { font-size: 0.96rem; }

    .btn-glass,
    .btn-white-premium {
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
        padding: 14px 20px;
    }

    .btn-glass:hover,
    .btn-white-premium:hover { transform: none; }

    /* ---- Success modal becomes a bottom sheet ---- */
    .popup-wrapper {
        align-items: flex-end;
        padding: 0;
    }

    .popup-content {
        max-width: none;
        border-radius: 24px 24px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        animation: pricingSheetUp 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .popup-top-half { padding: 26px 22px 22px; }
    .popup-icon { width: 56px; height: 56px; }
    .popup-title { font-size: 1.18rem; }
    .popup-bottom-half { padding: 22px 22px 26px; }

    @keyframes pricingSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    @media (prefers-reduced-motion: reduce) {
        .popup-content { animation: none; }
    }
}
