/* SMS Auth Plugin Styles */
.sms-auth-form {
    max-width: 500px;
    margin: 30px 0px;
    padding: 0px;
    background: #fff;
    border-radius: 8px;
    box-shadow: none;
    direction: rtl;
    text-align: right;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
}

.sms-auth-form h3 {
    margin-top: 0;
    margin-bottom: 30px;
    text-align: right;
    color: #443355;
    font-size: 24px;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
    /* تصویر از طریق متغیر CSS تزریق می‌شود تا جابه‌جایی دامنه مشکلی ایجاد نکند */
    background-image: var(--sms-auth-header-bg, none);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 28px 28px;
    padding-right: 0;
}

/* زیرعنوان ورود */
#login-subtitle {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 20px;
    text-align: right;
    color: #443355;
    font-size: 16px;
    font-weight: 400;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
}

.sms-auth-container { width: 100%; }
.sms-auth-field { margin-bottom: 20px; }

.sms-auth-field-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.sms-auth-field-half { flex: 1; }

.sms-auth-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #443355;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
}

/* Label‌های خاص */
#login-mobile-label { color: #443355; }
#verify-otp-label { color: #443355; }

.sms-auth-field input[type="text"],
.sms-auth-field input[type="tel"],
.sms-auth-field-half input[type="text"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #E6E6E6;
    border-radius: 12px;
    height: 48px;
    font-size: 14px;
    font-weight: 400;
    box-sizing: border-box;
    transition: border-color 0.3s;
    color: #333;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
}

.sms-auth-field input[type="text"]::placeholder,
.sms-auth-field input[type="tel"]::placeholder,
.sms-auth-field-half input[type="text"]::placeholder {
    color: #A199AA;
    font-size: 14px;
    font-weight: 400;
    text-align: right;
    direction: rtl;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
}

.sms-auth-field input[type="text"]:focus,
.sms-auth-field input[type="tel"]:focus,
.sms-auth-field-half input[type="text"]:focus {
    outline: none;
    border-color: #9B55C6;
}

/* دکمه‌ها */
.sms-auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: #443355 !important;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    height: 48px;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
}
.sms-auth-submit-btn:hover { background: #352845; }
.sms-auth-submit-btn:disabled { background: #ccc; cursor: not-allowed; }

/* دکمه ثبت‌نام (اگر کلاس جدا دارد) */
.sms-auth-register-btn { background: #9B55C6; }

/* پیام‌ها */
.sms-auth-message {
    margin-top: 15px;
    padding: 0px;
    border-radius: 5px;
  
    font-size: 14px;
}
.sms-auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.sms-auth-message.error
 {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

/* لینک‌های ورود/ثبت‌نام */
.sms-auth-register-link,
.sms-auth-login-link {
    margin-top: 0px;
    text-align: center;
    font-size: 16px;
    font-weight: 400;
}
#login-no-account-text {
    color: #443355;
    font-family: 'Bonyade Koodak FaNum', Tahoma, Arial, sans-serif;
}
#login-register-link {
    color: #9B55C6;
    text-decoration: none;
    font-weight: 400;
    font-size: 16px;
}
.sms-auth-register-link a,
.sms-auth-login-link a {
    color: #9B55C6;
    text-decoration: none;
    font-weight: 400;
    font-size: 16px;
}
.sms-auth-register-link a:hover,
.sms-auth-login-link a:hover { text-decoration: underline; }

/* افکت ورود */
.sms-auth-step { animation: fadeIn 0.3s; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* استایل مرحله تأیید */
.sms-auth-confirmation-message {
    margin-bottom: 20px;
    text-align: right;
}
.sms-auth-confirmation-message p {
    font-size: 16px;
    font-weight: 400;
    color: #443355;
    margin-bottom: 10px;
    text-align: right;
}
.sms-auth-edit-mobile {
    color: #9B55C6;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}
.sms-auth-edit-mobile:hover { text-decoration: underline; }

.sms-auth-resend-container {
    margin-top: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.sms-auth-resend-container #timer-icon {
    width: 16px;
    height: 16px;
    color: #443355;
    flex-shrink: 0;
}
.sms-auth-timer-icon {
    font-size: 16px;
    color: #443355;
}
.sms-auth-timer-text {
    font-size: 14px;
    color: #666;
}
.sms-auth-resend-link {
    background: none;
    border: none;
    color: #9B55C6;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
}
.sms-auth-resend-link:hover { color: #7d3fa8; }

/* دکمه‌های resend قدیمی (اگر استفاده شود) */
.sms-auth-resend-btn {
    width: 100%;
    padding: 12px;
    background: #666;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}
.sms-auth-resend-btn:hover { background: #555; }
.sms-auth-resend-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Loading state */
.sms-auth-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}
.sms-auth-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #9B55C6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 480px) {
    .sms-auth-form {
        margin: 10px;
        padding: 20px;
    }
    .sms-auth-field-row {
        flex-direction: column;
        gap: 0;
    }
    .sms-auth-field-half {
        margin-bottom: 20px;
    }
}

/* اختصاصی برای بدنه تنظیمات در پیشخوان */
.toplevel_page_sms-auth-settings .wrap {
    background: #fdfbff;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #e0d9eb;
    margin-top: 25px;
    max-width: 1000px;
}

.toplevel_page_sms-auth-settings h1 {
    color: #443355;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 40px;
    text-shadow: 1px 1px 0px #fff;
}

/* استایل جدول تنظیمات */
.toplevel_page_sms-auth-settings .form-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 4px 15px rgba(68, 51, 85, 0.08);
    border: 1px solid #eee;
}

.toplevel_page_sms-auth-settings .form-table tr th {
    background: #f8f6fb;
    color: #443355;
    padding: 25px 20px;
    font-weight: 700;
    border-bottom: 1px solid #f0edf5;
    width: 250px;
}

.toplevel_page_sms-auth-settings .form-table tr td {
    padding: 20px;
    border-bottom: 1px solid #f0edf5;
}

/* استایل اینپوت‌ها */
.toplevel_page_sms-auth-settings input[type="text"], 
.toplevel_page_sms-auth-settings input[type="password"],
.toplevel_page_sms-auth-settings input[type="number"] {
    border: 2px solid #e1dae9 !important;
    border-radius: 10px !important;
    padding: 10px 15px !important;
    width: 100%;
    max-width: 400px;
    height: 45px;
    transition: all 0.3s ease;
    background: #fff;
}

.toplevel_page_sms-auth-settings input:focus {
    border-color: #443355 !important;
    box-shadow: 0 0 8px rgba(68, 51, 85, 0.2) !important;
    outline: none;
}

/* توضیحات زیر هر فیلد */
.toplevel_page_sms-auth-settings .description {
    color: #776a85;
    font-style: italic;
    margin-top: 8px;
    font-size: 13px;
}

/* دکمه اصلی ذخیره */
.toplevel_page_sms-auth-settings .submit .button-primary {
    background: #443355 !important;
    border: none !important;
    color: #fff !important;
    padding: 12px 40px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    border-radius: 10px !important;
    height: auto !important;
    box-shadow: 0 4px 12px rgba(68, 51, 85, 0.3) !important;
    margin-top: 20px;
}

.toplevel_page_sms-auth-settings .submit .button-primary:hover {
    background: #5a4570 !important;
    transform: translateY(-2px);
}