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

body {
  font-family: 'Karla', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background-color: hsl(148, 38%, 91%);
  color: hsl(187, 24%, 22%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: 640px;
  position: relative;
}

.contact-form {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 32px;
  color: hsl(187, 24%, 22%);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;

}

label, legend {
  display: block;
  margin-bottom: 8px;
  font-weight: 400;
  color: hsl(187, 24%, 22%);
  font-size: 16px;
}

.required {
  color: hsl(169, 82%, 27%);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid hsl(186, 15%, 59%);
  border-radius: 8px;
  font-family: inherit;
  font-size: 18px;
  transition: border-color 0.3s ease;
  background: white;
  margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  input[type="text"],
  input[type="email"],
  textarea {
    transition: none;
  }
}

input[type="text"]:hover,
input[type="email"]:hover,
textarea:hover {
  border-color: hsl(169, 82%, 27%);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: hsl(169, 82%, 27%);
}

textarea {
  resize: vertical;
  min-height: 240px;
  font-family: inherit;
}

fieldset {
  border: none;
  padding: 0;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.radio-option {
  position: relative;
  border: 1px solid hsl(186, 15%, 59%);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .radio-option {
    transition: none;
  }
}

.radio-option:hover {
  border-color: hsl(169, 82%, 27%);
}

.radio-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  border: 2px solid hsl(186, 15%, 59%);
  border-radius: 50%;
  background: white;
  position: relative;
  flex-shrink: 0;
}

.radio-option label {
  margin: 0;
  cursor: pointer;
  font-size: 18px;
  flex: 1;
}

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

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: hsl(169, 82%, 27%);
  border-radius: 50%;
}

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

.checkbox-group {
  display: block;
}

.checkbox-group .checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  appearance: none;
  border: 2px solid hsl(186, 15%, 59%);
  border-radius: 2px;
  background: white;
  position: relative;
  flex-shrink: 0;
}

.checkbox-group input[type="checkbox"]:checked {
  background-image: url('./assets/images/icon-checkbox-check.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

.checkbox-group label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  font-size: 16px;
}

.submit-btn {
  width: 100%;
  background-color: hsl(169, 82%, 27%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .submit-btn {
    transition: none;
  }
}

.submit-btn:hover {
  background-color: hsl(169, 82%, 20%);
}

.submit-btn:focus {
  outline: 2px solid hsl(169, 82%, 27%);
  outline-offset: 2px;
}

.error-message {
  color: hsl(0, 66%, 54%);
  font-size: 14px;
  margin-bottom: 20px;
  min-height: 0;
  display: none;
}

.error-message:not(:empty) {
  display: block;
}

.form-group {
  margin-bottom: 32px;
}

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

.form-group.error .radio-option,
fieldset.error .radio-option {
  border-color: hsl(0, 66%, 54%);
}

.success-toast {
  position: absolute;
  top: -5rem;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(187, 24%, 22%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  max-width: 450px;
  width: 90%;
}

@media (prefers-reduced-motion: reduce) {
  .success-toast {
    transition: none;
  }
}

.success-toast.show {
  opacity: 1;
  visibility: visible;
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.toast-content img {
  width: 20px;
  height: 20px;
  margin-top: 0.25rem;
}

.toast-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.toast-content p {
  font-size: 16px;
  opacity: 0.9;
}

.attribution {
  font-size: 11px;
  text-align: center;
  margin-top: 2rem;
  color: hsl(186, 15%, 59%);
}

.attribution a {
  color: hsl(169, 82%, 27%);
  text-decoration: none;
}

.attribution a:hover {
  text-decoration: underline;
}

@media (max-width: 48em) {
  .container {
    max-width: 375px;
  }
  
  .contact-form {
    padding: 24px;
  }
  
  h1 {
    font-size: 32px;
    margin-bottom: 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  

  
  .radio-group {
    grid-template-columns: 1fr;
  }
  
  .success-toast {
    top: -3rem;
    width: calc(100% - 2rem);
  }
}

@media (max-width: 30em) {
  body {
    padding: 1rem;
  }
  
  .contact-form {
    padding: 24px;
  }
}
