/**
 * OTP واتساب على نموذج التسجيل — بوب‑أب responsive.
 * Scoped: الـoverlay في body؛ الـhint والـbadge تحت .ots-profile-login.
 */

/* ─── overlay / backdrop ─────────────────────────────────────────────────── */
#ots-reg-otp-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(10, 20, 40, 0.62) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    /* فتح / إغلاق بانيميشن */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
#ots-reg-otp-overlay.ots-reg-modal-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ─── المودال الكارد ─────────────────────────────────────────────────────── */
.ots-reg-otp-modal {
    position: relative !important;
    width: 100% !important;
    max-width: 420px !important;
    background: #fff !important;
    border-radius: 20px !important;
    padding: 32px 28px 28px !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22) !important;
    direction: rtl !important;
    font-family: "IBM Plex Sans Arabic", "Segoe UI", sans-serif !important;
    text-align: center !important;
    transform: translateY(18px);
    transition: transform 0.25s cubic-bezier(.22,1,.36,1);
    box-sizing: border-box !important;
}
#ots-reg-otp-overlay.ots-reg-modal-open .ots-reg-otp-modal {
    transform: translateY(0) !important;
}

/* زر الإغلاق */
.ots-reg-otp-close {
    position: absolute !important;
    top: 14px !important;
    left: 16px !important;
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    background: rgb(243 244 246) !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s ease !important;
}
.ots-reg-otp-close:hover { background: rgb(229 231 235) !important; }

/* ─── هيدَر المودال ──────────────────────────────────────────────────────── */
.ots-reg-otp-modal-header { margin-bottom: 24px !important; }

.ots-reg-otp-wa-icon {
    width: 64px !important;
    height: 64px !important;
    margin: 0 auto 14px !important;
    background: #25d366 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 20px rgba(37,211,102,0.30) !important;
}
.ots-reg-otp-wa-icon svg { width: 36px !important; height: 36px !important; }

.ots-reg-otp-modal-title {
    margin: 0 0 6px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #1B365D !important;
}

.ots-reg-otp-modal-sub {
    margin: 0 0 12px !important;
    font-size: 13px !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}
