fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Container sizing and centering */
.form-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    border: var(--border-string);
    border-radius: 8px;
    background-color: var(--card-background-color);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.03);
}

/* Individual field spacing */
.field-group {
    margin-bottom: 1.25rem;
}

/* Questionnaire question card */
.questionnaire .form-group {
    background-color: #fff;
    border: var(--border-string);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 1.25rem;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.03);
}

.questionnaire .form-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.75rem;
    font-family: "DM Sans", sans-serif;
}

/* Label styling */
.field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

/* Input & Textarea styling */
.form-control,
.field-group input[type="text"],
.field-group input[type="datetime-local"],
.field-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: var(--border-string);
    border-radius: 4px;
    box-sizing: border-box; 
    font-size: 1rem;
}

.field-group textarea {
    min-height: 100px;
    resize: vertical;
}

.field-group select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: var(--border-string);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.field-group input[type="submit"] {
    background-color: var(--primary-action-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: var(--primary-action-border-string);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-action-border-color);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    width: 100%;
}

.field-group input[type="submit"]:hover {
    background-color: var(--primary-action-highlight-color);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--border-color);
}

.field-group input[type="submit"]:active {
    transform: translateY(4px);
    box-shadow: none;
}

button.cancel {
    appearance: none;
    -webkit-appearance: none;
    background: rgb(255, 254, 254);
    color: black;
    padding: 0.75rem 1.5rem;
    border: var(--border-string);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--border-color);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
    width: 100%;
}

button.cancel:hover {
    background: rgb(196, 196, 196);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--border-color);
}

button.cancel:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Focus states for accessibility */
.field-group input:focus,
.field-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Submit button */
.submit-button, button.submit-button {
    appearance: none;
    -webkit-appearance: none;
    background: var(--primary-action-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: var(--primary-action-border-string);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-action-border-color);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
    width: 100%;
}

.submit-button:hover, button.submit-button:hover {
    background: var(--primary-action-highlight-color);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-action-border-color);
}

.submit-button:active, button.submit-button:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Segmented control */
.segmented-control {
    display: flex;
    border: var(--border-string);
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
    box-shadow: inset 6px 6px 0px rgba(6, 6, 6, 0.1);
}

.segmented-control__input {
    display: none;
}

.segmented-control__button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    transition: background 0.4s ease, color 0.3s ease;
    border-radius: 3px;
    width: 50%; 
}

.segmented-control__button:hover {
    background: var(--primary-action-highlight-color);
}

.segmented-control__button:last-child {
    border-right: none;
}


.segmented-control__button--active {
    background: var(--primary-action-color);
    color: #fff;
    border: var(--primary-action-border-string);
    transform: translateY(-2px);
    box-shadow:
        1px 2px 0 var(--primary-action-border-color),
        0px 2px 0 var(--primary-action-border-color),
        4px 8px 0 rgba(6, 6, 6, 0.1);
}

/* Error messages */
.error-explanation {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.error-explanation h2 {
    font-size: 1rem;
    margin-top: 0;
}

.error-explanation ul {
    margin-bottom: 0;
}

.form-check {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border: var(--secondary-action-border-string);
    border-radius: 4px;
    margin-top: 0;
    min-height: 3rem;
    flex: 1 1 calc(33.33% - 0.34rem);
    min-width: calc(33.33% - 0.34rem);
    box-shadow: 0 4px 0 var(--secondary-action-border-color);
    background-color: #24947f0d;
    cursor: pointer;
}

.form-check-label {
    flex: 1;
    line-height: 1.3;
}

.form-check-input {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    border: 2px solid #000;
    border-radius: 2px;
    cursor: pointer;
    background-color: transparent;
}

.form-check-input:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 6l3 3 5-5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.form-check:hover {
    box-shadow: 0 2px 0 var(--secondary-action-border-color);
    background-color: #24947f27;
}

.form-check:active {
    box-shadow: 0 0 0 var(--secondary-action-border-color);
    background-color: #24947f27;
}

.form-check:has(input:checked) {
    background-color: #24947f93;
    box-shadow: none;
    transform: translateY(4px);
}