/*  =================================================
    Custom Fonts
    =================================================   */
@font-face {
    font-family: 'Roboto';
    src: url('../assets/fonts/Roboto-Regular.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'Roboto';
    src: url('../assets/fonts/Roboto-Bold.ttf') format('truetype');
    font-weight: 700;
}

/*  =================================================
    Custom Properties (Variables)
    =================================================   */
:root {
  --white:    hsl(0, 100%, 100%);
  --grey:     hsl(0, 0%, 58%);
  --red:      hsl(4, 100%, 67%);

  --blue-700: hsl(235, 18%, 26%);
  --blue-800: hsl(234, 29%, 20%);

  --gradient-hover: linear-gradient(to right, hsl(15,100%, 61%), hsl(346, 100%, 66%));

  --spacing-100:  0.8rem;
  --spacing-200:  1.6rem;
  --spacing-300:  2.4rem;
  --spacing-400:  3.2rem;
  --spacing-500:  4.0rem;
  --spacing-600:  4.8rem;
  --spacing-800:  6.4rem;
  --spacing-900:  7.2rem;
  --spacing-1300: 10.4rem;
}

/*  =================================================
    CSS Reset
    =================================================   */

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* 10 pixels = 1rem */
html {
  font-size: 62.5%;
}

/*  =================================================
    Typography Utilities
    =================================================   */
.text--p1 {
  font-family: Roboto, sans-serif;
  font-size: 4rem;
  line-height: 1;
  font-weight: 700;
}

@media (min-width: 768px) {
  .text--p1 {
    font-size: 5.6rem;
  }
}

.text--p2-bold {
  font-family: Roboto, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  font-weight: 700;
}

.text--p2-regular {
  font-family: Roboto, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  font-weight: 400;
}

.text--p3 {
  font-family: Roboto, sans-serif;
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 700;
}

/*  =================================================
    Base Styles
    =================================================   */

body {
  font-family: 'Roboto', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

.newsletter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-500);

  background-color: var(--white);
  color: var(--blue-800);
  padding-bottom: var(--spacing-500);

  animation: fadeAndSlideUp 0.5s ease-out forwards;
}

.newsletter__image {
  width: 100%;
  display: block;
}

.newsletter__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-500);
  width: 88%;
}

.newsletter__info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-300);
}

.newsletter__list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-100);
  padding: 0;
  list-style: none;
}

.newsletter__list-item {
  display: flex;
  gap: var(--spacing-200);
  align-items: flex-start;
}

.newsletter__list-icon {
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
}

.newsletter__form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-300);
}

.newsletter__form-label {
  display: flex;
  justify-content: space-between;
}

.newsletter__form-email {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-100);
}

.newsletter__form-input {
  padding: var(--spacing-200) var(--spacing-300);
  color: var(--blue-800);
  border: 0.1rem solid var(--grey);
  border-radius: var(--spacing-100);
}

.newsletter__form-input-error {
  color: red;
  border: 0.3rem solid red;
}

.newsletter__form-button {
  padding: var(--spacing-200) var(--spacing-600);
  background-color: var(--blue-800);
  color: var(--white);
  border: none;
  border-radius: var(--spacing-100);
  cursor: pointer;
  white-space: nowrap;
}

.newsletter__form-button:hover {
  background: var(--gradient-hover);
}

.newsletter__form-button:focus {
  outline: none;
  border-color: var(--blue-800);
}

.newsletter__picture {
  display: block;
  width: 100%;
}

.success-card {
  display: none;
  flex-direction: column;
  gap: var(--spacing-800);
  background-color: var(--white);
  width: 78%;
  max-width: 50.4rem;
  margin: 0 auto;

  animation: fadeAndSlideUp 0.5s ease-out forwards;
}

.success-card__message {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-400);

  color: var(--blue-800);
}

.success-card__icon {
  width: 6.4rem;
  height: 6.4rem;
}

.success-card__button {
  padding: var(--spacing-200) var(--spacing-500);
  background-color: var(--blue-800);
  color: var(--white);
  border-radius: var(--spacing-100);
  border: none;
  cursor: pointer;
}

.success-card__button:hover {
  background: var(--gradient-hover);
}

.hidden {
  display: none;
}

@keyframes fadeAndSlideUp {
  0% {
    opacity: 0;
    transform: translateY(5rem);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
/*  =================================================
    Tablet Styles
    =================================================   */

@media (min-width: 768px) {

  body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--blue-700);
  }

  .newsletter {
    padding: var(--spacing-500);
    margin: var(--spacing-500) auto;
    width: 80%;
    max-width: 61.4rem;
    border-radius: 3.6rem;
  }

  .newsletter__content {
    gap: var(--spacing-300);
    width: 100%;
  }

  .newsletter__form {
    gap: var(--spacing-200);
  }

  .newsletter__form-button {
    padding: var(--spacing-200) 14.4rem;
  }

  .success-card {
    gap: var(--spacing-400);
    padding: var(--spacing-800);
    border-radius: 3.6rem;
  }
}

/*  =================================================
    Desktop Styles
    =================================================   */
@media (min-width: 1440px) {
  .newsletter {
    flex-direction: row-reverse;
    gap: var(--spacing-800);
    padding: var(--spacing-400);
    max-width: 90.4rem;
  }

  .newsletter__picture {
    max-width: 40rem;
  }

  .newsletter__content {
    gap: var(--spacing-400);
    max-width: 37.6rem;
  }

  .newsletter__info {
    gap: var(--spacing-400);
  }

  .newsletter__form {
    gap: var(--spacing-300);
  }

  .newsletter__form-button {
    padding: var(--spacing-200) var(--spacing-900);
  }
}