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

body {
  font-family: 'Karla', sans-serif;
  background-color: hsl(148, 38%, 91%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Container */
.container {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  flex: 1;
  display: flex;
  align-items: center;
}

/* Form */
.form {
  background: hsl(0, 0%, 100%);
  padding: 24px;
  border-radius: 12px;
  width: 100%;
}

h1 {
  margin-bottom: 20px;
  color: hsl(187, 24%, 22%);
}

/* Name row */
.name-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Groups */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

fieldset.form-group {
  border: none;
  padding: 0;
  margin: 0;
}
label, legend {
  margin-bottom: 6px;
  font-size: 16px;
  color: hsl(187, 24%, 22%);
}

/* Inputs */
input, textarea {
  padding: 10px;
  border: 1px solid hsl(186, 15%, 59%);
  border-radius: 6px;
  font-size: 16px;
}

input:focus, textarea:focus {
  outline: 2px solid hsl(169, 82%, 27%);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Radio group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px; /* add spacing here */
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid hsl(186, 15%, 59%);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
}

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

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

/* Checkbox spacing */
.checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Button */
button {
  width: 100%;
  padding: 12px;
  background-color: hsl(169, 82%, 27%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

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

/* Errors */
.error {
  display: none;
  color: hsl(0, 66%, 54%);
  font-size: 14px;
  margin-top: 4px;
}

/* Show errors when active */
.error-active .error {
  display: block;
}

/* Success */
.success {
  margin-top: 16px;
  padding: 12px;
  background-color: hsl(169, 82%, 27%);
  color: white;
  border-radius: 6px;
  display: none;
}

/* Footer */
footer {
  width: 100%;
  text-align: center;
  padding: 10px 0;
  margin-top: auto;
}

.attribution {
  font-size: 11px;
}

.attribution a {
  color: hsl(228, 45%, 44%);
}

/* Desktop layout */
@media (min-width: 768px) {

  .form {
    padding: 32px;
  }

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

  .name-row .form-group {
    flex: 1;
  }

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

  .radio-option {
    flex: 1;
  }
}