/* فرم رپورتاژ - استایل کارشناس فروش */
#crm-form {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: 'Vazir', sans-serif;
    position: relative;
}

#crm-form input,
#crm-form textarea,
#crm-form select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

#crm-form input:focus,
#crm-form textarea:focus,
#crm-form select:focus {
    border-color: #033a88;
    outline: none;
    transition: all 0.2s;
}

#crm-form button {
    background: #033a88;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
}

#crm-form button[type="submit"]{
    padding: 10px 15px;
    font-size: 13px;
}



#crm-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#crm-loader {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: all;
}

/* بک‌گراند فقط روی فرم */
.crm-loader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    border-radius: 10px;
    margin: auto;
}

/* مرکز فرم */
.crm-loader-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.crm-loader-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid #ddd;
    border-top-color: #033a88;
    border-radius: 50%;
    animation: crm-spin .9s linear infinite;
    margin: 0 auto;
}

.crm-loader-text {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
}

@keyframes crm-spin {
    to { transform: rotate(360deg); }
}


/* قیمت ثابت کنار فرم */
#crm-fixed-total{
    position: absolute;
    width:180px;
    top: -40px;
    /*left: 40px;*/
    text-align:center;
    background: #033a88;
    color: #fff;
    padding: 15px 0px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    z-index: -1;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    font-weight: bold;
    font-family:'Dananum';
    font-size:13px;
    /*rotate:-90deg;*/
}

/* آپلود فایل */
#crm-form input[type="file"] {
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.2s;
}

#crm-form input[type="file"]:hover {
    border-color: #ffc400;
    background: #fffbe6;
}

/* پیام‌ها */
.crm-message {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
}

.crm-message.success {
    background: #e6ffed;
    color: #007f3f;
    border: 1px solid #00b144;
}

.crm-message.error {
    background: #ffe6e6;
    color: #d10000;
    border: 1px solid #ff4d4d;
}

.crm-error {
    border-color: #e63946 !important;
    background: #fff5f5;
}



.crm-error-text {
    color: #e63946;
    font-size: 13px;
    margin-bottom: 10px;
}


.crm-upload-wrapper {
    margin-bottom: 10px;
}

.crm-upload-wrapper input[type="file"] {
    display: none;
}

.crm-upload-box {
    border: 2px dashed #d6dbf5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(180deg, #fafbff, #f3f6ff);
    transition: all .25s ease;
    display: block;
}

.crm-upload-box:hover {
    border-color: #033A88;
    background: #eef2ff;
}

.crm-upload-box.dragover {
    border-color: #033A88;
    background: #e7edff;
    box-shadow: 0 0 0 4px rgba(3,58,136,.08);
}

.crm-upload-icon {
    margin-bottom: 12px;
}

.crm-upload-text strong {
    display: block;
    font-size: 15px;
    color: #033A88;
}

.crm-upload-text span {
    font-size: 12px;
    color: #666;
}

.crm-upload-filename {
    margin-top: 12px;
    font-size: 12px;
    padding: 6px 14px;
    display: inline-block;
    border-radius: 20px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e5e8ff;
    color: #333;
}







/* =====================================================
   MP Checkout Auth UI
===================================================== */
.mp-checkout-auth{
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: linear-gradient(180deg,#ffffff,#f8fafc);
    box-shadow: 0 6px 18px rgba(15,23,42,.05);
    clear: both;
}
.mp-auth-intro{
    font-size: 13px;
    color: #334155;
    line-height: 1.9;
    margin-bottom: 10px;
}
.mp-auth-actions,
.mp-auth-otp-step{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.mp-auth-send-code,
.mp-auth-verify-code{
    border: 0;
    border-radius: 10px;
    background: #033a88;
    color: #fff;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: transform .15s ease, opacity .15s ease;
}
.mp-auth-send-code:hover,
.mp-auth-verify-code:hover{ transform: translateY(-1px); opacity: .94; }
.mp-auth-send-code:disabled,
.mp-auth-verify-code:disabled{ opacity: .65; cursor: not-allowed; transform: none; }
.mp-auth-otp-code{
    width: 170px !important;
    max-width: 100%;
    text-align: center;
    direction: ltr;
    letter-spacing: 4px;
    font-size: 16px;
    margin: 0 !important;
}
.mp-auth-status{
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.8;
}
.mp-auth-status-ok{ color: #047857; }
.mp-auth-status-error{ color: #dc2626; }
.mp-auth-status-info{ color: #475569; }
.mp-checkout-auth.is-busy{ opacity: .85; }
@media (max-width: 640px){
    .mp-auth-actions,
    .mp-auth-otp-step{ flex-direction: column; align-items: stretch; }
    .mp-auth-send-code,
    .mp-auth-verify-code,
    .mp-auth-otp-code{ width: 100% !important; }
}


/* دو ستونه شدن فرم فروش */
#crm-form {
    max-width: 780px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 14px;
}
#crm-form > #crm-fixed-total,
#crm-form > .crm-message,
#crm-form > .mp-checkout-auth,
#crm-form > .crm-upload-wrapper,
#crm-form > textarea,
#crm-form > button[type="submit"],
#crm-form > #crm-loader {
    grid-column: 1 / -1;
}
#crm-form input,
#crm-form textarea,
#crm-form select {
    margin-bottom: 0;
    min-width: 0;
}
#crm-form textarea {
    min-height: 110px;
}
@media (max-width: 640px) {
    #crm-form {
        grid-template-columns: 1fr;
    }
}

