/* Make content container wider when a form is present */
.content .container:has(form) {
    max-width: 56rem;
}

/* Base form */
form {
    max-width: 54rem;
    width: 100%;
    padding: 1.5rem;
    background: var(--color-code-bg);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
    font-family: var(--font-sans);
}

/* Labels */
label {
    display: block;
    font-weight: 700;
    margin-top: 0.75rem;
    color: var(--color-strong);
}

/* Inputs */
input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.35rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color .3s, box-shadow .3s;
    background-color: #fff;
}

/* Focus state uses theme accent */
input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Textarea */
textarea {
    height: 10rem;
    resize: vertical;
}

/* Fieldset + radio group */
fieldset {
    border: none;
    margin-top: 1rem;
    padding: 0;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 400;
    color: var(--color-text);
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.35rem;
}

/* Submit button – theme coloured */
button,
input[type="submit"],
button[type="submit"],
.btn-primary {
    display: block;
    width: 100%;
    padding: 0.85rem;
    margin-top: 1.25rem;
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s, transform .02s;
}

/* Hover/active based on accent as well */
button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover,
.btn-primary:hover {
    background: color-mix(in srgb, var(--accent) 85%, #000 15%);
}

button:active,
input[type="submit"]:active,
button[type="submit"]:active,
.btn-primary:active {
    transform: translateY(1px);
}

/* Mobile tweaks */
@media (max-width: 720px) {
    .content .container:has(form) {
        max-width: 92vw;
    }

    form {
        margin: 1.25rem auto;
        padding: 1.25rem;
    }

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