/* === FONTS === */

@font-face {
  font-family: 'Overpass';
  src: url('assets/fonts/overpass-v19-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Overpass';
  src: url('assets/fonts/overpass-v19-latin-700.woff2') format('woff2'); 
  font-weight: 700;
  font-style: normal;
  font-display: swap; 
}

/* === CSS RESET === */

/* Box sizing rules */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1, h2,
h3, h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input, button,
textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

:root {
  /* == COLOR PALLETTE == */

  /* Primary Color */
  --clr-orange-500: hsl(25, 97%, 53%);

  /* Neutral Colors */
  --clr-grey-500: hsl(217, 12%, 63%);
  --clr-grey-900: hsl(213, 19%, 18%);
  --clr-grey-850: hsl(207, 14%, 25%);
  --clr-grey-950: hsl(218, 12%, 18%);
  --clr-white: hsl(0, 100%, 100%);
  ---clr-dark-grey: hsl(214, 17%, 8%);
  
  /* == TYPOGRAPHY == */

  /* font family */
  --ff-body: 'Overpass', sans-serif;

  /* font size */
  --fs-paragraph: 0.85rem;

  /* font weights */
  --fw-regular: 400;
  --fw-bold: 700;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xlg: 2.5rem;
  --space-xxlg: 3rem;
  --space-sr:  0.0625rem;
}

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

  .submit--btn {
    transition: none;
  }
}

body {
  min-height: 100svh;
  background-color: var(---clr-dark-grey);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-body);
  line-height: 1.5;
}

.main__rating--card, .success--state {
  width: 88%;
  max-width: clamp(30rem, 30vw, 36rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-md);
  background-color: var(--clr-grey-900);
  border-radius: var(--space-md);
  padding: clamp(1.2rem, 5vw, 7rem);
}

@media screen and (min-width: 23.4375rem) {
  .main__rating--card, .success--state {
    padding: 1.8rem;
  }
}

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

.main__section--content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.star-wrapper {
  width: var(--space-xxlg);
  height: var(--space-xxlg);
  background-color: var(--clr-grey-850);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.star-icon {
  width: 1.5rem;
  height:  1.5rem;
}

.star-icon polygon {
  fill: var(--clr-orange-500);
}

.main__section--heading, .success--state--heading {
  color: var(--clr-white);
}

.main_-section--message {
  width: 100%;
}

.message {
  color: var(--clr-grey-500);
  font-size: var(--fs-paragraph);
}

.main__rating--form {
  width: 100%;
}

fieldset {
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  padding: 0;
}

.btn--container {
  display: flex;
  gap: clamp(0.5rem, 3vw, 8rem);
  margin-block-end: 1.5rem;
}

ul li {
  list-style: none;
}

.rate--btn {
  all: unset;
  min-width: clamp(var(--space-xlg), 2.5vw, 5rem);
  min-height: clamp(var(--space-xlg), 3vw, 5rem);
  color: var(--clr-grey-500);
  font-weight: var(--fw-bold);
  border-radius: 50%;
  border: 0.125rem solid var(--clr-grey-900);
  background-color: var(--clr-grey-850);
  outline: none;
  text-align: center;
  cursor: pointer;
  font-size: 0.8em;
  -webkit-tap-highlight-color: transparent;
  transition: transform 3s ease-in, background-color 0.5s ease-in-out;
}

.rate--btn.active {
  background-color: var(--clr-white);
}

.submit--btn {
  all: unset;
  width: 100%;
  color: var(--clr-grey-950);
  background-color: var(--clr-orange-500);
  border-radius: var(--space-lg);
  font-size: 1em;
  font-weight: var(--fw-bold);
  padding-block: 0.5rem;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.5s ease-in-out, transform 0.3s ease-in-out;
}

@media (hover: hover) {
  .rate--btn:not(.active):hover {
    background-color: var(--clr-orange-500);
    transform: scale(1.10);
  }

  .submit--btn:hover {
    background-color: var(--clr-white);
    transform: translateY(-0.1rem);
  }
}

.success--state {
  align-items: center;
}

.hidden {
  display: none;
}

.selection--text {
  color: var(--clr-orange-500);
  background-color: var(--clr-grey-850);
  border-radius: var(--space-lg);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--fs-paragraph);
}

.success--state .message {
  text-align: justify;
  text-align-last: center;
  font-size: 0.85rem;
}

@media  screen and (min-width: 32rem) {
  .main__rating--card, .success--state {
    width: 70%;
    max-width: 24rem;
    font-size: 1rem;
    padding: 2rem 1.5rem;
    gap: var(--space-sm);
  }

  .star-wrapper {
    margin-block-end: 1.4rem;
  }

  .main__section--heading {
    font-size: 1.7rem;
  }

  .main__section--message {
    font-size: 0.93rem;
  }

  .btn--container {
    gap: 0.8rem;
    margin-block-start: 0.3rem;
    margin-block-end: 1.5rem;
  }

  .rate--btn {
    min-width: 3.35rem;
    min-height: 3.35rem;
  }

  .submit--btn {
    padding-block: 0.6rem;
  }

  
}