/* ===== MP UI patch: compact OTP beside phone ===== */
#crm-form > .mp-checkout-auth {
    grid-column: auto !important;
}
#crm-form > .mp-checkout-auth,
.mp-checkout-auth {
    width: 100%;
    min-width: 0;
    clear: none !important;
    margin: 0 0 12px !important;
    padding: 10px 12px !important;
    border-radius: 12px;
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 7px 9px;
    flex-wrap: wrap;
}
.mp-auth-intro { flex: 1 1 100%; margin: 0 !important; font-size: 11.5px; line-height: 1.65; color: #667085; }
.mp-auth-actions,
.mp-auth-otp-step { flex: 1 1 auto; min-width: 0; gap: 7px; align-items: center; }
.mp-auth-send-code,
.mp-auth-verify-code { min-height: 40px; padding: 9px 12px; border-radius: 9px; white-space: nowrap; font-size: 12.5px; line-height: 1.4; }
.mp-auth-otp-code { flex: 1 1 118px; width: auto !important; min-width: 105px; height: 40px; padding: 8px 10px !important; border-radius: 9px; }
.mp-auth-status { flex: 1 1 100%; margin-top: 0 !important; font-size: 12px; line-height: 1.7; }
@media (max-width: 640px) {
    #crm-form > .mp-checkout-auth { grid-column: 1 / -1 !important; }
    .mp-checkout-auth { flex-direction: column; align-items: stretch; }
}


/* =====================================================
   BP 2026-06 responsive form/OTP/pager patch
===================================================== */
*, *::before, *::after { box-sizing: border-box; }
.mp-checkout-auth,
.cem-wrapper #profile > .mp-checkout-auth,
.bam-wrapper #profile > .mp-checkout-auth,
#crm-form > .mp-checkout-auth {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    clear: both !important;
    margin: 2px 0 12px !important;
    padding: 12px 14px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 9px 10px !important;
}
.mp-auth-intro {
    flex: 1 1 100% !important;
    margin: 0 !important;
}
.mp-auth-actions,
.mp-auth-otp-step {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 220px !important;
    gap: 8px !important;
    align-items: center !important;
}
.mp-auth-send-code,
.mp-auth-verify-code {
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}
.mp-auth-otp-code {
    flex: 1 1 150px !important;
    min-width: 120px !important;
    height: 42px !important;
    margin: 0 !important;
}
.mp-auth-status {
    flex: 1 1 100% !important;
    min-width: 0 !important;
}
.mp-tab-pager {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(3,58,136,.10);
    direction: ltr;
}
.mp-tab-arrow {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #033a88;
    color: #fff;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(3,58,136,.18);
    transition: transform .16s ease, opacity .16s ease, background .16s ease;
}
.mp-tab-arrow:hover { transform: translateY(-1px); }
.mp-tab-arrow:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
}
.mp-tab-pager-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}
.mp-tab-pager-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #d7ddea;
    transition: width .16s ease, background .16s ease;
}
.mp-tab-pager-dot.is-active {
    width: 24px;
    background: #033a88;
}
@media (max-width: 768px) {
    .cem-wrapper,
    .bam-wrapper,
    #crm-form {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        overflow-x: hidden !important;
    }
    .cem-tabs,
    .bam-tabs {
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 8px;
    }
    .cem-tab,
    .bam-tab {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }
    .mp-checkout-auth,
    .cem-wrapper #profile > .mp-checkout-auth,
    .bam-wrapper #profile > .mp-checkout-auth,
    #crm-form > .mp-checkout-auth {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .mp-auth-actions,
    .mp-auth-otp-step {
        min-width: 0 !important;
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .mp-auth-send-code,
    .mp-auth-verify-code,
    .mp-auth-otp-code {
        width: 100% !important;
    }
    .mp-tab-pager {
        gap: 10px;
        position: sticky;
        bottom: 0;
        z-index: 4;
        background: linear-gradient(180deg, rgba(255,255,255,.78), #fff 42%);
        padding: 12px 0 6px;
    }
}

#crm-form > textarea.crm-description-field {
    grid-column: auto !important;
    width: 100% !important;
    min-height: 44px;
    max-height: 92px;
    resize: vertical;
}
#crm-form .crm-upload-wrapper,
#crm-form .crm-upload-box { max-width: 100%; }
@media (max-width: 640px) {
    #crm-form { grid-template-columns: 1fr !important; margin-left: 0 !important; margin-right: 0 !important; }
    #crm-form > textarea.crm-description-field { grid-column: 1 / -1 !important; }
}

