.im-login-wrapper {
    max-width: 513px;
    width: 100%;
    margin: 40px auto 12px;
    direction: rtl;
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    font-family: inherit;
}

.im-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.im-login-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 14px;
    border-radius: 14px;
}

.im-login-title {
    font-size: 21px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.im-login-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

.im-login-field-group {
    margin-bottom: 18px;
    text-align: right;
}

.im-login-field-group label {
    display: block;
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
    font-weight: 600;
}

.im-login-required {
    color: #ef4444;
    margin-right: 2px;
}

.im-login-input-wrap {
    position: relative;
}

.im-login-input {
    width: 100%;
    padding: 13px 44px 13px 16px;
    border: 1px solid #e2e8f0;
    background-color: #eef2ff;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.im-login-input--dual {
    padding-left: 44px;
}

.im-login-input::placeholder {
    color: #94a3b8;
}

.im-login-input:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.im-login-input[dir="ltr"] {
    text-align: left;
}

.im-login-input-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    display: flex;
    color: #94a3b8;
    pointer-events: none;
}

.im-login-input-icon svg,
.im-login-toggle svg {
    width: 18px;
    height: 18px;
}

.im-login-toggle {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.im-login-toggle:hover {
    color: #475569;
}

.im-login-toggle .im-login-icon-eye {
    display: flex;
}

.im-login-toggle .im-login-icon-eye-off {
    display: none;
}

.im-login-toggle.is-visible .im-login-icon-eye {
    display: none;
}

.im-login-toggle.is-visible .im-login-icon-eye-off {
    display: flex;
}

.im-login-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    visibility: hidden;
}

.im-login-strength.is-active {
    visibility: visible;
}

.im-login-strength-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    min-width: 34px;
}

.im-login-strength-bars {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-direction: row-reverse;
}

.im-login-strength-seg {
    height: 4px;
    flex: 1;
    background-color: #e2e8f0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.im-login-strength[data-score="1"] .im-login-strength-seg:nth-child(-n+1),
.im-login-strength[data-score="2"] .im-login-strength-seg:nth-child(-n+2),
.im-login-strength[data-score="3"] .im-login-strength-seg:nth-child(-n+3),
.im-login-strength[data-score="4"] .im-login-strength-seg:nth-child(-n+4) {
    background-color: var(--im-strength-color, #2563eb);
}

.im-login-message {
    display: none;
    font-size: 13px;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    text-align: right;
}

.im-login-message.is-error {
    display: block;
    background-color: #fef2f2;
    color: #b91c1c;
}

.im-login-message.is-success {
    display: block;
    background-color: #ecfdf5;
    color: #047857;
}

.im-login-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #1d4ed8;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    margin-top: 6px;
    font-family: inherit;
}

.im-login-submit svg {
    width: 18px;
    height: 18px;
}

.im-login-submit:hover {
    background-color: #1e40af;
}

.im-login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.im-login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 22px 0 4px;
    color: #cbd5e1;
    font-size: 13px;
}

.im-login-divider::before,
.im-login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #e2e8f0;
}

.im-login-divider span {
    padding: 0 14px;
}

.im-login-footer {
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.im-login-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}

.im-login-footer a:hover {
    color: #1d4ed8;
}

.im-login-terms {
    max-width: 600px;
    margin: 0 auto 40px;
    text-align: center;
    direction: rtl;
    font-size: 12px;
    color: #94a3b8;
}

.im-login-terms a {
    color: #94a3b8;
    text-decoration: underline;
}

.im-login-canvas {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    padding: 24px 16px;
    box-sizing: border-box;
}

.im-login-canvas .im-login-wrapper {
    margin: 0 0 12px;
}

.im-login-canvas .im-login-terms {
    margin: 0;
}
/* ردیف مرا به‌خاطر بسپار / فراموشی رمز عبور در فرم ورود */
.im-login-inline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}

.im-login-remember-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
    cursor: pointer;
}

.im-login-forgot-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.im-login-forgot-link:hover {
    color: #1d4ed8;
}

/* ================== ویجت ترکیبی ورود/ثبت‌نام (سوییچ واقعی) ================== */
.im-auth-switcher {
    width: 100%;
}

.im-auth-panel {
    display: none;
}

.im-auth-panel.is-active {
    display: block;
}
