/* Form and Input Group Fixes */
/* Fixes for registration and login forms */

/* Fix border radius issues on input groups */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

/* Ensure proper border radius on input group elements */
.input-group > .input-group-text {
    border-radius: 0.375rem 0 0 0.375rem !important;
    border: 1px solid #dee2e6;
    border-right: none;
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.input-group > .form-control {
    border-radius: 0 0.375rem 0.375rem 0 !important;
    border: 1px solid #dee2e6;
    border-left: none;
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

/* When there's only form-control without input-group-text */
.form-control:only-child {
    border-radius: 0.375rem !important;
    border: 1px solid #dee2e6;
}

/* Focus states */
.input-group:focus-within > .input-group-text {
    border-color: #86b7fe;
    color: #495057;
    background-color: #fff;
}

.input-group:focus-within > .form-control {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Remove double borders */
.input-group > .form-control:focus {
    z-index: 3;
    border-left: none !important;
}

/* Error states */
.input-group > .form-control.is-invalid {
    border-color: #dc3545;
    border-left: none;
}

.input-group:has(.is-invalid) > .input-group-text {
    border-color: #dc3545;
    color: #dc3545;
}

/* Fix for multiple input groups in a row */
.row .input-group {
    margin-bottom: 0;
}

/* Card border radius fix */
.card {
    border-radius: 0.5rem !important;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-body {
    border-radius: 0;
}

/* Fix for small screens */
@media (max-width: 576px) {
    .input-group > .input-group-text {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .input-group > .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Fix password visibility toggle button */
.input-group > .btn {
    border-radius: 0 0.375rem 0.375rem 0 !important;
    border: 1px solid #dee2e6;
    border-left: none;
    padding: 0.375rem 0.75rem;
}

.input-group > .form-control:not(:last-child) {
    border-radius: 0 !important;
}

.input-group > *:first-child {
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
}

.input-group > *:last-child {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
}

/* Fix for input group with multiple elements */
.input-group > *:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Smooth transitions */
.input-group-text,
.form-control,
.btn {
    transition: border-color 0.15s ease-in-out, 
                box-shadow 0.15s ease-in-out,
                background-color 0.15s ease-in-out;
}

/* Fix select elements in input groups */
.input-group > .form-select {
    border-radius: 0 0.375rem 0.375rem 0 !important;
    border: 1px solid #dee2e6;
    border-left: none;
}

.input-group > .form-select:only-child {
    border-radius: 0.375rem !important;
    border: 1px solid #dee2e6;
}

/* Fix for Bootstrap 5 floating labels */
.form-floating > .form-control {
    border-radius: 0.375rem !important;
}

/* Better visual hierarchy */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease-in-out;
}

/* Fix alert corners */
.alert {
    border-radius: 0.375rem !important;
}

/* Fix button corners in forms */
.btn {
    border-radius: 0.375rem !important;
}

.btn-group > .btn:first-child {
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
}

.btn-group > .btn:last-child {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
}

/* Fix modal corners */
.modal-content {
    border-radius: 0.5rem !important;
    overflow: hidden;
}

.modal-header,
.modal-footer {
    border-radius: 0;
}

/* Ensure consistent spacing */
.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

/* Fix checkbox and radio corners */
.form-check-input {
    border-radius: 0.25em !important;
}

.form-check-input[type="radio"] {
    border-radius: 50% !important;
}