/* استایل کلی فرم ورود */
.mega_check_login_by_sms_holder {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 15px;
}

/* استایل صفحه اصلی ورود */
.mega_check_login_by_sms_holder.main-page {
    height: auto;
    min-height: 400px;
    align-items: flex-end;
    padding: 30px;
    max-width: 470px;
}

/* لوگو */
.mega_check_login_by_sms_holder .brand_logo {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    display: none;
}

.mega_check_login_by_sms_holder .brand_logo img {
    width: 90px;
    height: auto;
}

/* متن خوش‌آمدگویی */
.branch_login_intrance {
    width: 100%;
    text-align: center;
    padding: 0 20px;
    margin: 30px 0px;
}

.branch_login_intrance h1 {
    font-size: 22px;
    font-weight: bold;
    color: #000;
    margin: 0 0 10px 0;
}

.branch_login_intrance h2 {
    font-size: 14px;
    font-weight: 400;
    color: #000;
    margin: 0;
}

/* باکس فرم */
.mega_check_login_by_sms_box {
    width: 100%;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* فیلدهای ورودی */
.mega_check_login_by_sms_box input[type="tel"],
.mega_check_login_by_sms_box input[type="number"],
.mega_check_login_by_sms_box input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
    direction: ltr;
    text-align: center;
}

.mega_check_login_by_sms_box input[type="tel"]:focus,
.mega_check_login_by_sms_box input[type="number"]:focus,
.mega_check_login_by_sms_box input[type="text"]:focus {
    outline: none;
    border-color: #673AB7;
    box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.1);
}

.mega_check_login_by_sms_box input::placeholder {
    color: #999;
    text-align: center;
}

/* دکمه‌ها */
.mega_check_login_by_sms_box button {
    width: 100%;
    padding: 14px 20px;
    background: #673AB7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 10px;
}

.mega_check_login_by_sms_box button:hover {
    background: #5e35b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103, 58, 183, 0.3);
}

.mega_check_login_by_sms_box button:active {
    transform: translateY(0);
}

.mega_check_login_by_sms_box button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.mega_check_login_by_sms_box button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

/* دکمه ارسال مجدد */
.resend-btn {
    background: #9E9E9E !important;
    font-size: 14px !important;
    padding: 10px 15px !important;
    margin-top: 5px;
}

.resend-btn.active {
    background: #FF9800 !important;
    cursor: pointer !important;
}

.resend-btn.active:hover {
    background: #F57C00 !important;
}

.resend-btn .countdown {
    font-weight: bold;
    color: #fff;
}

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

