/* ============================================
   استایل‌های پایه صفحات مهمان (Guest Pages)
   شامل: لاگین، ثبت‌نام، فراموشی رمز، ریست رمز، تایید ایمیل
   ============================================ */

.input-group {
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

/* -------------------- استایل‌های اصلی -------------------- */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: var(--app-font-family);
}

/* کارت اصلی احراز هویت */
.auth-card {
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* برند در صفحات احراز هویت */
.auth-brand {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-decoration: none !important;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

a.auth-brand:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none !important;
    transform: scale(1.05);
}

/* -------------------- آواتر دایره‌ای -------------------- */
.avatar-circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.avatar-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.avatar-circle i {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* -------------------- استایل‌های فرم -------------------- */
.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-inline-end: none;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.form-control {
    border-inline-start: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #86b7fe;
    box-shadow: none;
}

.form-control:focus+.input-group-text,
.input-group:focus-within .input-group-text {
    border-color: #86b7fe;
    background-color: #fff;
}

/* فوکوس روی کل اینپوت گروه */
.input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-radius: 0.5rem;
}

/* لیبل‌ها */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #495057;
    letter-spacing: normal;
    text-align: right;
}

/* -------------------- دکمه‌ها -------------------- */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* دکمه نمایش رمز عبور */
.toggle-password {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    border-inline-start: none;
}

.toggle-password:hover {
    background-color: #f8f9fa;
    border-color: #86b7fe;
}

/* دکمه بررسی نام کاربری */
.check-username-btn {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    border-inline-start: none;
}

.check-username-btn:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* دکمه در حالت غیرفعال */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* -------------------- آلرت‌ها -------------------- */
.alert {
    border: none;
    border-radius: 0.75rem;
    animation: slideDown 0.3s ease-out;
    padding: 1rem;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdef5 100%);
    color: #0c5460;
    border-left: 4px solid #0d6efd;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* انیمیشن آلرت */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------- پیام‌های خطا و اعتبارسنجی -------------------- */
.invalid-feedback {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: #dc3545;
}

.invalid-feedback.d-block {
    display: block;
}

/* پیام‌های وضعیت (موفقیت/خطا) */
#username-availability,
#password-match-message {
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #0d6efd !important;
}

/* -------------------- پروگرس بار قدرت رمز عبور -------------------- */
.progress {
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    height: 4px;
}

.progress-bar {
    transition: width 0.3s ease, background-color 0.3s ease;
}

.progress-bar.bg-danger {
    background-color: #dc3545 !important;
}

.progress-bar.bg-warning {
    background-color: #ffc107 !important;
}

.progress-bar.bg-success {
    background-color: #28a745 !important;
}

.progress-bar.bg-secondary {
    background-color: #6c757d !important;
}

/* -------------------- الزامات رمز عبور -------------------- */
#password-requirements {
    font-size: 0.7rem;
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

#password-requirements div[class*="col-"]>div {
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

#password-requirements div[class*="col-"]>div:hover {
    transform: translateX(3px);
}

/* -------------------- کارت نکات مفید -------------------- */
.card.bg-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.card.bg-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* لیست نکات */
ul li {
    list-style-type: none;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

ul li:hover {
    transform: translateX(5px);
    color: #0d6efd;
}

/* -------------------- جداکننده با متن وسط -------------------- */
.hr-divider {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    border: none;
    border-top: 1px solid #dee2e6;
}

.position-relative {
    position: relative;
}

/* -------------------- فیلد فقط خواندنی -------------------- */
input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

input[readonly]:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

/* -------------------- ریسپانسیو -------------------- */
@media (max-width: 576px) {
    .auth-card .card-body {
        padding: 1.5rem !important;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .form-control,
    .input-group-text {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .avatar-circle {
        width: 55px;
        height: 55px;
    }

    .avatar-circle i {
        font-size: 1.5rem;
    }

    .auth-brand {
        font-size: 1.5rem;
    }

    h5.card-title {
        font-size: 1.2rem;
    }

    .d-flex.flex-column.flex-sm-row {
        gap: 0.75rem !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* -------------------- انیمیشن‌های اضافی -------------------- */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.btn:disabled {
    animation: pulse 1.5s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.alert {
    animation: fadeIn 0.5s ease-out, slideDown 0.3s ease-out;
}

/* -------------------- اسکرول بار سفارشی -------------------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
}

/* -------------------- لینک‌ها -------------------- */
a {
    transition: all 0.2s ease;
}

a:hover {
    text-decoration: underline !important;
}

.text-decoration-none:hover {
    text-decoration: none !important;
}

/* -------------------- فوتر صفحات مهمان -------------------- */
.text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.text-white-50:hover {
    color: white !important;
}



/* margin-right معادل ms-* */
.ms-0 {
    margin-right: 0 !important;
}

.ms-1 {
    margin-right: 0.25rem !important;
}

.ms-2 {
    margin-right: 0.5rem !important;
}

.ms-3 {
    margin-right: 1rem !important;
}

.ms-4 {
    margin-right: 1.5rem !important;
}

.ms-5 {
    margin-right: 3rem !important;
}

.ms-auto {
    margin-right: auto !important;
}

/* padding-right معادل ps-* */
.ps-0 {
    padding-right: 0 !important;
}

.ps-1 {
    padding-right: 0.25rem !important;
}

.ps-2 {
    padding-right: 0.5rem !important;
}

.ps-3 {
    padding-right: 1rem !important;
}

.ps-4 {
    padding-right: 1.5rem !important;
}

.ps-5 {
    padding-right: 3rem !important;
}

.auth-container-width {
    max-width: 440px;
}

.site-logo-sm {
    width: 50px;
    height: auto;
}
