/* Mobile: 375px - Desktop: 1440px */
/* Family: [Karla](https://fonts.google.com/specimen/Karla) - Weights: 400, 700 */
/* Font size (labels): 16px */

@font-face {
    font-family: 'Karla';
    font-weight: 400;
    src: url('../fonts/static/Karla-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Karla';
    font-weight: 700;
    src: url('../fonts/static/Karla-Bold.ttf') format('truetype');
}

:root {
    /* Primary Colors */
    --green-200: hsl(148, 38%, 91%);
    --green-600: hsl(169, 82%, 27%);
    --red: hsl(0, 66%, 54%);

    /* Neutral Colors */
    --white: hsl(0, 0%, 100%);
    --grey-500: hsl(186, 15%, 59%);
    --grey-900: hsl(187, 24%, 22%);
}

* {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background-color: var(--green-200);
    font-family: 'Karla';
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.form-card {
    background-color: var(--white);
    max-width: 420px;
    margin: 10px;
    padding: 20px;
    border-radius: 10px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin: 1rem;
}

.form > * span:not(.error-message),
.form label span,
.form legend span {
    color: var(--green-600);
}

.form-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--grey-900);
    margin-bottom: 1.5rem;
}

label {
    font-size: 1rem;
    color: var(--grey-900);
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 0;
}

.name {
    display: flex;
    flex-direction: column;
}

.name-field {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.email,
.message {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.name-field {
    gap: 0;
}

.name-field label {
    margin-bottom: 0;
}

input:not([type="checkbox"]):not([type="radio"]) {
    padding: 0.8rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--grey-500);
    font-family: inherit;
    font-size: 1rem;
}


textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--grey-500);
    font-family: inherit;
    font-size: 1rem;
}

input#email {
    width: 100%;
    box-sizing: border-box;
}

input:focus:not([type="checkbox"]):not([type="radio"]),
textarea:focus {
    outline: none;
    border-color: var(--green-600);
}

input.error:not([type="checkbox"]):not([type="radio"]),
textarea.error,
fieldset.error {
    border-color: var(--red);
}

fieldset.error .radio-card {
    border-color: var(--red);
}

fieldset {
    border: none;
}

legend {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--grey-900);
    font-weight: 400;
    padding: 0;
}

.query-type {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#query-type-error {
    margin-top: 0;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem;
    border: 1px solid var(--grey-500);
    border-radius: 6px;
    cursor: pointer;
}

.radio-card input {
    accent-color: var(--green-600);
}

.radio-card input[type="radio"] {
    margin: 0;
    transform: translateY(1px);
}

.radio-card:has(input:checked) {
    background-color: var(--green-200);
    border-color: var(--green-600);
}

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

.checkbox {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    font-size: 1rem;
    margin-bottom: 0;
}

.checkbox .error-message {
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
    margin-top: -10px;
    order: 10;
}

.checkbox input[type="checkbox"] {
    margin: 0;
    padding: 0;
    margin-top: 0.2rem;
    cursor: pointer;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--grey-500);
    border-radius: 4px;
    accent-color: var(--green-600);
}

.checkbox p {
    margin: 0;
    line-height: 1.5;
    color: var(--grey-900);
}

.checkbox.error input[type="checkbox"] {
    border-color: var(--red);
}

.submit {
    padding: 1rem;
    background-color: var(--green-600);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.submit:hover {
    background-color: hsl(169, 82%, 22%);
}

.error-message {
    display: none;
    color: var(--red) !important;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.error-message.show {
    display: block;
}

span.error-message,
.error-message span {
    color: var(--red) !important;
}

.success {
    max-width: calc(100% - 20px);
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: var(--grey-900);
    border-radius: 8px;
    position: relative;
    margin-bottom: -50px;
}

.text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.success-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.success-icon path {
    stroke: var(--white);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
}

.success-text {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--white);
    margin: 0;
    line-height: 1.5;
}

.hidden {
    display: none;
}

@media (min-width: 768px) {
    .form-card {
        max-width: 800px;
        width: 100%;
        padding: 40px;
    }

    .name {
        flex-direction: row;
        gap: 1rem;
    }

    .name-field {
        flex: 1;
    }

    .radio-container {
        flex-direction: row;
        gap: 1rem;
    }

    .radio-container .radio-card {
        flex: 1;
    }
}

@media (min-width: 1440px) {
    .form-card {
        max-width: 800px;
    }

    .form-title h1 {
        font-size: 2.25rem;
    }
}