/* Start CSS Reset */

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

html {
  box-sizing: inherit;
  height: 100%;
  scroll-behavior: smooth;
}

html {
  text-size-adjust: none;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

body {
  min-height: 100vh;
  height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

img,
picture {
  max-width: 100%;
  display: block;
}

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

textarea:not([rows]) {
  min-height: 10em;
}

:target {
  scroll-margin-block: 5ex;
}

/* End CSS Reset */

/* Start Global Styles */

:root {
  /* Color Variables */
  --red: #ff6257;
  --blue-800: #242742;
  --blue-700: #36384e;
  --grey: #949494;
  --gradient: linear-gradient(#ff6a3a, #ff527b);

  /* Font Weight Variables */
  --fw-400: 400;
  --fw-700: 700;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--blue-700);
  color: var(--blue-800);
  display: flex;
  justify-content: center;
  align-items: center;
}

.newsletter-container {
  background-color: white;
  max-width: 60rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

 picture img {
  width: 100%;
  height: auto;
}

main {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 3rem);
  font-weight: var(--fw-700);
  letter-spacing: -0.05em;
}

p {
  font-weight: var(--fw-400);
  text-wrap: wrap;
  margin-bottom: 0.8rem;
}

ul {
  list-style: none;
}

li {
  display: flex;
  gap: 1rem;
  font-weight: var(--fw-400);
  margin-bottom: 1rem;
}

li::before {
  content: "";
  display: inline-block;
  background-image: url("./assets/images/icon-list.svg");
  background-size: contain;
  background-repeat: no-repeat;
  width: 22px;
  height: 22px;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

form div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.875rem;
  font-weight: var(--fw-700);
}

.error-message {
  color: var(--red);
  display: none;
}

input {
  width: 100%;
  padding: 1.3rem;
  border: 1px solid var(--grey);
  border-radius: 0.5rem;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

input:focus {
  outline: none;
  border-color: var(--blue-800);
}

.error {
  border-color: var(--red);
  background-color: #ffe8e6;
  color: var(--red);
}

button {
  width: 100%;
  padding: 1.3rem;
  background-color: var(--blue-800);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: var(--fw-700);
  cursor: pointer;
}

button:hover {
  background: var(--gradient);
  box-shadow: 0 4px 8px rgba(49, 27, 27, 0.2);
}

.success-message {
  width: 100%;
  height: 100%;
  background-color: white;
  gap: 1.5rem;
  padding: 2rem 3rem 3.5rem 3rem;
  border: none;
  display: none;
  flex-direction: column;
}

.success-message img {
  align-self: flex-start;
  margin-bottom: 0.8rem;
}

h2 {
  font-size: 3rem;
  font-weight: var(--fw-700);
  color: var(--blue-800);
}

.user-email {
  font-weight: var(--fw-700);
}

.dismiss-btn {
  padding: 1.2rem;
  margin-top: auto;
}

@media (min-width: 48rem) {
  .newsletter-container {
    grid-template-columns: 1.4fr 1fr;
    grid-template-areas: "main illustration";
    padding: 1.5rem;
    border-radius: 2rem;
    gap: 2.5rem;
  }

  main {
    grid-area: main;
    padding: 3rem;
  }

  .illustration {
    grid-area: illustration;
  }

  .success-message {
    max-width: 30rem;
    height: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1.5rem;
    box-shadow: 0 4px 8px rgba(49, 27, 27, 0.2);
  }
}
