/* Subscription Purchase Experience — RTL/LTR aware */

/* ── Base marketing shell ── */
.marketing-page {
    background: #f4f6f9;
    color: #333;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
}

[dir="rtl"] .marketing-page {
    font-family: "Cairo", Tahoma, "Segoe UI", Arial, sans-serif;
}

.marketing-navbar {
    background: #3c8dbc;
    border: 0;
}

.marketing-navbar .navbar-brand {
    color: #fff !important;
    font-weight: 800;
}

.marketing-navbar .nav > li > a {
    color: #f9fbfd;
}

.marketing-navbar .nav > li > a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.lang-toggle .btn {
    margin-inline-start: 6px;
}

/* ── Section typography ── */
.section-title {
    font-weight: 800;
    font-size: 30px;
    color: #222;
    margin-block-end: 10px;
}

.section-sub {
    color: #666;
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto 36px;
    text-align: center;
}

.text-soft { color: #666; }
.fw-800 { font-weight: 800; }

/* ── Builder layout (cart on outer edge) ── */
.builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(380px, 100%);
    gap: 2rem;
    align-items: start;
}

/* Same column sizes in LTR and RTL; grid auto-mirrors column positions with dir=rtl */
.builder-main {
    grid-column: 1;
    min-width: 0;
}

.cart-panel {
    grid-column: 2;
    position: sticky;
    inset-block-start: 1.5rem;
    width: 100%;
    max-width: 380px;
    justify-self: stretch;
}

[dir="rtl"] .cart-panel {
    justify-self: stretch;
}

@media (max-width: 991px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }

    .builder-main,
    [dir="rtl"] .builder-main {
        grid-column: 1;
    }

    .cart-panel,
    [dir="rtl"] .cart-panel {
        grid-column: 1;
        max-width: none;
    }

    .cart-panel {
        position: relative;
        inset-block-start: auto;
        order: -1;
    }
}

/* ── Stepper ── */
.builder-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-block-end: 2rem;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.builder-stepper .step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
}

.builder-stepper .step.active {
    color: #3c8dbc;
}

.builder-stepper .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.builder-stepper .step.active .step-num {
    background: #3c8dbc;
    color: #fff;
}

.builder-stepper .step-connector {
    flex: 0 0 24px;
    height: 2px;
    background: #e5e7eb;
    margin-inline: 8px;
}

[dir="rtl"] .builder-stepper .step-connector .fa {
    transform: scaleX(-1);
}

[dir="rtl"] .builder-stepper {
    justify-content: center;
}

[dir="rtl"] .builder-step-header h3,
[dir="rtl"] .builder-step-header p {
    text-align: start;
}

[dir="rtl"] .addon-item {
    text-align: start;
}

[dir="rtl"] .addon-item input[type="checkbox"] {
    margin-block-start: 4px;
}

[dir="rtl"] .subscription-cart-title,
[dir="rtl"] .cart-line,
[dir="rtl"] .cart-total-row,
[dir="rtl"] .cart-included-label {
    text-align: start;
}

[dir="rtl"] .cart-line {
    flex-direction: row-reverse;
}

[dir="rtl"] .cart-total-row {
    flex-direction: row-reverse;
}

/* ── Builder step sections ── */
.builder-step {
    margin-block-end: 2.5rem;
}

.builder-step-header {
    margin-block-end: 1.25rem;
}

.builder-step-header h3 {
    font-weight: 800;
    font-size: 22px;
    color: #222;
    margin: 0 0 6px;
}

.builder-step-header p {
    color: #666;
    margin: 0;
    font-size: 15px;
}

/* ── Plan cards ── */
.plan-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    padding: 24px 20px;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    min-height: 100%;
    cursor: pointer;
    text-align: start;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .12);
    border-color: rgba(60, 141, 188, .35);
}

.plan-card.featured {
    border-color: #3c8dbc;
    box-shadow: inset 0 0 0 1px rgba(60, 141, 188, .25), 0 12px 36px rgba(60, 141, 188, .18);
}

.plan-card.selected {
    border-color: #3c8dbc;
    box-shadow: inset 0 0 0 2px rgba(60, 141, 188, .5), 0 8px 24px rgba(60, 141, 188, .15);
}