.ots-reg-otp-modal-sub strong { color: #25d366 !important; font-weight: 700 !important; }

.ots-reg-otp-modal-phone-badge {
    display: inline-block !important;
    background: rgb(240 253 244) !important;
    border: 1px solid rgb(167 243 208) !important;
    color: rgb(5 78 57) !important;
    border-radius: 10px !important;
    padding: 6px 16px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    direction: ltr !important;
}

/* ─── زر إرسال الواتساب ──────────────────────────────────────────────────── */
.ots-reg-otp-wa-send-btn {
    width: 100% !important;
    padding: 14px 20px !important;
    background: #25d366 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: background 0.18s ease, transform 0.12s ease !important;
    box-shadow: 0 4px 16px rgba(37,211,102,0.30) !important;
    margin-bottom: 12px !important;
}
.ots-reg-otp-wa-send-btn:hover:not([disabled]) {
    background: #1da851 !important;
    transform: translateY(-1px) !important;
}
.ots-reg-otp-wa-send-btn[disabled] { opacity: 0.65 !important; cursor: not-allowed !important; }
.ots-reg-otp-wa-send-btn svg { width: 20px !important; height: 20px !important; flex-shrink: 0 !important; }

/* ─── مرحلة إدخال الرمز ──────────────────────────────────────────────────── */
.ots-reg-otp-code-step { margin-top: 4px !important; }

.ots-reg-otp-code-label {
    font-size: 12px !important;
    color: #64748b !important;
    margin-bottom: 8px !important;
    text-align: center !important;
}

.ots-reg-otp-code-row {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin-bottom: 10px !important;
}

.ots-reg-otp-modal-input {
    flex: 1 !important;
    text-align: center !important;
    direction: ltr !important;
    letter-spacing: 0.4em !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    padding: 10px 8px !important;
    border: 2px solid rgb(203 213 225) !important;
    border-radius: 10px !important;
    background: rgb(248 250 252) !important;
    color: #0f172a !important;
    min-width: 0 !important;
    transition: border-color 0.15s !important;
}
.ots-reg-otp-modal-input:focus {
    outline: none !important;
    border-color: #25d366 !important;
    background: #fff !important;
}

.ots-reg-otp-confirm-btn {
    white-space: nowrap !important;
    padding: 10px 16px !important;
    background: #1B365D !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
    flex-shrink: 0 !important;
}
.ots-reg-otp-confirm-btn:hover:not([disabled]) { background: #00B4D8 !important; }
.ots-reg-otp-confirm-btn[disabled] { opacity: 0.6 !important; cursor: not-allowed !important; }

/* ─── عدّاد إعادة الإرسال ─────────────────────────────────────────────────── */
.ots-reg-otp-resend-row {
    font-size: 12px !important;
    color: #94a3b8 !important;
    text-align: center !important;
    min-height: 18px !important;
}

/* ─── رسائل الخطأ / النجاح ───────────────────────────────────────────────── */
.ots-reg-otp-modal-msg {
    margin-top: 10px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    padding: 9px 12px !important;
    border-radius: 10px !important;
    text-align: center !important;
}
.ots-reg-otp-modal-msg--info { background: rgb(239 246 255) !important; color: rgb(30 64 175) !important; border: 1px solid rgb(147 197 253) !important; }
.ots-reg-otp-modal-msg--ok   { background: rgb(240 253 244) !important; color: rgb(5 78 57) !important;  border: 1px solid rgb(167 243 208) !important; }
.ots-reg-otp-modal-msg--err  { background: rgb(254 242 242) !important; color: rgb(153 27 27) !important; border: 1px solid rgb(252 165 165) !important; }

/* ─── حالة التحقق النجاح داخل المودال ────────────────────────────────────── */
.ots-reg-otp-success-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 0 4px !important;
}
.ots-reg-otp-success-icon {
    width: 52px !important;
    height: 52px !important;
    background: rgb(209 250 229) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 26px !important;
}
.ots-reg-otp-success-text {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: rgb(5 78 57) !important;
}
.ots-reg-otp-success-sub {
    font-size: 12px !important;
    color: #64748b !important;
}

/* ─── hint + badge أسفل حقل الجوال ─────────────────────────────────────────── */
.ots-reg-phone-hint {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11.5px !important;
    color: #64748b !important;
    margin-top: 5px !important;
    line-height: 1.4 !important;
}
.ots-reg-phone-hint svg { flex-shrink: 0 !important; width: 14px !important; height: 14px !important; }

.ots-reg-verified-badge {
    display: none !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: rgb(5 78 57) !important;
    background: rgb(209 250 229) !important;
    border: 1px solid rgb(167 243 208) !important;
    border-radius: 999px !important;
    padding: 3px 10px !important;
    margin-top: 5px !important;
}
.ots-reg-verified-badge.ots-reg-is-verified { display: inline-flex !important; }

/* لا يوجد قفل بصري على زر التسجيل — البوب‑أب هو الحارس */

/* ─── موبايل ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #ots-reg-otp-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
    }
    .ots-reg-otp-modal {
        border-radius: 20px 20px 0 0 !important;
        max-width: 100% !important;
        padding: 28px 20px 32px !important;
    }
    .ots-reg-otp-code-row {
        flex-direction: column !important;
    }
    .ots-reg-otp-confirm-btn {
        width: 100% !important;
        padding: 13px !important;
        font-size: 14px !important;
    }
    .ots-reg-otp-modal-input {
        font-size: 26px !important;
        padding: 12px 8px !important;
    }
    .ots-reg-otp-wa-send-btn {
        font-size: 14px !important;
        padding: 16px !important;
    }
}
