: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%);

  --spacing-xl: 3rem;
  --spacing-lg: 2rem;
  --spacing-md: 1.5rem;
  --spacing-sm: 1rem;
  --spacing-xs: 0.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Roboto", sans-serif;
  font-size: clamp(1rem, 0.751vw + 0.72rem, 1.3rem);
}
article {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  color: var(--blue-700);
  height: 100vh;
}
figure {
  width: 100%;
}
figure img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 0 0 10px 10px;
}

.content,
.success-section {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  padding: 0 var(--spacing-lg) var(--spacing-md);
  justify-content: space-between;
}

.success-section {
  background-color: white;
  color: var(--blue-700);
  height: 100vh;
  figure {
    width: 60px;
    height: 60px;

    img {
      object-fit: cover;
    }
  }

  .success-message {
    padding-top: 10rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
  }
}

.hidden {
  display: none;
}

.content h1,
.success-section h2 {
  font-size: 3rem;
}

.content ul {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.content li {
  list-style: none;
  align-items: start;
  display: flex;
  gap: var(--spacing-md);
}

.email-label {
  font-weight: 700;
  font-size: clamp(0.8125rem, 0.8vw, 1.25rem);
  color: var(--blue-800);
  display: flex;
  margin-bottom: var(--spacing-xs);

  #error-message {
    flex-grow: 1;
    color: var(--red);
    text-align: right;
  }
}

.email-input {
  margin-bottom: var(--spacing-sm);
  #email {
    font-family: "Roboto", sans-serif;
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--grey);
    border-radius: 10px;
    font-size: clamp(1rem, 0.751vw + 0.72rem, 1.3rem);
  }
}

.email-input .error {
  outline: 1px solid var(--red);
  border: 1px solid var(--red);
  color: var(--red);
  background-color: rgba(255, 98, 87, 0.1);
}

#submit-button,
#dismiss-button {
  font-family: "Roboto", sans-serif;
  font-size: clamp(1rem, 0.751vw + 0.72rem, 1.3rem);
  font-weight: 700;
  width: 100%;
  padding: 1rem;
  background-color: var(--blue-800);
  text-align: center;
  color: var(--white);
  border-radius: 10px;
  border: none;
  outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#submit-button:hover,
#dismiss-button:hover {
  background: linear-gradient(90deg, var(--red), #ff9472);
  cursor: pointer;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

footer {
  margin-top: var(--spacing-xl);
  width: 100%;
  text-align: center;
}
.attribution {
  font-size: 11px;
  text-align: center;
}
.attribution a {
  color: hsl(228, 45%, 44%);
}

@media (min-width: 64rem) {
  body {
    display: grid;
    place-items: center;
    position: relative;
    background-color: var(--blue-700);
    height: 100vh;
  }
  footer {
    position: absolute;
    bottom: 0;
  }
  article {
    background-color: var(--white);
    border-radius: var(--spacing-md);
    flex-direction: row-reverse;
    padding: var(--spacing-md);
    height: auto;
  }

  figure,
  .content {
    flex: 1;
  }

  .content {
    justify-content: center;
    gap: var(--spacing-lg);

    h1 {
      font-size: 4rem;
    }
  }

  figure img {
    max-height: none;
  }

  .email-input {
    margin-bottom: var(--spacing-lg);
  }

  .email-input #email,
  #submit-button,
  #dismiss-button {
    padding: var(--spacing-md);
  }

  .success-section {
    height: auto;
    padding: var(--spacing-xl);
    border-radius: 2rem;
    gap: var(--spacing-xl);
    .success-message {
      width: 400px;
      padding-top: 0;
    }
  }
}
