/* Form Styling */
form {
    max-width: 100%;
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-field-label-wrapper {
    margin-bottom: 0.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-color, #333);
    margin-bottom: 0.25rem;
}

.form-label.required::after {
    content: " *";
    color: #dc3545;
}

.form-input,
.form-textarea,
.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    color: #495057;
    background-color: #fff;
    border-color: var(--primary-color, #2c5f7f);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(44, 95, 127, 0.25);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
}

/* Radio & Checkbox */
.form-radio,
.form-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-radio input[type="radio"],
.form-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.form-radio label,
.form-checkbox label {
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

/* Form Buttons */
.form-button-wrapper {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-button {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
    background-color: var(--primary-color, #2c5f7f);
    color: white;
}

.form-button:hover {
    background-color: var(--primary-hover-color, #1e4057);
}

.form-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Form Errors */
.form-errors {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.form-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.form-errors li {
    margin-bottom: 0.25rem;
}

.form-errors li:last-child {
    margin-bottom: 0;
}

/* Field with Error */
.form-field.has-error .form-input,
.form-field.has-error .form-textarea,
.form-field.has-error .form-select {
    border-color: #dc3545;
}

.form-field.has-error .form-input:focus,
.form-field.has-error .form-textarea:focus,
.form-field.has-error .form-select:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Success Message */
.form-success {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
}

/* Responsive */
@media (max-width: 768px) {
    .form-button-wrapper {
        flex-direction: column;
    }

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