@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  --red: hsl(4, 100%, 67%);
  --blue-800: hsl(234, 29%, 20%);
  --blue-700: hsl(235, 18%, 26%);
  --grey: hsl(0, 0%, 58%);
  --white: hsl(0, 0%, 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", serif;
}

main {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  background-color: var(--blue-700);
  color: var(--blue-800);
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 2.5rem;
}

ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

#newsletter-sign-up {
  display: flex;
  flex-direction: column;
}

.newsletter-sign-up__illustration {
  flex-grow: 1;
  background-image: url("./assets/images/illustration-sign-up-mobile.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 0 0 1rem 1rem;
}

.newsletter-sing-up__form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 3rem 1.5rem 2rem;
}

.newsletter-sing-up__form ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.newsletter-sing-up__form ul li {
  display: flex;
  gap: 1rem;
}

.newsletter-sing-up__form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label,
.form-field span {
  font-size: 0.75rem;
  font-weight: 700;
}

.form-field input {
  outline: none;
  border: 1px solid var(--grey);
  border-radius: 0.5rem;
  padding: 1.2rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--blue-800);
}

.form-field input::placeholder {
  color: var(--grey);
}

.form-field input:hover,
.form-field input:focus {
  border-color: var(--blue-700);
}

.form-field span {
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
}

.form-field.invalid input {
  border-color: var(--red);
  background-color: hsl(4, 100%, 97%);
  color: var(--red);
}

.form-field.invalid input::placeholder {
  color: var(--red);
}

.form-field.invalid span {
  color: var(--red);
}

.btn {
  width: 100%;
  outline: none;
  border: none;
  border-radius: 0.5rem;
  padding: 1.2rem;
  background-color: var(--blue-800);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
}

.btn:hover {
  background-image: linear-gradient(to left, #ff6153, #ff5379);
}

#success-message {
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 8rem 1.5rem 2rem;
}

#success-message p {
  flex-grow: 1;
}

.container {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  background-color: var(--white);
}

.show {
  display: flex !important;
}

.hide {
  display: none !important;
}

@media (min-width: 90rem) {
  main {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  h1 {
    font-size: 3.5rem;
  }

  #newsletter-sign-up {
    flex-direction: row-reverse;
  }

  .newsletter-sign-up__illustration {
    border-radius: 1rem;
  }

  .newsletter-sing-up__form {
    padding: 4rem 3rem 4rem 1.5rem;
  }

  .container {
    min-height: unset;
    width: 60rem;
    border-radius: 2rem;
    padding: 1.5rem;
  }

  #success-message.container {
    max-width: 480px;
    padding: 4rem;
  }
}