/* پیام‌ها */
.message-box {
    width: 100%;
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.message-box.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.message-box.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

/* لودینگ اورلی */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #673AB7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* فرم ثبت نام */
.register_form {
    width: 100%;
}

.un_user {
    font-size: 18px;
    color: #333;
    text-align: center;
    margin: 0 0 20px 0;
    font-weight: bold;
}

/* پیام راهنما OTP */
.otp-instruction {
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.otp-instruction strong {
    color: #673AB7;
    direction: ltr;
    display: inline-block;
}

/* ریسپانسیو */
@media (max-width: 480px) {
    .mega_check_login_by_sms_holder {
        max-width: 100%;
        padding: 15px;
    }
    
    .mega_check_login_by_sms_holder.main-page {
        border-radius: 20px;
        min-height: 350px;
    }
    
    .branch_login_intrance h1 {
        font-size: 18px;
    }
    
    .branch_login_intrance h2 {
        font-size: 12px;
    }
    
    .mega_check_login_by_sms_box {
        padding: 15px;
    }
}

/* حالت RTL */
body.rtl .mega_check_login_by_sms_box input {
    direction: rtl;
}

body.rtl .mega_check_login_by_sms_box input[type="tel"] {
    direction: ltr;
    text-align: left;
}

/* ==========================================
   استایل‌های سیستم ورود دوگانه
   ========================================== */

/* تب‌های ورود */
.bl-login-tabs {
    display: flex;
    gap: 0;
    margin: 0px 0px !important;
    padding: 0;
    background: #fff;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bl-tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

.bl-tab-btn:hover {
    background: #eee;
    color: #333;
}

.bl-tab-btn.active {
    background: #fff;
    color: #673AB7;
    border-bottom-color: #673AB7;
}

.bl-tab-icon {
    font-size: 18px;
}

/* محتوای تب‌ها */
.bl-tab-content {
    background: #fff;
    border-radius: 0 0 12px 12px;
    margin-top: -1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bl-tab-content.mega_check_login_by_sms_box {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
}

/* فرم‌های رمز عبور */
.bl-password-login-box,
.bl-forgot-password-box,
.bl-register-password-box {
    position: relative;
}

.bl-password-login-box input,
.bl-forgot-password-box input,
.bl-register-password-box input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
}

.bl-password-login-box input[type="tel"],
.bl-forgot-password-box input[type="tel"],
.bl-register-password-box input[type="tel"] {
    direction: ltr;
    text-align: center;
}

.bl-password-login-box input[type="password"],
.bl-forgot-password-box input[type="password"],
.bl-register-password-box input[type="password"] {
    direction: ltr;
    text-align: left;
}

.bl-password-login-box input:focus,
.bl-forgot-password-box input:focus,
.bl-register-password-box input:focus {
    outline: none;
    border-color: #673AB7;
    box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.1);
}

.bl-password-login-box input::placeholder,
.bl-forgot-password-box input::placeholder,
.bl-register-password-box input::placeholder {
    color: #999;
    text-align: center;
}

/* دکمه‌ها در فرم‌های رمز */
.bl-password-login-box button,
.bl-forgot-password-box button,
.bl-register-password-box button {
    width: 100%;
    padding: 14px 20px;
    background: #673AB7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 10px;
}

.bl-password-login-box button:hover,
.bl-forgot-password-box button:hover,
.bl-register-password-box button:hover {
    background: #5e35b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103, 58, 183, 0.3);
}

.bl-password-login-box button:disabled,
.bl-forgot-password-box button:disabled,
.bl-register-password-box button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* لینک‌های فراموشی رمز و ثبت‌نام */
.bl-password-links {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.bl-password-links a {
    color: #673AB7;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.bl-password-links a:hover {
    color: #5e35b1;
    text-decoration: underline;
}

.bl-divider {
    color: #ddd;
    font-size: 12px;
}

/* لینک بازگشت */
.bl-back-link {
    display: block;
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bl-back-link:hover {
    color: #673AB7;
}

/* عنوان و توضیحات فرم */
.bl-form-title {
    font-size: 18px;
    color: #333;
    text-align: center;
    margin: 0 0 10px 0;
    font-weight: bold;
    width: 100%;
}

.bl-form-desc {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin: 0 0 20px 0;
    line-height: 1.6;
    width: 100%;
}

.bl-form-hint {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 10px;
    width: 100%;
}

/* کانتینر تب رمز عبور */
.bl-password-tab-container {
    background: #fff;
    border-radius: 0 0 12px 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* زیرفرم‌ها */
.bl-subform {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}

/* پیام‌ها برای فرم‌های رمز */
.bl-password-login-box .message-box,
.bl-forgot-password-box .message-box,
.bl-register-password-box .message-box {
    width: 100%;
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

/* لودینگ */
.bl-password-login-box .spinner-overlay,
.bl-forgot-password-box .spinner-overlay,
.bl-register-password-box .spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

/* ریسپانسیو برای تب‌ها */
@media (max-width: 480px) {
    .bl-login-tabs {
        flex-direction: column;
        border-radius: 12px 12px 0 0;
    }

    .bl-tab-btn {
        border-bottom: none;
        border-right: 3px solid transparent;
    }

    .bl-tab-btn.active {
        border-right-color: #673AB7;
        border-bottom-color: transparent;
    }

    .bl-password-links {
        flex-direction: column;
        gap: 10px;
    }

    .bl-divider {
        display: none;
    }
}

/* لینک رد کردن تنظیم رمز */
.bl-skip-password-link {
    display: block;
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bl-skip-password-link:hover {
    color: #666;
    text-decoration: underline;
}