/* استایل فرم OTP و احراز هویت پیامکی */
/* نسخه بهبود یافته با محافظت در برابر تداخل قالب‌ها */

/* مودال OTP */
div.shahrokh-otp-modal {
    display: none !important;
    position: fixed !important;
    z-index: 9999999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(5px) !important;
    animation: fadeIn 0.3s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

div.shahrokh-otp-modal.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.shahrokh-otp-modal .shahrokh-otp-content {
    background-color: #fff !important;
    padding: 40px !important;
    border-radius: 12px !important;
    max-width: 450px !important;
    width: 90% !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    animation: slideUp 0.4s ease !important;
    text-align: center !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.shahrokh-otp-modal .shahrokh-otp-close,
.shahrokh-otp-modal span.shahrokh-otp-close {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    font-size: 28px !important;
    font-weight: bold !important;
    color: #999 !important;
    cursor: pointer !important;
    transition: color 0.3s !important;
    line-height: 1 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
}

.shahrokh-otp-modal .shahrokh-otp-close:hover,
.shahrokh-otp-modal span.shahrokh-otp-close:hover {
    color: #333 !important;
}

.shahrokh-otp-modal .shahrokh-otp-title,
.shahrokh-otp-modal h2.shahrokh-otp-title,
.shahrokh-otp-modal h3.shahrokh-otp-title {
    font-size: 24px !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
    color: #333 !important;
    line-height: 1.3 !important;
    padding: 0 !important;
}

.shahrokh-otp-modal .shahrokh-otp-description,
.shahrokh-otp-modal p.shahrokh-otp-description {
    font-size: 14px !important;
    color: #666 !important;
    margin-bottom: 25px !important;
    line-height: 1.6 !important;
    padding: 0 !important;
}

.shahrokh-otp-modal .shahrokh-otp-phone,
.shahrokh-otp-modal span.shahrokh-otp-phone {
    font-weight: bold !important;
    color: #2196F3 !important;
    direction: ltr !important;
    display: inline-block !important;
}

/* فیلد ورود کد OTP */
.shahrokh-otp-modal .shahrokh-otp-input-wrapper {
    margin: 30px 0 !important;
    padding: 0 !important;
}

.shahrokh-otp-modal .shahrokh-otp-inputs {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    direction: ltr !important;
}

.shahrokh-otp-modal .shahrokh-otp-digit,
.shahrokh-otp-modal input.shahrokh-otp-digit {
    width: 50px !important;
    height: 60px !important;
    font-size: 24px !important;
    font-weight: bold !important;
    text-align: center !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    outline: none !important;
    transition: all 0.3s !important;
    background: #f9f9f9 !important;
    color: #333 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.shahrokh-otp-modal .shahrokh-otp-digit:focus,
.shahrokh-otp-modal input.shahrokh-otp-digit:focus {
    border-color: #2196F3 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1) !important;
    outline: none !important;
}

.shahrokh-otp-modal .shahrokh-otp-digit.error,
.shahrokh-otp-modal input.shahrokh-otp-digit.error {
    border-color: #f44336 !important;
    background: #ffebee !important;
    animation: shake 0.5s !important;
}

/* تایمر */
.shahrokh-otp-modal .shahrokh-otp-timer,
.shahrokh-otp-modal div.shahrokh-otp-timer {
    margin: 20px 0 !important;
    font-size: 16px !important;
    color: #666 !important;
    padding: 0 !important;
}

.shahrokh-otp-modal .shahrokh-otp-timer-value,
.shahrokh-otp-modal span.shahrokh-otp-timer-value {
    font-weight: bold !important;
    color: #FF5722 !important;
    font-size: 18px !important;
    font-family: monospace !important;
}

.shahrokh-otp-modal .shahrokh-otp-timer.expired .shahrokh-otp-timer-value,
.shahrokh-otp-modal div.shahrokh-otp-timer.expired span.shahrokh-otp-timer-value {
    color: #f44336 !important;
}

/* دکمه‌ها */
.shahrokh-otp-modal .shahrokh-otp-actions {
    margin-top: 25px !important;
    display: flex !important;
    gap: 10px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    padding: 0 !important;
}

.shahrokh-otp-modal .shahrokh-otp-btn,
.shahrokh-otp-modal button.shahrokh-otp-btn {
    padding: 12px 30px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    display: inline-block !important;
    box-sizing: border-box !important;
}

.shahrokh-otp-modal .shahrokh-otp-btn-primary,
.shahrokh-otp-modal button.shahrokh-otp-btn-primary {
    background: #667eea !important;
    color: #fff !important;
    min-width: 120px !important;
}

.shahrokh-otp-modal .shahrokh-otp-btn-primary:hover:not(:disabled),
.shahrokh-otp-modal button.shahrokh-otp-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.shahrokh-otp-modal .shahrokh-otp-btn-primary:disabled,
.shahrokh-otp-modal button.shahrokh-otp-btn-primary:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.shahrokh-otp-modal .shahrokh-otp-btn-secondary,
.shahrokh-otp-modal button.shahrokh-otp-btn-secondary {
    background: #fff !important;
    color: #666 !important;
    border: 2px solid #ddd !important;
}

.shahrokh-otp-modal .shahrokh-otp-btn-secondary:hover:not(:disabled),
.shahrokh-otp-modal button.shahrokh-otp-btn-secondary:hover:not(:disabled) {
    background: #f5f5f5 !important;
    border-color: #999 !important;
}

.shahrokh-otp-modal .shahrokh-otp-btn-secondary:disabled,
.shahrokh-otp-modal button.shahrokh-otp-btn-secondary:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* دکمه تغییر شماره */
.shahrokh-otp-modal #shahrokh-change-phone-btn,
.shahrokh-otp-modal button#shahrokh-change-phone-btn {
    background: #fff !important;
    color: #e67e22 !important;
    border: 2px solid #e67e22 !important;
}

.shahrokh-otp-modal #shahrokh-change-phone-btn:hover,
.shahrokh-otp-modal button#shahrokh-change-phone-btn:hover {
    background: #e67e22 !important;
    color: #fff !important;
}

/* پیام‌ها */
.shahrokh-otp-modal .shahrokh-otp-message,
.shahrokh-otp-modal div.shahrokh-otp-message {
    margin: 15px 0 !important;
    padding: 12px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    animation: fadeIn 0.3s ease !important;
    line-height: 1.6 !important;
}

.shahrokh-otp-modal .shahrokh-otp-message.success,
.shahrokh-otp-modal div.shahrokh-otp-message.success {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    border: 1px solid #81c784 !important;
}

.shahrokh-otp-modal .shahrokh-otp-message.error,
.shahrokh-otp-modal div.shahrokh-otp-message.error {
    background: #ffebee !important;
    color: #c62828 !important;
    border: 1px solid #ef5350 !important;
}

.shahrokh-otp-modal .shahrokh-otp-message.info,
.shahrokh-otp-modal div.shahrokh-otp-message.info {
    background: #e3f2fd !important;
    color: #1565c0 !important;
    border: 1px solid #64b5f6 !important;
}

/* لودینگ */
.shahrokh-otp-modal .shahrokh-otp-loading,
.shahrokh-otp-modal span.shahrokh-otp-loading {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    border: 3px solid rgba(255, 255, 255, 0.865) !important;
    border-top-color: #000000 !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
    margin-right: 5px !important;
    vertical-align: middle !important;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ریسپانسیو */
@media (max-width: 480px) {
    .shahrokh-otp-modal .shahrokh-otp-content {
        padding: 30px 20px !important;
    }

    .shahrokh-otp-modal .shahrokh-otp-digit,
    .shahrokh-otp-modal input.shahrokh-otp-digit {
        width: 40px !important;
        height: 50px !important;
        font-size: 20px !important;
    }

    .shahrokh-otp-modal .shahrokh-otp-actions {
        flex-direction: column !important;
    }

    .shahrokh-otp-modal .shahrokh-otp-btn,
    .shahrokh-otp-modal button.shahrokh-otp-btn {
        width: 100% !important;
    }
}

/* فونت فارسی */
body.shahrokh-font-enabled .shahrokh-otp-modal .shahrokh-otp-content {
    font-family: 'Estedad', 'Tahoma', sans-serif !important;
}