.plan-card .plan-badge {
    position: absolute;
    inset-block-start: -10px;
    inset-inline-end: 16px;
    background: linear-gradient(135deg, #3c8dbc, #00c0ef);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.plan-card .plan-name {
    font-weight: 800;
    font-size: 22px;
    margin-block-end: 8px;
    color: #222;
}

.plan-card .plan-desc {
    color: #666;
    min-height: 44px;
    font-size: 14px;
    margin-block-end: 16px;
}

.plan-card .plan-price {
    margin-block-end: 12px;
}

.plan-card .plan-price .amount {
    font-size: 36px;
    font-weight: 800;
    color: #3c3f44;
    unicode-bidi: isolate;
}

.plan-card .plan-price .period {
    color: #7a7e87;
    font-size: 14px;
}

.plan-card .plan-users {
    font-size: 14px;
    color: #3c8dbc;
    font-weight: 700;
    margin-block-end: 16px;
}

.plan-card .plan-users .fa {
    margin-inline-end: 6px;
}

.plan-card .btn-select-plan {
    width: 100%;
    border-radius: 10px;
    font-weight: 700;
    padding: 10px 16px;
}

.plan-card .selected-label {
    display: none;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(60, 141, 188, .12);
    color: #1f5f82;
    font-weight: 800;
    font-size: 14px;
}

.plan-card.selected .btn-select-plan { display: none; }
.plan-card.selected .selected-label { display: block; }

/* Overview card (landing) — no selection state */
.plan-overview-card .btn-view-pricing {
    width: 100%;
    border-radius: 10px;
    font-weight: 700;
    padding: 10px 16px;
    margin-block-start: 12px;
}

/* ── Billing toggle ── */
.price-toggle {
    margin-block-end: 1.5rem;
    text-align: center;
}

.country-selector {
    margin-block-start: 10px;
}

.country-selector select {
    display: inline-block;
    width: auto;
}

/* ── Module cards grid ── */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.module-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    padding: 18px;
    transition: border-color .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.module-card:hover {
    border-color: rgba(60, 141, 188, .3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
}

.module-card.enabled {
    border-color: rgba(60, 141, 188, .45);
    background: rgba(60, 141, 188, .04);
}

.module-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.module-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(60, 141, 188, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3c8dbc;
    font-size: 18px;
    flex-shrink: 0;
}

.module-card-title {
    font-weight: 800;
    font-size: 16px;
    color: #222;
    margin: 0;
}

.module-card-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    flex: 1;
}

.module-card-price {
    font-size: 14px;
    font-weight: 700;
    color: #3c8dbc;
    unicode-bidi: isolate;
    text-align: end;
}

/* Toggle switch */
.module-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.module-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.module-toggle .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: .3s;
}

.module-toggle .slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    inset-block-start: 3px;
    inset-inline-start: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .3s;
}

.module-toggle input:checked + .slider {
    background: #3c8dbc;
}

.module-toggle input:checked + .slider::before {
    transform: translateX(20px);
}

[dir="rtl"] .module-toggle input:checked + .slider::before {
    transform: translateX(-20px);
}

/* ── Addon accordion ── */
.addon-accordion .panel {
    border-radius: 12px;
    overflow: hidden;
    margin-block-end: 10px;
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: none;
}

.addon-accordion .panel-heading {
    background: #fff;
    border: none;
    padding: 0;
}

.addon-accordion .panel-title a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-weight: 800;
    font-size: 15px;
    color: #222;
    text-decoration: none;
}

.addon-accordion .panel-title a:hover,
.addon-accordion .panel-title a:focus {
    color: #3c8dbc;
    text-decoration: none;
}

.addon-accordion .panel-title .fa-chevron-down {
    transition: transform .2s ease;
    color: #9ca3af;
}

.addon-accordion .panel-title a[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.addon-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 18px;
    border-block-start: 1px solid rgba(0, 0, 0, .05);
    cursor: pointer;
}

.addon-item:hover {
    background: rgba(60, 141, 188, .04);
}

.addon-item-body {
    flex: 1;
    min-width: 0;
}

.addon-item-name {
    font-weight: 700;
    font-size: 14px;
    color: #222;
}

.addon-item-desc {
    font-size: 12px;
    color: #666;
    margin-block-start: 2px;
}

.addon-item-price {
    font-size: 13px;
    font-weight: 700;
    color: #3c8dbc;
    white-space: nowrap;
    unicode-bidi: isolate;
    text-align: end;
}

