* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



@keyframes royal-float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

.royal-auth-container {
    background: var(--royal-auth-container-bg, #fff);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 950px;
    width: 100%;
    display: flex;
    position: relative;
    z-index: 10;
    min-height: 600px;
}

.royal-auth-side {
    flex: 1;
    background: var(--royal-auth-side-bg, #BCAE7F);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--royal-auth-side-text, #fff);
    position: relative;
    overflow: hidden;
}

.royal-auth-side::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -150px;
    right: -150px;
}

.royal-side-content {
    position: relative;
    z-index: 1;
}

.royal-side-icon {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 50px;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.royal-side-title {
    font-size: var(--royal-auth-side-title-size, 32px);
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

.royal-side-text {
    font-size: var(--royal-auth-side-text-size, 16px);
    line-height: 1.8;
    margin-bottom: 30px;
    opacity: 0.95;
}

.royal-side-button {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    border: 2px solid #fff;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.royal-side-button:hover {
    background: #fff;
    color: #f5576c;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.royal-auth-forms {
    flex: 1;
    padding: 60px 50px;
    position: relative;
    background: var(--royal-auth-form-bg, transparent);
}

.royal-form {
    display: none;
    animation: royal-fade-in 0.5s ease;
}

.royal-form.active {
    display: block;
}

@keyframes royal-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.royal-form-header {
    margin-bottom: 40px;
    text-align: right;
}

.royal-form-title {
    font-size: var(--royal-auth-form-title-size, 32px);
    font-weight: bold;
    color: var(--royal-auth-form-text, #333);
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.royal-form-subtitle {
    color: var(--royal-auth-form-text, #666);
    font-size: 15px;
}

.royal-form-group {
    margin-bottom: 25px;
}

.royal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.royal-form-group label {
    display: block;
    color: var(--royal-auth-form-text, #555);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: var(--royal-auth-form-label-size, 14px);
    text-align: right;
}

.royal-input-wrapper {
    position: relative;
}

.royal-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.royal-password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    user-select: none;
    transition: opacity 0.2s;
}

.royal-password-toggle:hover {
    opacity: 0.7;
}

.royal-field-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    display: none;
    text-align: right;
}

input.error,
select.error {
    border-color: #e74c3c !important;
}

.royal-form-group input,
.royal-form-group select {
    width: 100%;
    padding: 14px 45px 14px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    direction: rtl;
}

.royal-form-group input:focus,
.royal-form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.royal-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--royal-auth-btn-bg, #667eea);
    color: var(--royal-auth-btn-text, #fff);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.royal-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.royal-submit-btn:hover::before {
    left: 100%;
}

.royal-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.royal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.royal-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
    animation: royal-slide-down 0.5s ease;
    direction: rtl;
}

@keyframes royal-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.royal-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.royal-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.royal-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: royal-spin 0.8s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes royal-spin {
    to { transform: rotate(360deg); }
}

.royal-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 30px 0;
    color: #999;
}

.royal-divider::before,
.royal-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.royal-divider span {
    padding: 0 15px;
    font-size: 14px;
}

.royal-forgot-link {
    text-align: center;
    margin-top: 15px;
}

.royal-forgot-link a,
.royal-back-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.royal-forgot-link a:hover,
.royal-back-link a:hover {
    color: #764ba2;
}

.royal-back-link {
    text-align: center;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .royal-auth-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .royal-auth-side {
        padding: 40px 30px;
        order: 2;
    }
    
    .royal-side-icon {
        width: 80px;
        height: 80px;
        font-size: 35px;
        margin-bottom: 20px;
    }
    
    .royal-side-title {
        font-size: 24px;
    }
    
    .royal-side-text {
        font-size: 14px;
    }
    
    .royal-auth-forms {
        padding: 40px 30px;
        order: 1;
    }
    
    .royal-form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    
    .royal-auth-forms {
        padding: 30px 20px;
    }
    
    .royal-form-title {
        font-size: 26px;
    }
    
    .royal-form-group input,
    .royal-form-group select {
        padding: 12px 40px 12px 12px;
    }
}

.royal-password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.royal-password-strength.active {
    display: block;
}

.royal-password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.royal-password-strength-text {
    font-size: 12px;
    margin-top: 5px;
    text-align: right;
}

/* ════════════════════════════════════════
   تب‌های ورود با رمز / پیامک (حالت both)
════════════════════════════════════════ */
.royal-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0;
}
.royal-auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    color: #888;
    transition: all 0.2s;
    margin-bottom: -2px;
    border-radius: 0;
}
.royal-auth-tab:hover { color: #333; }
.royal-auth-tab.active {
    color: var(--royal-auth-btn-bg, #667eea);
    border-bottom-color: var(--royal-auth-btn-bg, #667eea);
    font-weight: 600;
}

/* ════════════════════════════════════════
   فرم SMS-only (بدون پنل کناری)
════════════════════════════════════════ */
.royal-auth-forms--sms-only {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

/* ════════════════════════════════════════
   مراحل OTP
════════════════════════════════════════ */
.royal-sms-sent-notice {
    background: #f0f6ff;
    border: 1px solid #cde0ff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}
.royal-sms-timer-wrap {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin: 8px 0 14px;
}
.royal-sms-timer {
    font-weight: 700;
    color: var(--royal-auth-btn-bg, #667eea);
    font-family: monospace;
    font-size: 15px;
    direction: ltr;
    display: inline-block;
}
.royal-sms-resend-link,
.royal-sms-back-link {
    font-size: 13px;
    color: #888 !important;
    text-decoration: underline;
    cursor: pointer;
}
.royal-sms-resend-link:hover,
.royal-sms-back-link:hover { color: #333 !important; }

/* فیلد کد OTP بزرگ‌تر و وسط‌چین */
.royal-sms-code-input {
    text-align: center !important;
    letter-spacing: 6px;
    font-size: 22px !important;
    font-weight: 700;
}