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

@font-face {
  font-family: "Roboto Regular";
  src: url("./assets/fonts/Roboto-Regular.ttf");
}

@font-face {
  font-family: "Roboto Bold";
  src: url("./assets/fonts/Roboto-Bold.ttf");
}

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

body {
  font-family: "Roboto Regular", serif;
  color: var(--blue-700);
  font-size: 0.9rem;
}

.newsletter-wrapper,
.success-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  background: var(--blue-700);
}

/* hide the newsletter form when click on the submit button */
.newsletter-wrapper.hide {
  display: none;
}

.newsletter-card,
.success-card {
  max-width: 21rem;
  border-radius: 10px;
  background: var(--white);
}

.card__image {
  flex: 1;
  height: 250px;
  background: url("./assets//images/illustration-sign-up-mobile.svg") no-repeat;
  background-size: cover;
  padding: 1rem;
  border-radius: 0 0 10px 10px;
}

.card__image img {
  width: 100%;
}

.card__content {
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card__title {
  font-family: "Roboto Bold";
  color: var(--blue-700);
  font-size: 2rem;
}

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

.card__list li {
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
  align-items: start;
}

.card__list li img {
  width: 18px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.form-label-error {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: bold;
}

form label {
  color: var(--blue-700);
}

/* the error message showing before the input field */
.error-message {
  color: var(--red);
  display: none;
}
/* show the error message when there is an error */
.show {
  display: block;
}

form input {
  width: 100%;
  padding: 0.8rem 1.5rem;
  font-family: inherit;
  border-radius: 6px;
  border: 1px solid var(--grey);
  outline: none;
  font-size: 0.9rem;
}

/* this is to add in the input field if there is error ie. invalid email */
.error {
  border: 1px solid var(--red);
  background: #c11a1a1e;
  color: var(--red);
}

form button,
#dismiss-btn {
  background: var(--blue-800);
  padding: 0.8rem 1.5rem;
  font-family: inherit;
  color: var(--white);
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.8rem;
  cursor: pointer;
}

form button:hover,
#dismiss-btn:hover {
  background: linear-gradient(to right, hsl(4, 100%, 67%) 60%, orange);
}

/* =================================================================== */

/* success card styling */
.success-wrapper {
  display: none;
}

.success-wrapper.show {
  display: flex;
}

.success-card {
  height: 80vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
}
/* success message is initially hidden  */

.success-msg {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.success-msg img {
  width: 50px;
}

.success-msg__title {
  font-family: "Roboto Bold", serif;
  font-size: 2rem;
}

.success-msg__text {
  line-height: 1.3rem;
  font-size: 0.8rem;
}

.success-msg__text #email-value {
  font-family: "Roboto Bold", serif;
  font-weight: 700;
}

/* media queries */
@media screen and (min-width: 1200px) {
  .newsletter-card {
    min-width: 50rem;
    display: flex;
    flex-direction: row-reverse;
    gap: 2rem;
    border-radius: 20px;
    padding: 1rem;
  }

  .card__image {
    flex: 1;
    height: auto;
    background: url("./assets//images/illustration-sign-up-desktop.svg")
      no-repeat;
    padding: 1rem;
  }

  .card__content {
    flex: 1;
    justify-content: center;
    padding: 2rem;
  }
  .card__title {
    font-size: 2.5rem;
  }

  /* success section */
  .success-card {
    height: auto;
    padding: 2rem 3rem;
    border-radius: 20px;
    max-width: 25rem;
  }

  .success-msg {
    margin-top: 0rem;
  }

  .success-msg__title {
    font-size: 2.3rem;
  }
}