/* ── Subscription cart ── */
.subscription-cart {
    background: #fff;
    border: 1px solid rgba(60, 141, 188, .2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(60, 141, 188, .1);
}

.subscription-cart-title {
    font-weight: 800;
    font-size: 18px;
    color: #222;
    margin: 0 0 16px;
    padding-block-end: 12px;
    border-block-end: 1px solid rgba(0, 0, 0, .08);
}

.cart-line-items {
    margin-block-end: 16px;
    max-height: 280px;
    overflow-y: auto;
}

.cart-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-block-end: 1px solid rgba(0, 0, 0, .05);
    font-size: 14px;
}

.cart-line:last-child {
    border-block-end: none;
}

.cart-line-name {
    flex: 1;
    color: #333;
    font-weight: 600;
}

.cart-line-type {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
}

.cart-line-price {
    font-weight: 700;
    color: #222;
    unicode-bidi: isolate;
    text-align: end;
    white-space: nowrap;
}

.cart-line-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 0 4px;
    font-size: 14px;
    line-height: 1;
}

.cart-line-remove:hover {
    color: #c0392b;
}

.cart-totals {
    border-block-start: 1px dashed rgba(0, 0, 0, .12);
    padding-block-start: 12px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-end: 6px;
    font-size: 14px;
    color: #444;
}

.cart-total-row.grand {
    margin-block-start: 10px;
    padding-block-start: 10px;
    border-block-start: 1px solid rgba(0, 0, 0, .1);
    font-weight: 800;
    font-size: 18px;
    color: #222;
}

.cart-total-row .amount {
    unicode-bidi: isolate;
    text-align: end;
    font-weight: 700;
}

.cart-total-row.grand .amount {
    color: #3c8dbc;
    font-size: 20px;
}

.cart-tax-note {
    font-size: 11px;
    color: #9ca3af;
    margin-block-start: 4px;
    text-align: end;
}

.cart-actions {
    margin-block-start: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-actions .btn {
    border-radius: 10px;
    font-weight: 800;
    padding: 12px 16px;
}

.cart-actions .btn-trial {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    color: #fff;
}

.cart-actions .btn-trial:hover {
    background: linear-gradient(135deg, #219a52, #27ae60);
    color: #fff;
}

.cart-included-modules {
    margin-block-end: 12px;
}

.cart-included-label {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    margin-block-end: 6px;
}

.cart-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cart-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(52, 211, 153, .12);
    color: #065f46;
    border: 1px solid rgba(52, 211, 153, .25);
}

.cart-chip .fa {
    margin-inline-end: 4px;
    font-size: 10px;
}

.cart-empty-hint {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
}

/* ── FAQ section ── */
.section-faq {
    background: #fff;
    padding: 60px 0;
    border-block-end: 1px solid rgba(0, 0, 0, .06);
}

.faq-accordion .panel {
    border-radius: 12px;
    margin-block-end: 8px;
    border: 1px solid rgba(0, 0, 0, .08);
}

.faq-accordion .panel-heading {
    background: #fff;
    border: none;
    padding: 0;
}

.faq-accordion .panel-title a {
    display: block;
    padding: 16px 20px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}

/* ── Testimonials ── */
.section-testimonials {
    background: linear-gradient(180deg, #f4f6f9, #eef3f8);
    padding: 60px 0;
}

.testimonial-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
    height: 100%;
    text-align: start;
}

.testimonial-card .quote {
    font-size: 15px;
    color: #444;
    line-height: 1.7;
    margin-block-end: 16px;
    font-style: italic;
}

.testimonial-card .author {
    font-weight: 800;
    font-size: 14px;
    color: #222;
}

.testimonial-card .role {
    font-size: 12px;
    color: #9ca3af;
}

.testimonial-card .stars {
    color: #f59e0b;
    margin-block-end: 12px;
}

/* ── Purchase summary (register) ── */
.purchase-summary {
    background: linear-gradient(120deg, rgba(60, 141, 188, .08), rgba(0, 192, 239, .1));
    border: 1px solid rgba(60, 141, 188, .2);
    border-radius: 14px;
    padding: 20px;
    margin-block-end: 24px;
    text-align: start;
}

.purchase-summary-title {
    font-weight: 800;
    font-size: 16px;
    color: #1f5f82;
    margin: 0 0 14px;
}

.purchase-summary .summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-block-end: 6px;
    color: #444;
}

.purchase-summary .summary-row.grand {
    font-weight: 800;
    font-size: 17px;
    margin-block-start: 10px;
    padding-block-start: 10px;
    border-block-start: 1px dashed rgba(0, 0, 0, .15);
    color: #222;
}

/* ── Loading overlay for country refresh ── */
.builder-loading {
    opacity: .5;
    pointer-events: none;
    transition: opacity .2s ease;
}
