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

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    display: grid;
    place-items: center;
    background-color: var(--green-200);
    font-size: 1rem;
    font-weight: 500;
    font-family: "Karla", sans-serif;
    height: 100%;
    margin: 2rem 1rem;
    color: var(--grey-900);
}

.container{
    width: 100%;
    position: relative;
    background-color: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* Header text */
.header-txt {
    font-weight: 700;
    padding-bottom: 2rem;
}

/* input boxes */
input:not(input[type="checkbox"], input[type="radio"]), textarea{
    display: block;
    width: 100%;
    border: 1px solid var(--grey-500);
    border-radius: 0.44rem;
    padding: 0 1.5rem;
    font-size: 1rem;
}

input:not(input[type="checkbox"], input[type="radio"]){
    height: 3rem;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
textarea:hover {
    border-color: var(--green-600);
    cursor: text;
}

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

input[type="checkbox"], input[type="radio"]{
    width: 1.3rem;
    height: 1.3rem;
    accent-color: var(--green-600);
    cursor: pointer;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  box-shadow: 0 0 0 1000px white inset;
}

/* Implementing space between the label and asterisks */
.flex-label{
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Asterisks */
.icon{
    color: var(--green-600);
    font-size: 0.4rem;
}

.form-group{
    display: grid;
    gap: 0.8rem;
}

.form-group:not(:first-child, :nth-child(3)){
    padding: 0.8rem 0;
}

.form-group > .name-group{
    display: grid;
    gap: 0.8rem;
}

/* Textare size control */
textarea{
    resize: none;
}

textarea{
    padding: 1.5rem;
}

/* Success state */
.success-state{
    display: none;
    position: absolute;
    top: 0;
    background-color: var(--grey-900);
    color: white;
    font-weight: 400;
    padding: 0.5rem 1rem;
    line-height: 1.6;
    border-radius: 0.8rem;
    margin: 0 auto;
    margin-right: 1rem;
}

.success-header{
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.success-header h2{
    font-size: 1.1rem;
    font-weight: 500;
}

.success-header i{
    font-size: 1.1rem;
    font-weight: 400;
}

.consent{
    padding: 1.5rem 0;
}

.consent-box{
    display: flex;
    align-items: center;
    gap: 1.3rem;
}

.consent .icon{
    align-items: start;
}

/* Style the Query input box */
.radio-option{
    border: 1px solid var(--grey-500);
    width: 100%;
    height: 3rem;
    border-radius: 0.44rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 1.5rem;
}

.radio-option.selected{
    background-color: var(--green-200);
    border-color: var(--green-600);
}

.radio-option:hover{
    border-color: var(--green-600);
}

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

/* Submit button */
.submit-btn{
    background-color: var(--green-600);
    outline:none;
    border: none;
    width: 100%;
    height: 3.5rem;
    color: var(--white);
    font-family: "Karla", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 0.44rem;
    margin-top: 0.8rem;
}

.submit-btn:hover{
    background-color: var(--grey-900);
}

/* Error color */
.error-message{
    color: var(--red);
}

input.error-border,
textarea.error-border{
    border: 1px solid var(--red) !important;
}

@media (min-width: 48rem){
    .success-state{
        left: 50%;
        transform: translate(-50%);
    }

}

@media (min-width: 64rem){
    body{
        margin: 8rem 0;
    }

    .container{
        width: 45rem;
        padding: 2.5rem;
    }

    .name-field{
        display: flex;
        gap: 1rem;
        width: 100%;
    }

    .name-group{
        flex: 1;
    }

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

    textarea{
        height: 7rem;
    }

    .success-state{
        top: 1rem;
        padding: 1.5rem;
        line-height: 1.9;
    }
}