/* ============================================================================
   Chariow Integration — Plans Grid & Modal
   ============================================================================ */

/* ── Grid ──────────────────────────────────────────────────────────────────── */

.chariow-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 16px 0;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */

.chariow-plan-card {
    position: relative;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.chariow-plan-card:hover {
    box-shadow: 0 8px 30px rgba(19, 99, 223, 0.12);
    border-color: #93b8f9;
}

.chariow-plan-card.is-active {
    border-color: #1363DF;
    background: #f0f5ff;
}

/* ── Badge ─────────────────────────────────────────────────────────────────── */

.chariow-plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #1363DF;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 100px;
    white-space: nowrap;
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.chariow-plan-header {
    text-align: center;
}

.chariow-plan-name {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.chariow-plan-price {
    font-size: 32px;
    font-weight: 800;
    color: #1363DF;
    line-height: 1;
}

/* ── Features list ─────────────────────────────────────────────────────────── */

.chariow-plan-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.chariow-plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.chariow-plan-features li::before {
    content: "✔";
    color: #1363DF;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Credits badge ─────────────────────────────────────────────────────────── */

.chariow-plan-credits {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
    background: #e0f2fe;
    border-radius: 8px;
    padding: 6px 12px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.chariow-plan-action {
    text-align: center;
}

.chariow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.12s ease;
    width: 100%;
    box-sizing: border-box;
}

.chariow-btn--subscribe {
    background: #1363DF;
    color: #ffffff;
}

.chariow-btn--subscribe:hover {
    background: #0f50b8;
    transform: translateY(-1px);
}

.chariow-btn--subscribe:active {
    transform: translateY(0);
}

.chariow-btn--active {
    background: #e2e8f0;
    color: #64748b;
    cursor: default;
    font-size: 14px;
}

.chariow-btn--submit {
    background: #1363DF;
    color: #ffffff;
    width: 100%;
    margin-top: 8px;
    font-size: 16px;
    padding: 14px;
}

.chariow-btn--submit:hover {
    background: #0f50b8;
}

.chariow-btn--submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.chariow-no-plans {
    color: #94a3b8;
    font-style: italic;
}

/* ── Modal overlay ─────────────────────────────────────────────────────────── */

.chariow-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.chariow-modal-overlay[hidden] {
    display: none !important;
}

.chariow-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 480px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    animation: chariow-slide-in 0.22s ease;
}

@keyframes chariow-slide-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chariow-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chariow-modal-close:hover {
    background: #e2e8f0;
}

.chariow-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
}

.chariow-modal-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px;
}

/* ── Form ──────────────────────────────────────────────────────────────────── */

.chariow-form-row {
    display: grid;
    gap: 12px;
}

.chariow-form-row--2col {
    grid-template-columns: 1fr 1fr;
}

.chariow-form-row--phone {
    grid-template-columns: 1fr 1fr;
}

.chariow-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.chariow-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.chariow-form-group label span {
    color: #ef4444;
    margin-left: 2px;
}

.chariow-form-group input,
.chariow-form-group select {
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.chariow-form-group input:focus,
.chariow-form-group select:focus {
    outline: none;
    border-color: #1363DF;
    box-shadow: 0 0 0 3px rgba(19, 99, 223, 0.12);
}

.chariow-form-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.chariow-form-error[hidden] {
    display: none;
}

/* ── WhatsApp hint card ─────────────────────────────────────────────────────── */

.chariow-whatsapp-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 8px;
    font-size: 13px;
    color: #166534;
    line-height: 1.5;
}

.chariow-whatsapp-hint__icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.4;
}

/* ── WhatsApp existing block ────────────────────────────────────────────────── */

.chariow-whatsapp-existing {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #334155;
    line-height: 1.4;
}

.chariow-whatsapp-existing strong {
    color: #0f172a;
    font-weight: 700;
}

.chariow-whatsapp-change-btn {
    background: transparent;
    border: none;
    color: #1363DF;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    margin-left: auto;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
    outline: none;
}

.chariow-whatsapp-change-btn:hover {
    background: #eff6ff;
    color: #0f50b8;
    text-decoration: none;
}

/* ── Phone-only mode (logged-in users) ─────────────────────────────────────── */

.chariow-modal--phone-only .chariow-guest-only-fields {
    display: none;
}

/* ── Redirect confirmation popup ──────────────────────────────────────────── */

.chariow-redirect-overlay {
    z-index: 100000; /* above the checkout modal */
}

.chariow-modal--redirect {
    max-width: 420px;
    text-align: center;
    padding: 40px 36px 36px;
    font-family: 'Poppins', sans-serif;
}

.chariow-modal--redirect .chariow-redirect-title,
.chariow-modal--redirect .chariow-redirect-subtitle,
.chariow-modal--redirect .chariow-redirect-plan-name,
.chariow-modal--redirect .chariow-redirect-note,
.chariow-modal--redirect .chariow-redirect-security__item,
.chariow-modal--redirect .chariow-btn--confirm-redirect {
    font-family: 'Poppins', sans-serif;
}

.chariow-redirect-icon {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 16px;
    display: block;
}

.chariow-redirect-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.chariow-redirect-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 6px;
    line-height: 1.65;
}

/* Plan name — colored + bold, no background */
.chariow-redirect-plan-name {
    font-size: 18px;
    font-weight: 800;
    color: #1363DF;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
}

/* Security reassurance row */
.chariow-redirect-security {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 16px;
    margin-top: 16px;
    margin-bottom: 0;
}

.chariow-redirect-security__item {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.chariow-redirect-note {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 24px;
    line-height: 1.6;
}

.chariow-btn--confirm-redirect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1363DF;
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(19, 99, 223, 0.3);
}

.chariow-btn--confirm-redirect:hover {
    background: #0f50b8;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(19, 99, 223, 0.38);
}

.chariow-btn--confirm-redirect:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(19, 99, 223, 0.25);
}

/* ── Select2 overrides (country picker) ────────────────────────────────────── */

.chariow-modal-overlay .select2-container {
    width: 100% !important;
}

.chariow-modal-overlay .select2-container--default .select2-selection--single {
    height: 40px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
}

.chariow-modal-overlay .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1e293b;
    font-size: 14px;
    line-height: 40px;
    padding-left: 10px;
    padding-right: 30px;
}

.chariow-modal-overlay .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
    right: 8px;
}

.chariow-modal-overlay .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #1363DF;
    box-shadow: 0 0 0 3px rgba(19, 99, 223, 0.12);
    outline: none;
}

.chariow-modal-overlay .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #1363DF;
}

.chariow-modal-overlay .select2-search__field {
    border: 1.5px solid #d1d5db !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

.chariow-modal-overlay .select2-search__field:focus {
    border-color: #1363DF !important;
    outline: none !important;
}

.select2-dropdown {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    min-width: 220px;
}



/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
    .chariow-plans-grid {
        grid-template-columns: 1fr;
    }

    .chariow-form-row--2col,
    .chariow-form-row--phone {
        grid-template-columns: 1fr;
    }

    .chariow-modal {
        padding: 28px 20px 24px;
    }


}
