/* Mobile Responsive Forms */

@media (max-width: 768px) {
    /* Full-width form elements on mobile */
    .form-group,
    .mb-3 {
        margin-bottom: 1.5rem;
    }

    .form-label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        font-size: 0.95rem;
    }

    .form-control,
    .form-select,
    .form-range,
    textarea {
        width: 100% !important;
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: 4px;
        border: 1px solid #ced4da;
    }

    /* Larger touch targets */
    .form-control:focus,
    .form-select:focus,
    textarea:focus {
        padding: 0.75rem;
        font-size: 1rem;
        outline: none;
    }

    /* File input styling */
    .form-control[type="file"] {
        padding: 0.75rem;
    }

    /* Radio and checkbox styling */
    .form-check {
        margin-bottom: 1rem;
        padding-left: 1.75rem;
    }

    .form-check-input {
        margin-top: 0.3rem;
        width: 1.25em;
        height: 1.25em;
        cursor: pointer;
    }

    .form-check-label {
        cursor: pointer;
        padding-left: 0.5rem;
        user-select: none;
    }

    /* Multiple column layouts to single column */
    .row > [class*="col-"] {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Button styling */
    .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        margin-bottom: 0.75rem;
        border-radius: 4px;
        cursor: pointer;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    /* Button groups */
    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        margin-bottom: 0.5rem;
        flex: 1;
    }

    /* Form validation */
    .was-validated .form-control:invalid {
        border-color: #dc3545;
    }

    .was-validated .form-control:invalid:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    }

    .was-validated .form-control:valid {
        border-color: #198754;
    }

    .was-validated .form-control:valid:focus {
        border-color: #198754;
        box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
    }

    /* Invalid feedback */
    .invalid-feedback,
    .valid-feedback {
        display: block;
        font-size: 0.85rem;
        margin-top: 0.25rem;
    }

    .invalid-feedback {
        color: #dc3545;
    }

    .valid-feedback {
        color: #198754;
    }

    /* Input groups */
    .input-group {
        display: flex;
        flex-direction: column;
    }

    .input-group-text {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .input-group-prepend,
    .input-group-append {
        margin-bottom: 0.5rem;
    }

    /* Fieldsets */
    fieldset {
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    legend {
        width: auto;
        padding: 0 0.5rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .form-control,
    .form-select,
    textarea {
        padding: 0.65rem;
        font-size: 1rem;
    }

    .btn {
        padding: 0.65rem;
        font-size: 0.95rem;
    }

    .form-check {
        padding-left: 1.5rem;
    }

    fieldset {
        padding: 0.75rem;
    }
}

/* Print styles */
@media print {
    input:not([type="hidden"]),
    select,
    textarea {
        border: 1px solid #000;
        padding: 0.25rem;
        margin-bottom: 0.5rem;
    }

    button,
    .btn {
        display: none;
    }

    .form-group {
        page-break-inside: avoid;
    }
}
