:root {
    --ms-primary: #667eea;
    --ms-primary-dark: #764ba2;
    --ms-text-primary: #333;
    --ms-text-secondary: #666;
    --ms-border: #ddd;
    --ms-bg-card: #fff;
    --ms-bg-input: #fff;
    --ms-bg-muted: #f8f9fa;
    --ms-bg-captcha: #f5f5f5;
    --ms-border-light: #eee;
    --ms-success: #2e7d32;
    --ms-error: #dc3545;
    --ms-icon: #999;
}

.dark {
    --ms-primary: #818cf8;
    --ms-primary-dark: #a78bfa;
    --ms-text-primary: #f1f5f9;
    --ms-text-secondary: #94a3b8;
    --ms-border: #334155;
    --ms-bg-card: #1e293b;
    --ms-bg-input: #0f172a;
    --ms-bg-muted: #334155;
    --ms-bg-captcha: #334155;
    --ms-border-light: #334155;
    --ms-success: #4ade80;
    --ms-error: #f87171;
    --ms-icon: #64748b;
}
.rb-container-mobile-system *{font-family:inherit;}
.rb-container-mobile-system { margin: auto; max-width: 500px; width: 100%; }
.rb-step { display: none; animation: rbFadeIn 0.3s ease; }
.rb-step.active { display: block; }
@keyframes rbFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.rb-header { text-align: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--ms-border-light); }
.rb-header h2 { margin: 0 0 5px; font-size: 22px; color: var(--ms-text-primary); }
.rb-header p { margin: 0; font-size: 13px; color: var(--ms-text-secondary); }
.rb-header-login, .rb-header-register { text-align: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--ms-border-light); }
.rb-header-login h2, .rb-header-register h2 { margin: 0 0 5px; font-size: 22px; color: var(--ms-text-primary); }
.rb-header-login p, .rb-header-register p { margin: 0; font-size: 13px; color: var(--ms-text-secondary); }
.rb-input-group { margin-bottom: 20px; }
.rb-input-group label { display: block; font-size: 13px; font-weight: 600; color: var(--ms-text-primary); margin-bottom: 8px;text-align:right }
.rb-input-wrapper { position: relative; }
.rb-input-wrapper .rb-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: none; stroke: var(--ms-icon); pointer-events: none; }
.rb-input-wrapper input { width: 100%; padding: 12px 40px 12px 15px; border: 1px solid var(--ms-border); border-radius: 8px; font-size: 14px; box-sizing: border-box; direction: ltr; transition: all 0.3s ease; background: var(--ms-bg-input); color: var(--ms-text-primary); }
.rb-input-wrapper input:focus { outline: none; border-color: var(--ms-primary); }
.rb-input-wrapper textarea { width: 100%; padding: 12px 15px; border: 1px solid var(--ms-border); border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; box-sizing: border-box; background: var(--ms-bg-input); color: var(--ms-text-primary); }
.rb-input-wrapper textarea:focus { outline: none; border-color: var(--ms-primary); }
.rb_state_city { display: flex; gap: 12px; }
.rb_state_city select { flex: 1; padding: 12px 15px; border: 1px solid var(--ms-border); border-radius: 8px; font-size: 14px; background: var(--ms-bg-input); color: var(--ms-text-primary); cursor: pointer; }
.rb_state_city select:focus { outline: none; border-color: var(--ms-primary); }
.rb-captcha-row { display: flex; gap: 12px; align-items: center; }
.rb-captcha-row input { flex: 1; padding: 12px 15px; border: 1px solid var(--ms-border); border-radius: 8px; font-size: 14px; background: var(--ms-bg-input); color: var(--ms-text-primary); }
.rb-captcha-img { flex-shrink: 0; display: flex; align-items: center; gap: 8px; background: var(--ms-bg-captcha); padding: 5px 12px; border-radius: 8px; }
.rb-captcha-img img { height: 38px; border-radius: 5px; }
.rb-captcha-img a { display: flex; }
.rb-captcha-img svg { width: 20px; height: 20px; color: var(--ms-text-secondary); transition: color 0.3s; }
.rb-captcha-img svg:hover { color: var(--ms-primary); }
.rb-ms-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, var(--ms-primary) 0%, var(--ms-primary-dark) 100%); color: white; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s;}
.rb-ms-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.rb-ms-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.rb-timer { text-align: center; padding: 12px; background: var(--ms-bg-muted); border-radius: 8px; margin: 20px 0; font-size: 13px; color: var(--ms-text-secondary); }
.rb-timer span { color: var(--ms-text-secondary); margin-left: 5px; }
.rb-timer strong { color: var(--ms-error); font-size: 18px; font-family: monospace; }
.rb-resend { text-align: center; margin-top: 15px; display: none; }
.rb-resend button { background: none; border: none; color: var(--ms-primary); cursor: pointer; font-weight: 600; }
.rb-resend button:hover { text-decoration: underline; }
.rb-mobile-display { background: var(--ms-bg-muted); padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.rb-mobile-display .mobile-text { color: var(--ms-text-primary); }
.rb-mobile-display strong { color: var(--ms-primary); direction: ltr; display: inline-block; margin: 0 5px; }
.rb-mobile-display .rb-change-btn { background: none; border: 1px solid var(--ms-primary); color: var(--ms-primary); padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.3s; }
.rb-mobile-display .rb-change-btn:hover { background: var(--ms-primary); color: white; }
.rb-code-wrapper { display: flex; gap: 12px; align-items: center; }
.rb-code-wrapper .rb-input-wrapper { flex: 1; }
.rb-code-wrapper input { width: 100%; padding: 12px 15px; border: 1px solid var(--ms-border); border-radius: 8px; font-size: 18px; text-align: center; letter-spacing: 3px; box-sizing: border-box; background: var(--ms-bg-input); color: var(--ms-text-primary); }
.rb-code-wrapper .rb-ms-btn { width: auto; min-width: 80px; flex-shrink: 0; white-space: nowrap; }
.rb-password-strength { margin-top: 8px; font-size: 11px; color: var(--ms-text-secondary); }
.rb-strength-bar { height: 4px; background: var(--ms-border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.rb-strength-bar-fill { width: 0%; height: 100%; transition: width 0.3s; }
.rb-password-match { font-size: 12px; margin-top: 5px; }
.rb-password-match.match { color: var(--ms-success); }
.rb-password-match.not-match { color: var(--ms-error); }
.rb-toggle-link { text-align: center; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--ms-border-light); }
.rb-toggle-link a { color: var(--ms-primary); text-decoration: none; font-size: 13px; cursor: pointer; }
.rb-toggle-link a:hover { text-decoration: underline; }
.rb-back-link { text-align: center; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--ms-border-light); }
.rb-back-link a { color: var(--ms-primary); text-decoration: none; font-size: 13px; }
.rb-back-link a:hover { text-decoration: underline; }
.rb-loading-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; border-top-color: transparent; animation: rbSpin 0.6s linear infinite; margin-left: 8px; vertical-align: middle; }
@keyframes rbSpin { to { transform: rotate(360deg); } }
.rb-otp-login { text-align: center; margin: 10px 0; }
.rb-otp-btn { background: none; border: none; color: var(--ms-primary); cursor: pointer; font-size: 13px; padding: 8px 12px; border-radius: 6px; transition: all 0.3s; }
.rb-otp-btn:hover { background: var(--ms-bg-muted); text-decoration: none; }
.rb-otp-divider { text-align: center; margin: 15px 0; position: relative; font-size: 12px; color: var(--ms-icon); }
.rb-otp-divider::before, .rb-otp-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--ms-border); }
.rb-otp-divider::before { left: 0; }
.rb-otp-divider::after { right: 0; }

