/* Base styles and CSS reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --orange-500: hsl(25, 97%, 53%);
  --white: hsl(0, 100%, 100%);
  --grey-500: hsl(217, 12%, 63%);
  --grey-900: hsl(213, 19%, 18%);
  --grey-950: hsl(216, 12%, 8%);

  --transition: 280ms ease-in-out;
  --radial-gradient: closest-corner, hsl(215, 20%, 17%) 0%,
    hsl(216, 24%, 12%) 100%;
}

body {
  font-family: "Overpass", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  background: var(--grey-950);

  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  font-family: "Overpass", sans-serif;
  border: none;
  outline: none;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 384px;
  margin: 0 auto;
}

.card {
  padding: 1.5rem;
  background: radial-gradient(var(--radial-gradient));
  border-radius: 1rem;
}

.rating-card .icon_wrapper {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--grey-900);

  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.rating-card .icon_wrapper img {
  width: 0.875rem;
  height: auto;
}

.card .title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
}

.card .description {
  font-size: 0.875rem;
  color: var(--grey-500);
}

form {
  margin-top: 1rem;
}

fieldset {
  border: none;
  margin-bottom: 1.5rem;
}

.rating-options {
  margin-bottom: 0.75rem;
}

fieldset .error {
  font-size: 0.75rem;
  color: var(--orange-500);
}

fieldset ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

fieldset li label {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--grey-900);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 0.875rem;
  font-weight: 700;
  color: var(--grey-500);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

input[type="radio"]:checked + label {
  background: var(--orange-500);
  color: var(--grey-900);
}

input[type="radio"]:focus + label {
  outline: 2px solid var(--orange-500);
  outline-offset: 2px;
}

fieldset li label:hover {
  background: var(--white);
  color: var(--grey-900);
}

.submit-btn {
  width: 100%;
  border-radius: 999px;
  background: var(--orange-500);
  padding: 1rem 1.5rem;

  font-size: 0.875rem;
  font-weight: 700;
  color: var(--grey-950);
  text-transform: uppercase;
  letter-spacing: 2px;

  transition: background var(--transition);
}

.submit-btn:hover,
.submit-btn:focus {
  background: var(--white);
}

.submit-btn:focus {
  outline: 2px solid var(--orange-500);
  outline-offset: 2px;
}

.thank-you-card {
  padding: 2rem 1.5rem;
  text-align: center;
}

.thank-you-card figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 9rem;
  object-fit: cover;
  margin: 0 auto;
}

.rating {
  display: inline-block;
  margin: 1.5rem 0;
  padding: 0.375rem 0.75rem;
  background: var(--grey-900);
  border-radius: 999px;

  font-size: 0.875rem;
  color: var(--orange-500);
}

@media (min-width: 768px) {
  .container {
    max-width: 416px;
  }

  .card {
    padding: 2rem 1.5rem;
    border-radius: 2rem;
  }

  .rating-card .icon_wrapper {
    width: 3rem;
    height: 3rem;
    margin-bottom: 2rem;
  }

  .rating-card .icon_wrapper img {
    width: 1rem;
  }

  .card .title {
    font-size: 1.75rem;
  }

  .card .description {
    font-size: 1rem;
  }

  fieldset {
    margin-bottom: 2rem;
  }

  fieldset .error {
    font-size: 0.875rem;
  }

  fieldset ul {
    gap: 1.5rem;
  }

  fieldset li label {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1rem;
  }

  .thank-you-card {
    padding: 2.5rem 2rem;
  }

  .thank-you-card figure img {
    max-width: 10.25rem;
  }

  .rating {
    padding: 0.375rem 1.25rem;
    margin: 2.25rem 0;
  }
}
