@font-face {
    font-family: "Karla";
    src: url("./assets/fonts/Karla-VariableFont_wght.ttf") format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

:root {
    font-family: "Karla", sans-serif;
    font-size: 16px;
    --green-200-lighter: hsl(148, 38%, 91%);
    --green-600-medium: hsl(169, 82%, 27%);
    --red: hsl(0, 66%, 54%);
    --grey-500-medium: hsl(186, 15%, 59%);
    --grey-900-darker: hsl(187, 24%, 22%);
}

body {
    margin: 0;
    padding: 0;
    background: var(--green-200-lighter);
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

form {
    margin: auto;
    background: white;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
    width: 600px;
    box-sizing: border-box;
}

h1 {
    font-size: 1.8rem;
    margin: 0;
}

.name-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    gap: .4rem;
}

input:is([type="text"], [type="email"]) {
    border-radius: .4rem;
    border: 1px solid var(--grey-500-medium);
    font-family: "Karla", sans-serif;
    padding: .6rem;
    font-size: 1rem;
}

input:is([type="text"], [type="email"]):focus, textarea:focus {
    border: 1px solid var(--green-600-medium);
    outline: none;
}

input:is([type="text"], [type="email"]).error, textarea.error {
    border: 1px solid var(--red);
}

.error-message {
    color: var(--red);
    margin: 0;
}

label, h1, legend {
    color: var(--grey-900-darker);
}

fieldset {
    border: none;
    padding: 0;
}

.radio-container {
    display: flex;
    margin: .6rem 0;
    gap: 1rem;
}

.radio-card{
    width: 100%;
    box-sizing: border-box;
}

input[type="radio"] {
    margin: 0;
    height: 1rem;
    width: 1rem;
}

.radio-card {
    border: 1px solid var(--grey-500-medium);
    flex-grow: 1;
    border-radius: .4rem;
    padding: .8rem 1rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    accent-color: var(--green-600-medium);
}

.radio-card:has(input[type="radio"]:checked) {
    background: var(--green-200-lighter);
    border-color: var(--green-600-medium);
}

.radio-card.checked {
    background: var(--green-200-lighter);
    border: 1px solid var(--green-600-medium);
}

.radio-card, .radio-card * {
    cursor: pointer;
}

textarea {
    resize: vertical;
    border-radius: .4rem;
    padding: .5rem 1rem;
    font-size: 1rem;
    font-family: "Karla", sans-serif;
    line-height: 1.4;
    border: 1px solid var(--grey-500-medium);
    height: 4.2rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: .8rem;
    accent-color: var(--green-600-medium);
    cursor: pointer;
}

.checkbox input {
    width: 1rem;
    height: 1rem;
}

button[type="submit"] {
    font-family: "Karla", sans-serif;
    font-size: 1rem;
    background: var(--green-600-medium);
    color: white;
    border-radius: .4rem;
    border: none;
    padding: 1rem;
    cursor: pointer;
}

button[type="submit"]:hover {
    background: var(--grey-900-darker);
}

.color-green {
    color: var(--green-600-medium);
}

#success-toast {
    position: absolute;
    top: 1rem;
    max-width: 375px;
    box-sizing: border-box;
    background: var(--grey-900-darker);
    color: white;
    border-radius: .8rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#success-toast header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#success-toast h2 {
    font-size: 1rem;
    margin: 0;
}

#success-toast p {
    font-size: .8rem;
}

@media (max-width: 600px) {
    main {
        padding: 1rem;
    }

    form {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .radio-container {
        flex-direction: column;
    }

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