/* ==================== responsive ==================== */
@media (max-width: 480px) {
    .rb_state_city { flex-direction: column; }
    .rb-code-wrapper { flex-direction: column; }
    .rb-code-wrapper .rb-ms-btn { width: 100%; }
    .rb-captcha-row { flex-direction: column; }
    .rb-captcha-img { width: 100%; justify-content: center; }
    .rb-mobile-display { flex-direction: column; text-align: center; }
}



/* نمایش نام کاربری در قسمت فراموشی رمز عبور */
.rb-forgot-username-display {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid var(--ms-border);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.dark .rb-forgot-username-display {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.12) 0%, rgba(167, 139, 250, 0.12) 100%);
}

.rb-forgot-username-display .username-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ms-text-primary);
}

.rb-forgot-username-display .username-label svg {
    width: 18px;
    height: 18px;
    stroke: var(--ms-primary);
    stroke-width: 1.8;
    fill: none;
}

.rb-forgot-username-display .username-value {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ms-primary) 0%, var(--ms-primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    direction: ltr;
    display: inline-block;
    letter-spacing: 0.3px;
    padding: 4px 12px;
    background-color: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
}

.dark .rb-forgot-username-display .username-value {
    background-color: rgba(129, 140, 248, 0.15);
}

.rb-forgot-username-simple {
    background: var(--ms-bg-muted);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-right: 3px solid var(--ms-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.rb-forgot-username-simple .simple-label {
    font-size: 13px;
    color: var(--ms-text-secondary);
}

.rb-forgot-username-simple .simple-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--ms-primary);
    direction: ltr;
    background: var(--ms-bg-input);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--ms-border);
}


@media (max-width: 480px) {
    .rb-forgot-username-display {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
    }
    
    .rb-forgot-username-simple {
        flex-wrap: wrap;
    }
}

@keyframes rbSlideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.rb-forgot-username-display,
.rb-forgot-username-simple {
    animation: rbSlideInRight 0.4s ease;
}