@import url("https://fonts.googleapis.com/css2?family=Karla:ital,wght@0,200..800;1,200..800&display=swap");

:root {
  /* ### Primary */
  --Green-200: hsl(148, 38%, 91%);
  --Green-600: hsl(169, 82%, 27%);
  --Green-700: hsl(169, 82%, 17%);
  --Red: hsl(0, 66%, 54%);
  /* ### Neutral */
  --White: hsl(0, 0%, 100%);
  --Grey-500: hsl(186, 15%, 59%);
  --Grey-900: hsl(187, 24%, 22%);
}

*,
:before,
:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Karla", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  background-color: var(--Green-200);
  color: var(--Grey-900);
  margin-block: 32px;
}

.container {
  background-color: var(--White);
  width: 91%;
  max-width: 736px;
  padding: 40px;
  border-radius: 10px;
}
.title {
  font-size: 2rem;
  margin-bottom: 30px;
}
form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 26px 16px;
}

.label {
  margin-bottom: 11px;
}
.star {
  color: var(--Green-600);
  margin-bottom: 20px;
}

.first-name-section,
.last-name-section {
  grid-row: 1 / 2;
}
.email-section,
.query-section,
.message-section,
.consent-section,
.submit {
  grid-column: 1 / 3;
}

.text {
  max-width: 320px;
  width: 100%;
  height: 51px;
  border: 1px solid var(--Grey-500);
  border-radius: 8px;
}
.text:focus,
.text:hover,
#email-id:focus,
#email-id:hover,
.text-area:focus,
.text-area:hover {
  outline: 1px solid var(--Green-600);
}
.text,
#email-id,
.text-area {
  padding-inline: 20px;
  font-family: "Karla", sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--Grey-900);
  cursor: pointer;
}

#email-id {
  width: 100%;
  height: 51px;
  border: 1px solid var(--Grey-500);
  border-radius: 8px;
}

fieldset {
  border: none;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 26px 16px;
  margin-top: 19px;
}
.radio-container {
  max-width: 320px;
  height: 51px;
  border: 1px solid var(--Grey-500);
  border-radius: 8px;
  display: flex;
  align-items: center;
  font-size: 1.125rem;
  cursor: pointer;
}
.radio {
  margin-left: 24px;
  margin-right: 16px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  background-color: var(--Green-200);
}
/* Change radio color - accent-color */
/* https://stackoverflow.com/questions/4253920/how-do-i-change-the-color-of-radio-buttons */
input[type="radio"]:checked {
  accent-color: var(--Green-600);
}
.radio-label {
  cursor: pointer;
}

.text-area {
  width: 100%;
  height: 105px;
  border: 1px solid var(--Grey-500);
  border-radius: 8px;
  line-height: 1.5;
  padding-block: 11px;
  resize: none;
  overflow: hidden;
}

.consent-section {
  margin-top: 12px;
  margin-bottom: 4px;
}
.checkbox-grid {
  display: flex;
  align-items: center;
}
.checkbox {
  width: 16px;
  height: 16px;
  margin-right: 20px;
}
.checkbox:checked {
  accent-color: var(--Green-600);
}
.checkbox-label {
  cursor: pointer;
}

.submit {
  font-family: "Karla", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background-color: var(--Green-600);
  color: var(--White);
  border: none;
  height: 59px;
  border-radius: 10px;
}
.submit:hover {
  cursor: pointer;
  background-color: var(--Green-700);
}

/* Pop-up */
.popup {
  display: none;
  position: absolute;
  max-width: 88%;
  top: 24px;
  padding: 24px;
  border-radius: 10px;
  background-color: var(--Grey-900);
  color: var(--White);
}
.success-top {
  display: flex;
  margin-bottom: 15px;
}
.success-title {
  color: var(--White);
  font-size: 1.125rem;
  font-weight: 700;
  margin-left: 10px;
}
.success-message {
  margin-bottom: 3px;
}

/* error */
.error {
  display: none;
  color: var(--Red);
  margin-top: 10px;
}
.text:user-invalid,
#email-id:user-invalid,
.text-area:user-invalid {
  border: 1px solid var(--Red);
}

/* Attribution */
.attribution {
  font-size: 11px;
  text-align: center;
  position: fixed;
  bottom: 10px;
}
.attribution a {
  color: hsl(228, 45%, 44%);
  font-size: 11px;
}

@media screen and (max-width: 404px) {
  .container {
    padding: 24px;
  }

  form {
    display: flex;
    flex-direction: column;
  }

  .options-grid {
    display: flex;
    flex-direction: column;
    grid-gap: 16px;
  }

  .text-area {
    height: 240px;
  }

  .checkbox {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 20px;
  }
}
