/* Main form container styling */
.responsive-form-container {
    margin-top: 30px;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    display: block;
    margin: 0 auto;
}

legend {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 25px;
    text-align: center;
    width: 100%;
}

fieldset {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 0;
}

/* Form groups using Flexbox for a clean layout */
.form-group {
    margin-bottom: 20px;
    display: flex;
}

.form-group-column {
    flex-direction: column;
}

.form-group-row {
    flex-direction: row;
    justify-content: space-between;
    gap: 15px;
}

.form-group-column div {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group-row div {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group-row input,
.form-group-row select,
.form-group-row textarea {
    width: 100%;
    box-sizing: border-box;
}

.form-group label {
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
}

/* Styling for all form controls */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    color: #4a5568;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box; /* Crucial for responsive design */
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #4c51bf;
    box-shadow: 0 0 0 3px rgba(76, 81, 191, 0.2);
    outline: none;
}

/* File input styling - limited but consistent */
.form-group input[type="file"] {
    padding: 10px;
    background-color: #f7fafc;
}

/* Buttons container and styling */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.form-actions div{
    display: flex;
    gap: 15px;
}

.form-actions a.button{
    padding: 14px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: block;
    text-align: center;
    text-decoration: none;
}

.form-actions button {
    padding: 14px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: block;
    width:auto;
    min-width:120px;
    text-align: center;
}

.responsive-form-container .error {
    color: var(--soft-red);
    margin-top: 5px;
}

.create-btn, .inStock-btn {
    background-color: var(--create-green);
    color: var(--white);
}

/* Responsive Media Query for smaller screens */
@media (max-width: 600px) {
    .responsive-form-container {
        box-shadow: none;
    }

    .form-group-row {
        flex-direction: column;
        gap: 20px;
    }

    legend {
        font-size: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions button {
        width: 100%;
    }
}
