/*
 * فایل رفع مشکلات Responsive برای صفحات احراز هویت
 * این فایل مشکلات نمایش در موبایل برای صفحات Login، Register و ... را برطرف می‌کند
 */

/* ================================================
   بهبود صفحات Auth در موبایل
   ================================================ */

@media (max-width: 991.98px) {
    #layoutAuthentication {
        background-attachment: scroll !important;
        background-position: center !important;
    }

    #layoutAuthentication_content {
        padding: 1rem 0;
    }

    /* کارت‌های auth */
    .card {
        margin: 1rem 0.5rem;
    }

    /* لوگو */
    .card-body img[width="128"] {
        width: 96px !important;
        height: auto;
    }
}

@media (max-width: 767.98px) {
    .col-lg-5,
    .col-lg-6,
    .col-lg-7,
    .col-lg-8 {
        max-width: 100%;
        padding: 0 1rem;
    }

    .card {
        border-radius: 1rem;
        margin: 0.5rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1.5rem 1rem;
    }

    .auth-input {
        font-size: 16px !important; /* جلوگیری از zoom در iOS */
        padding: 0.75rem 1rem;
    }

    /* دکمه‌ها */
    .btn {
        font-size: 16px !important;
        padding: 0.75rem 1rem;
    }

    /* لوگو */
    .card-body img[width="128"] {
        width: 80px !important;
    }
}

@media (max-width: 575.98px) {
    .container-xl {
        padding: 0 0.5rem;
    }

    .card {
        margin: 0.25rem;
        box-shadow: none !important;
    }

    .mt-10 {
        margin-top: 2rem !important;
    }

    /* فرم‌ها */
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    /* action links */
    .action-link {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
}

/* ================================================
   بهبود صفحات Register
   ================================================ */

@media (max-width: 991.98px) {
    /* steps در register */
    .stepper,
    .wizard-steps {
        flex-wrap: wrap;
    }

    .step-item {
        font-size: 0.85rem;
    }

    /* فرم‌های چند مرحله‌ای */
    .step-content {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .stepper-item {
        min-width: 100px;
        font-size: 0.8rem;
    }

    .stepper-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* فرم fields */
    .row.g-3 {
        row-gap: 0.75rem !important;
    }
}

@media (max-width: 575.98px) {
    /* مخفی کردن یا کوچک کردن عناصر غیرضروری */
    .stepper-label {
        display: none;
    }

    .stepper-number {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
}

/* ================================================
   رفع مشکل overflow
   ================================================ */

@media (max-width: 991.98px) {
    body {
        overflow-x: hidden;
    }

    .container-xl {
        overflow-x: hidden;
    }
}

/* ================================================
   بهبود alert ها
   ================================================ */

@media (max-width: 575.98px) {
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
        margin: 0.5rem 0;
    }
}

/* ================================================
   بهبود card برای landscape mode در موبایل
   ================================================ */

@media (max-width: 991.98px) and (max-height: 600px) and (orientation: landscape) {
    .card {
        margin: 0.5rem 0;
    }

    .card-body {
        padding: 1rem;
    }

    .card-body img {
        max-width: 64px !important;
    }

    .auth-input,
    .btn {
        padding: 0.5rem 0.75rem;
    }
}

/* ================================================
   رفع مشکل تصاویر background
   ================================================ */

@media (max-width: 575.98px) {
    #layoutAuthentication {
        background-size: cover;
        background-position: center;
    }

    /* شفافیت بیشتر برای کارت در موبایل */
    .card {
        opacity: 0.98 !important;
    }
}

/* ================================================
   بهبود form validation
   ================================================ */

.invalid-feedback,
.valid-feedback {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

@media (max-width: 575.98px) {
    .invalid-feedback,
    .valid-feedback {
        font-size: 0.8rem;
    }
}

/* ================================================
   بهبود password strength indicator
   ================================================ */

@media (max-width: 575.98px) {
    .password-strength {
        height: 3px;
    }

    .password-strength-text {
        font-size: 0.75rem;
    }
}

/* ================================================
   بهبود checkbox و radio buttons
   ================================================ */

@media (max-width: 575.98px) {
    .form-check {
        padding-right: 1.5rem;
    }

    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }

    .form-check-label {
        font-size: 0.9rem;
    }
}

/* ================================================
   رفع مشکل modal در auth pages
   ================================================ */

@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 0.75rem;
    }
}
