/* Authentication Modals Responsive Styles */

/* Modal Responsiveness */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-dialog-centered {
        min-height: calc(100% - 20px);
    }

    .modal-content {
        border-radius: 10px;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }

    .modal-header {
        padding: 1rem 0.75rem;
    }

    .modal-body {
        padding: 1rem 0.75rem;
    }

    .modal-footer {
        padding: 0.75rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }
}

/* Form Responsiveness */
@media (max-width: 768px) {
    .modal-lg .row {
        margin: 0;
    }

    .modal-lg .col-md-6 {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 1rem;
    }
}

/* Input Group Responsiveness */
@media (max-width: 576px) {
    .input-group-prepend .input-group-text {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .input-group-append .btn {
        padding: 0.375rem 0.5rem;
    }
}

/* Button Responsiveness */
@media (max-width: 576px) {
    .modal-footer .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .modal-footer .btn:not(:last-child) {
        margin-right: 0.5rem;
    }
}

/* Alert Responsiveness */
@media (max-width: 576px) {
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Icon Responsiveness */
@media (max-width: 576px) {
    .fa-3x {
        font-size: 2rem !important;
    }
}

/* Form Label Responsiveness */
@media (max-width: 576px) {
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
}

/* Textarea Responsiveness */
@media (max-width: 576px) {
    textarea.form-control {
        min-height: 60px;
    }
}

/* Select Responsiveness */
@media (max-width: 576px) {
    select.form-control {
        font-size: 0.875rem;
    }
}

/* Password Toggle Button */
.password-toggle-btn {
    border-left: none;
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.password-toggle-btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.password-toggle-btn:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* Form Validation */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal Animation Enhancements */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Focus Management */
.modal.show .modal-dialog .form-control:first-of-type {
    animation: focusIn 0.3s ease-out;
}

@keyframes focusIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility Improvements */
.modal-header .close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background-color: #343a40;
        color: #ffffff;
    }

    .modal-header {
        border-bottom-color: #495057;
    }

    .modal-footer {
        border-top-color: #495057;
    }

    .form-control {
        background-color: #495057;
        border-color: #6c757d;
        color: #ffffff;
    }

    .form-control:focus {
        background-color: #495057;
        border-color: #007bff;
        color: #ffffff;
    }

    .input-group-text {
        background-color: #495057;
        border-color: #6c757d;
        color: #ffffff;
    }
}