/* =====================================================
   BP compact OTP controls only - 2026-06-28
   Scope: only the verification-code box, buttons, input and status.
===================================================== */
.mp-checkout-auth[data-mp-checkout-auth] {
    width: min(100%, 460px) !important;
    max-width: 460px !important;
    margin: 4px auto 12px !important;
    padding: 9px 10px !important;
    border-radius: 13px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    clear: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-intro {
    width: 100% !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    text-align: center !important;
    font-size: 11.5px !important;
    line-height: 1.65 !important;
    color: #667085 !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-actions,
.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-otp-step {
    display: flex !important;
    width: 100% !important;
    max-width: 330px !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-actions {
    width: auto !important;
    max-width: 190px !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-send-code,
.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-verify-code {
    width: auto !important;
    min-width: auto !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-send-code {
    min-width: 116px !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-verify-code {
    min-width: 74px !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-otp-code {
    flex: 1 1 120px !important;
    width: 120px !important;
    min-width: 0 !important;
    max-width: 145px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    text-align: center !important;
    direction: ltr !important;
    letter-spacing: 3px !important;
    font-size: 15px !important;
    line-height: 34px !important;
    box-sizing: border-box !important;
}

.mp-checkout-auth[data-mp-checkout-auth] .mp-auth-status {
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    font-size: 11.5px !important;
    line-height: 1.6 !important;
}

@media (max-width: 640px) {
    .mp-checkout-auth[data-mp-checkout-auth] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 10px !important;
        padding: 8px !important;
        gap: 7px !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-intro {
        font-size: 11px !important;
        line-height: 1.55 !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-actions {
        width: auto !important;
        max-width: 170px !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-otp-step {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-send-code {
        width: auto !important;
        max-width: 100% !important;
        min-width: 112px !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-verify-code {
        width: auto !important;
        min-width: 70px !important;
        padding-inline: 10px !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-otp-code {
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }
}

@media (max-width: 360px) {
    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-otp-step {
        gap: 6px !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-send-code,
    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-verify-code {
        padding-inline: 9px !important;
        font-size: 11.5px !important;
    }

    .mp-checkout-auth[data-mp-checkout-auth] .mp-auth-otp-code {
        padding-inline: 8px !important;
        letter-spacing: 2px !important;
        font-size: 14px !important;
    }
}

/* OTP verification final state */
.mp-auth-verified-badge{
    display:none;
    flex:1 1 100%;
    width:100%;
    min-height:42px;
    padding:10px 14px;
    border-radius:10px;
    border:1px solid #16a34a;
    background:#ecfdf5;
    color:#047857;
    font-weight:800;
    text-align:center;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
}
.mp-checkout-auth.is-verified .mp-auth-intro,
.mp-checkout-auth.is-verified .mp-auth-actions,
.mp-checkout-auth.is-verified .mp-auth-otp-step{
    display:none !important;
}
.mp-checkout-auth.is-verified .mp-auth-verified-badge{
    display:flex !important;
}
.mp-auth-otp-code-error{
    border-color:#dc2626 !important;
    box-shadow:0 0 0 3px rgba(220,38,38,.12) !important;
}

