:root {
  /* font and color tokens */
  --font-sans: "Josefin Sans", sans-serif;
  --primary-color: hsl(0, 93%, 68%); /* use this color where needed */
  --secondary-color: hsl(0, 36%, 70%);
  --accent-color: hsl(0, 74%, 74%);
  --text-color: hsl(0, 6%, 24%);
  --muted-color: hsl(227, 12%, 61%);
  --input-border: hsl(0, 36%, 70%);
  --font-color: hsl(0, 36%, 70%);
}

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

body {
  font-family: var(--font-sans);
  /* background: hsl(0, 0%, 98%); */
  color: var(--text-color);
}

main {
  display: grid;
  /* padding: 10px; */

  /* margin: 0 30px; */
  height: calc(100vh - 77px); /* Subtract approximate footer height */
}

section {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  /* border: 2px solid yellow; */
  background-image: url("./images/bg-pattern-desktop.svg");
  background-repeat: repeat;
  background-size: contain;
  background-position: 120% 189%;
  width: 100%;

  /* align-items: center; */
  /* text-align: center; */
  /* padding: 4rem 2rem; */
}

.content {
  /* border: 2px solid hsl(233, 66%, 57%); */
  padding-left: 6rem;
  width: 80%;
  height: auto;
}

.logo {
  /* border: 2px solid red; */
  margin: 2rem 0 6rem 0;
  width: 120px;
  height: auto;
}

h1 {
  /* border: 2px solid green; */
  text-transform: uppercase;
  font-size: 3rem;
  letter-spacing: 0.9rem;
  line-height: 1.2;
  margin: 0 8rem 2rem 0;
  color: var(--text-color);
  font-weight: 0;
}

span {
  font-weight: 100;
  color: var(--font-color);
}

picture img {
  /* border: 2px solid red; */
  /* width: 100%; */
  /* height: 600px;
  height: 100%; */
  object-fit: cover;
  display: block; /* <-- added: removes the baseline gap */
  width: 100%;
  max-width: 600px;
  height: auto;
}

p {
  font-size: 0.775rem;
  /* margin-bottom: 30px; */
  line-height: 1.5;
  margin: 0 14rem 2rem 0;
  color: var(--font-color);
}

label {
  display: block;
  text-align: left;
  margin-bottom: 10px;
  font-weight: bold;
  color: var(--muted-color);
}

input[type="email"] {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--input-border);
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-color);
  border-radius: 30px;
}

input[type="email"]:focus {
  outline: 0.2px solid var(--primary-color);
  border-color: var(--primary-color);
}

button[type="submit"] {
  background-color: hsl(0, 94%, 81%);
  color: white;
  border: none;
  padding: 22px 49px;
  border-radius: 40px;
  font-size: 1rem;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  height: 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 6px 8px 26px rgba(59, 59, 59, 0.5);
  /* box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.12); */
}

button[type="submit"]:hover {
  background-color: hsl(0, 93%, 68%);
}

input[type="email"]::placeholder {
  color: var(--font-color);
  opacity: 0.5;
}

.input-container {
  position: relative;
  display: inline-block;
  width: 60%;
  min-height: 20px;
}

/* .input-container input[type="email"] {
  width: 100%;
  padding-right: 40px;
} */

.input-container img.icon-arrow {
  position: absolute;
  top: 13px;
  /* right: 10px; Adjust as needed */
  /* transform: translateY(-50%); */
  width: 15px;
  height: 15px;
  /* background-color: black; */
  pointer-events: none; /* Prevent the icon from blocking input clicks */
}

footer {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 60px;
  font-size: 0.875rem;
  color: hsl(233, 8%, 62%);
  padding: 0 20px; /* Add equal padding on left and right */
}

.attribution {
  width: 100%;
  max-width: 1100px; /* Match the max-width of your section */
  margin: 0 auto;
  text-align: center;
}

a,
.attribution a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.error-icon img {
  position: absolute;
  top: 13px;
  right: 110px;
  display: none;
  width: 16px; /* sensible size for an icon */
  height: 16px;
  /* display: inline-block !important; */
  object-fit: contain;
  pointer-events: none;
}
/* ...existing code... */
.error-text {
  color: var(--font-color);
  font-size: 0.775rem;
  opacity: 0.5;
  margin: 5px 0 0 20px;
}

/* @media screen and (min-width: 1200px) {
  picture img {
    width: 100%;
    height: 100%;
  }
} */

/* medium device styles */

@media screen and (max-width: 959px) {
  main {
    height: calc(100vh - 10px);
  }
  /* section { */
  /* border: 2px solid blue; */
  /* padding: 1rem 0.6rem; */
  /* } */
  .content {
    /* padding: 0; */
    width: 60%;
  }
  picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  h1 {
    font-size: 2.5rem;
    margin: 0 2rem 4rem 0;
  }
  p {
    font-size: 0.775rem;
    line-height: 1.5;
    margin: 0 6rem 4rem 0;
    color: var(--font-color);
  }
  .input-container {
    width: 80%;
  }
  footer {
    margin-top: 70px;
  }
}

@media screen and (max-width: 800px) {
  main {
    height: auto;
  }
  /* section { */
  /* padding: 1rem 0.6rem; */
  /* } */
  .content {
    /* padding: 0; */
    width: 70%;
  }
  picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  h1 {
    font-size: 2.5rem;
    margin: 0 2rem 4rem 0;
  }
  p {
    font-size: 0.775rem;
    line-height: 1.5;
    margin: 0 2rem 2rem 0;
    color: var(--font-color);
    /* border: 2px solid blue; */
  }
  .input-container {
    width: 80%;
  }
  footer {
    margin-top: 10px;
  }
}

/* small device styles */

@media screen and (max-width: 699px) {
  section {
    display: grid;
    grid-template-areas: "logo" "img" "content";
  }

  /* make .content act as if it isn't a wrapper so its img becomes a direct grid child */
  .content {
    display: contents;
  }

  .logo {
    grid-area: logo;
    margin: 2rem 0 2rem 2rem;
    width: 100px;
    height: auto;
  } /* now works because img is treated as a grid item */
  .content-img {
    grid-area: img;
  }
  .content {
    grid-area: content;
    width: 100%;
    padding: 2rem;
  }

  h1 {
    font-size: 2rem;
    margin: 4rem 2rem 1rem 2rem;
    /* border: 2px solid red; */
    text-align: center;
  }
  p {
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 2rem 1rem 1rem 1rem;
    color: var(--font-color);
    text-align: center;
  }
  .input-container {
    width: 90%;
    margin: 2rem 1rem 1rem 1rem;
  }

  button[type="submit"] {
    position: absolute;
    padding: 22px 30px;
  }

  .error-icon img {
    position: absolute;
    top: 13px;
    right: 80px;
    display: none;
    width: 16px; /* sensible size for an icon */
    height: 16px;
    /* display: inline-block !important; */
    object-fit: contain;
    pointer-events: none;
  }
  .error-text {
    color: var(--font-color);
    font-size: 0.775rem;
    opacity: 0.5;
    margin: 5px 0 0 20px;
  }

  footer {
    margin-top: 10px;
  }
}
