:root {
    --green-200: hsl(148, 38%, 91%);
    --green-600: hsl(169, 82%, 27%);
    --green-900: hsl(168, 83%, 14%);
    --red: hsl(0, 66%, 54%);
    --white: hsl(0, 0%, 100%);
    --grey-500: hsl(186, 15%, 59%);
    --grey-900: hsl(187, 24%, 22%);
}

/* RESET */

*, *::before, *::after {
    box-sizing: border-box;
}
  
* {
    margin: 0;
}
  
body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
  
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}
  
input, button, textarea, select {
    font: inherit;
}
  
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}
  
p {
    text-wrap: pretty;
}
  
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

  
/* FONTS */

@font-face {
    font-display: swap; 
    font-family: 'Karla';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/karla-v31-latin-regular.woff2') format('woff2'); 
}

@font-face {
    font-display: swap; 
    font-family: 'Karla';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/karla-v31-latin-700.woff2') format('woff2'); 
}

/* STYLES */

body {
    background-color: var(--green-200);
    font-family: 'Karla', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--grey-900);
    padding: 2rem 1rem;
}

h2 {
    font-size: 1.125rem;
    color: var(--white);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.contact-form {
    max-width: 736px;
    background-color: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: auto;
}

label, legend {
    display: inline-block;
    margin-bottom: 0.5rem;
}

input[type='text'], input[type='email'], textarea {
    border: 1px solid var(--grey-500);
    font-size: 1.125rem;
    padding: 0 1rem;
    border-radius: 0.5rem;
    width: 100%;
    line-height: 2;
}

input[type='text']:hover, input[type='email']:hover, textarea:hover {
    border: 1px solid var(--green-600);
}

textarea {
    resize: none;
}

fieldset {
    border: none;
    padding: 0;
}

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

.query-type {
    cursor: pointer;
    display: flex;
    gap: 2rem;
    border: 1px solid var(--grey-500);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    flex: 1;
}

.query-type label {
    margin: 0;
}

.radio-container {
    position: relative;
}

.radio-container input {
    position: absolute;
    opacity: 0;
    top: 3px;
    left: 0;
    height: 20px;
    width: 20px;
    cursor: pointer;
}

.radio {
    position: absolute;
    top: 3px;
    left: 0;
    height: 20px;
    width: 20px;
    border: 1px solid var(--grey-500);
    border-radius: 50%;
    pointer-events: none;
}

.radio-container input:checked ~ .radio {
    border: 1px solid var(--green-600);
}

.radio:after {
    content: "";
    position: absolute;
    display: none;
}

.radio-container input:checked ~ .radio:after {
    display: block;
}
  
.radio-container .radio:after {
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--green-600);
}

.query-type:has(input[type="radio"]:checked) {
    background-color: var(--green-200);
}

.query-type:has(input[type="radio"]:focus-visible), input[type="text"]:focus-visible, input[type="email"]:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--green-600);
}

.name-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.name-input {
    flex: 1;
}

.error-text {
    color: var(--red);
    margin: 0.2rem 0 0.75rem
}

.required::after {
    content: " *";
    color: var(--green-600);
}

.consent-block {
    display: flex;
    gap: 2rem;
}

.checkbox-container {
    display: block;
    position: relative;
    cursor: pointer;
}
  
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 18px;
    width: 18px;
    top: 3px;
}
  
.checkbox {
    position: absolute;
    top: 3px;
    left: 0;
    height: 18px;
    width: 18px;
    border: 1px solid var(--grey-500);
    pointer-events: none;
}
  
.checkbox:after {
    content: "";
    position: absolute;
    display: none;
}
  
.checkbox-container input:checked ~ .checkbox:after {
    display: block;
}
  
.checkbox-container .checkbox:after {
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    background: url('../images/icon-checkbox-check.svg');
    background-repeat: no-repeat;
    background-position: 0 0;
}

.checkbox:has(~ input[type="checkbox"]:focus-visible) {
    outline: 2px solid var(--green-600);
}

button {
    width: 100%;
    background-color: var(--green-600);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 0;
}

button:hover {
    cursor: pointer;
    background-color: var(--green-900);
}

.hidden {
    visibility: hidden;
}

.success-notification {
    position: fixed;
    background-color: var(--grey-900);
    border-radius: 0.75rem;
    padding: 1.5rem 1rem;
    color: var(--green-200);
    top: 0;
    left: 0;
    right: 0;
    max-width: 450px;
    margin: 1.75rem auto;
}

.success-icon {
    display: inline-block;
    vertical-align: text-bottom;
    margin-right: 0.5rem;
}

footer {
    margin: 2rem auto;
    text-align: center;
}

@media (min-width:768px){

    .query-type-block  {
        flex-direction: row;
    }

   

    .name-block {
        flex-direction: row;
    }

}