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

img {
  display: block;
  max-width: 100%;
}

html {
  background-color: hsl(148, 38%, 91%);
}

.container {
  background-color: hsl(0, 0%, 100%);
  border-radius: 0.6rem;
  box-sizing: border-box;
  margin: 5rem auto 1.25rem;
  max-width: 31.25rem;
  padding: 1.6rem;
  width: 90%;
}

h1 {
  color: hsl(187, 24%, 22%);
  font-family: karla, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.contact-form {
  color: hsl(187, 24%, 22%);
  font-family: karla, sans-serif;
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.03em;
}

span.required {
  color: hsl(169, 82%, 27%);
  margin-left: 0.25rem;
}

.name-row,
.user-details {
  flex: 1;
}
.name-row {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 1.125rem;
}

.user-details label,
.query-type {
  display: block;
  margin-bottom: 0.375rem;
}

.user-details input,
.user-details textarea {
  cursor: pointer;
  border: 1px solid hsl(186, 15%, 59%);
  border-radius: 5px;
  box-sizing: border-box;
  font-family: inherit;
  padding: 0.5rem 0.625rem;
  transition: all 0.2s ease-in-out;
  width: 100%;
}

.user-details input:hover,
.user-details textarea:hover {
  border-color: hsl(169, 82%, 27%);
}

.user-details input:focus,
.user-details textarea:focus,
.user-details input:not(:placeholder-shown),
.user-details textarea:not(:placeholder-shown) {
  outline: none;
  border-color: hsl(169, 82%, 27%);
}

input[type="email"] {
  margin-bottom: 0.25rem;
}

.radio-group {
  display: flex;
  gap: 0.625rem;
  margin-top: 0.375rem;
  margin-bottom: 0.25rem;
}

.radio-option {
  align-items: center;
  cursor: pointer;
  display: flex;
  border: 1px solid hsl(186, 15%, 59%);
  border-radius: 5px;
  flex: 1;
  padding: 0.5rem 0.625rem;
  transition: all 0.2s ease-in-out;
}

.radio-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(187, 24%, 22%);
}

.radio-option input {
  color: hsl(187, 24%, 22%);
  margin-right: 1.125rem;
  width: auto;
}

.radio-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid hsl(186, 15%, 59%);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  height: 0.875rem;
  margin-right: 1.125rem;
  place-content: center;
  width: 0.875rem;
}
@media (hover: hover) {
  .radio-option:hover,
  .radio-option:focus-within {
    background-color: hsl(148, 38%, 91%);
    border-color: hsl(169, 82%, 27%);
  }
  .radio-option:hover input[type="radio"],
  .radio-option input[type="radio"]:focus {
    border-color: hsl(169, 82%, 27%);
    outline: none;
  }
}
.radio-option input[type="radio"]::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  background-color: hsl(169, 82%, 27%);
}

.radio-option input[type="radio"]:checked::before {
  transform: scale(1);
}

.radio-option:has(input:checked) {
  background-color: hsl(148, 38%, 91%);
  border-color: hsl(169, 82%, 27%);
}

.radio-option input[type="radio"]:checked {
  border-color: hsl(169, 82%, 27%);
}

textarea {
  resize: vertical;
}

.consent-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.625rem;
  gap: 0.625rem;
  margin: 1.25rem 0;
}

.consent-group input[type="checkbox"] {
  appearance: none;
  border: 1px solid hsl(186, 15%, 59%);
  cursor: pointer;
  display: grid;
  flex-shrink: 0;
  height: 0.75rem;
  place-content: center;
  -webkit-appearance: none;
  width: 0.75rem;
}

.consent-group input[type="checkbox"]:checked {
  background-color: hsl(169, 82%, 27%);
  border-color: hsl(169, 82%, 27%);
}

.consent-group input[type="checkbox"]:checked::after {
  color: hsl(148, 38%, 91%);
  content: "✔";
  font-size: 0.5rem;
}

.consent-group label {
  cursor: pointer;
  white-space: nowrap;
}

.submit-button button[type="submit"] {
  color: hsl(148, 38%, 91%);
  cursor: pointer;
  background-color: hsl(169, 82%, 27%);
  border: none;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.75rem 1.25rem;
  transition: background-color 0.3s ease;
  width: 100%;
}

.submit-button button:hover {
  background-color: hsl(187, 24%, 22%);
}

.user-details input,
.user-details textarea,
input[type="email"],
.radio-group {
  margin-bottom: 0px;
}

.error-text {
  color: hsl(0, 66%, 54%);
  display: none;
  font-size: 0.6rem;
  margin-top: 0.25rem;
  margin-bottom: 0.875rem;
}

.user-details.error .error-text,
.radio-group.error + .error-text,
.consent-group.error .error-text {
  display: block;
}
.consent-group .error-text {
  margin-top: 0px;
  margin-bottom: 0.5rem;
  width: 100%;
}

.user-details.error input,
.user-details.error textarea,
.radio-group.error .radio-option {
  border-color: hsl(0, 66%, 54%);
}

.user-details.error,
.radio-group.error {
  margin-bottom: 0.25rem;
}

.user-details:not(.error),
.radio-group:not(.error),
.name-row:not(.error) {
  margin-bottom: 1.125rem;
}

.name-row > .user-details {
  margin-bottom: 0 !important;
}

.name-row:has(.error) {
  margin-bottom: 0.25rem;
}

.sent-popup {
  display: none;
  background-color: hsl(187, 24%, 22%);
  border-radius: 5px;
  color: hsl(0, 0%, 100%);
  font-family: karla, sans-serif;
  font-size: 0.75rem;
  padding: 0.9375rem;
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
}

.sent-popup.show {
  animation: slideIn 0.5s ease-out;
  display: block !important;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.message-header h2 {
  font-size: 0.75rem;
  margin: 0;
}

.message-content p {
  font-size: 0.5rem;
  margin: 0;
  color: hsl(186, 15%, 59%);
}

@keyframes slideIn {
  from {
    top: -100px;
    opacity: 0;
  }
  to {
    top: 1.25rem;
    opacity: 1;
  }
}

/* <!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
    <style>
      .attribution {
        font-size: 11px;
        text-align: center;
      }
      .attribution a {
        color: hsl(228, 45%, 44%);
      }
*/

@media (max-width: 48rem) {
  .name-row,
  .radio-group {
    flex-direction: column;
    margin-bottom: 1.125rem !important;
  }
  .name-row .user-details:first-child:not(.error) {
    margin-bottom: 0.5rem !important;
  }
  .name-row .user-details:first-child.error {
    margin-bottom: 0.25rem !important;
  }
  .name-row .user-details:last-child {
    margin-bottom: 0px !important;
  }
  .user-details textarea {
    height: 12.5rem;
  }
  .name-row .user-details.error .error-text {
    margin-bottom: 0px;
  }
}
