@import url("https://fonts.googleapis.com/css2?family=Overpass:wght@400;600;700&display=swap");

:root {
  /* Text Preset 1 */
  --text-1: 700 28px/35px "Overpass", sans-serif;

  /* Text Preset 2 */
  --text-2: 700 24px/30px "Overpass", sans-serif;

  /* Text Preset 3 */
  --text-3: 700 16px/24px "Overpass", sans-serif;
  --text-3-ls: 0.2px;
  /* Preset 4 – Bold */
  --text-4-bold: 700 15px/19px "Overpass", sans-serif;
  --text-4-bold-ls: 2px;
  /* Preset 4 – Regular */
  --text-4-regular: 400 15px/24px "Overpass", sans-serif;
  --text-4-regular-ls: 0px;
  /* Preset 5 – Bold */
  --text-5-bold: 700 14px/18px "Overpass", sans-serif;
  --text-5-bold-ls: 1.87px;
  /* Preset 5 – SemiBold */
  --text-5-semibold: 600 14px/24px "Overpass", sans-serif;
  --text-5-semibold-ls: 0.17px;
  /* Preset 5 – Regular */
  --text-5-regular: 400 14px/22px "Overpass", sans-serif;
  --text-5-regular-ls: 0px;

  --grey-950: #131518; /* RGB(19, 21, 24) */
  --grey-900: #262e38; /* RGB(38, 46, 56) */
  --grey-500: #969fad; /* RGB(150, 159, 173) */
  --orange-500: #fc7614; /* RGB(252, 118, 20) */

  --gradient-1-start: #232a34; /* RGB(35, 42, 52) */
  --gradient-1-end: #181e27; /* RGB(24, 30, 39) */
  --gradient-1: linear-gradient(
    180deg,
    var(--gradient-1-start),
    var(--gradient-1-end)
  );
}

*::after,
*::before,
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: var(--grey-950);
  color: hsl(0, 0%, 100%);
  font-family: "Overpass", sans-serif;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.main {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  flex: 1;
}

.card {
  display: flex;
  background: var(--gradient-1);
  border-radius: 15px;
  padding: 34px 30px;
  width: 412px;
  height: auto;

  box-shadow: 0px 15px 25px rgba(0, 0, 0, 0.2);
}

.rating-state {
  display: flex;
  flex-direction: column;
  gap: 32px;
  justify-content: center;
  align-items: flex-start;
}
.flex-container {
  display: flex;
  gap: 28px;
}

.icon-container {
  background-color: var(--grey-900);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
}
.icon-container.active {
  visibility: visible;
}
.heading-1 {
  font: var(--text-1);
  padding: 0 0 8px;
}
.text {
  margin-top: -24px;
  font: var(--text-4-regular);
  letter-spacing: var(--text-4-regular-ls);
  color: var(--grey-500);
}
.rating-buttons-container {
  margin-top: -14px;
  display: flex;
  gap: 24px;
  width: 100%;
  justify-content: space-between;
}

.rating-buttons-container input[type="button"] {
  flex: 1;
  background-color: var(--grey-900);
  color: var(--grey-500);
  border: none;
  border-radius: 50%;
  width: 51px;
  height: 51px;
  font: var(--text-3);
  letter-spacing: var(--text-3-ls);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.3s;
}
.rating-buttons-container input[type="button"]:hover {
  background-color: white;
  color: black;
}

.rating-buttons-container input[type="button"].active {
  background-color: var(--orange-500);
  color: hsl(0, 0%, 100%);
}
.submit-button {
  width: 100%;
  height: 45px;
  text-transform: uppercase;
  background-color: var(--orange-500);
  border: none;
  border-radius: 22.5px;
  padding: 12px 0;
  font: var(--text-5-semibold);
  letter-spacing: var(--text-5-bold-ls);
  cursor: pointer;
  transition: background-color 0.3s;
}
.submit-button:hover {
  background-color: white;
  color: black;
}
.thank-you-state {
  display: none;
  padding: 44px 36px;
  flex-direction: column;
  gap: 32px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.thank-you-illustration {
  width: 162px;
  height: auto;
}
.selected-rating-container {
  background-color: var(--grey-900);
  color: var(--orange-500);
  border-radius: 22px;
  padding: 6px 20px;
  font: var(--text-4-regular);
  letter-spacing: var(--text-4-regular-ls);
}
.attribution {
  position: absolute;
  bottom: 0;
  width: 100%;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;

  color: burlywood;
  font-family: Arial, Helvetica, sans-serif;
}

/* Links */
.attribution a {
  margin: 0 0.25rem;
  text-decoration: none;
  font-weight: 500;
  color: rgb(230, 82, 28);
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

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

/* Separator dot */
.separator {
  margin: 0 0.5rem;
  opacity: 0.6;
}

/* Year flicker effect */
.year {
  margin-left: 0.5rem;
  font-weight: 600;
  display: inline-block;
  animation: flicker 1s step-end infinite;
  color: rgb(219, 89, 42);
}

/* Flicker animation */
@keyframes flicker {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 430px) {
  .card {
    padding: 28px 24px;
    width: min(98%, 370px);
  }
  .main {
    padding: 16px 4px;
  }
  .icon-container {
    width: 40px;
    height: 40px;
  }
  .rating-state {
    gap: 24px;
  }
  .heading-1 {
    font: var(--text-2);
  }
  .text {
    font: var(--text-5-regular);
    letter-spacing: var(--text-5-regular-ls);
  }
  .rating-buttons-container input[type="button"] {
    width: 42px;
    height: 42px;
    font: var(--text-5-semibold);
  }
  .rating-buttons-container {
    margin-top: -7px;
    gap: max(12px, 8%);
  }
  .text {
    margin-top: -7px;
  }

  .thank-you-state {
    padding: 36px 24px;
    gap: 24px;
  }

  .thank-you-illustration {
    width: 144px;
    height: auto;
  }
  .selected-rating-container {
    padding: 6px 12px;
    font: var(--text-5-regular);
    letter-spacing: var(--text-5-regular-ls);
  }
}
