@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;600&display=swap');

:root {
  --clr-primary-red: hsl(0, 36%, 70%);
  --clr-accent-red: hsl(0, 93%, 68%);
  --clr-heading-red: hsl(0, 6%, 24%);
}

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

img {
  max-width: 100%;
}

body {
  font-family: 'Josefin Sans', sans-serif;
}

.hero-container {
  color: var(--clr-primary-red);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.column-1 {
  flex-basis: 60%;
  padding-inline: 2.5rem;
  background: linear-gradient(135deg, hsl(0 0% 100%), hsl(0 100% 98%));
  background-image: url('../images/bg-pattern-desktop.svg');
  background-size: cover;
  background-position: center;
}

.column-2 {
  flex-basis: 40%;
}

.hero-inner-container {
  text-align: center;
  max-width: 550px;
  margin: 0 auto;
}

/* Mobile Background */
.background-mobile {
  display: block;
  max-width: unset;
  width: calc(100% + 200px);
  /* TODO: Find more elegant way to expand pass our container's padding */
  /* Moving this content outside the container is not so trivial */
  margin-left: -100px;
  margin-right: -100px;
}

/* Desktop Background */
.background-desktop {
  background-image: url('../images/hero-mobile.jpg');
  background-size: cover;
  background-position: center;
}

.logo {
  margin-block: 2rem;
  width: 150px;
}

.hero-title {
  color: var(--clr-heading-red);
  text-transform: uppercase;
  letter-spacing: 0.75rem;
  margin: 3rem 0 1.25rem 0;
  font-size: 3.75rem;
  font-weight: 400;
  line-height: 1.1;
}

.hero-title span {
  color: var(--clr-primary-red);
  font-weight: 300;
  display: block;
}

.hero-text {
  color: var(--clr-primary-red);
  font-size: 1.25rem;
  line-height: 1.6;
}

.email-form {
  margin: 2.5rem auto;
  position: relative;
}

.email-form.error input {
  border: 2px solid var(--clr-accent-red);
}

.email-form.success input {
}

.email-form input {
  background-color: transparent;
  width: 100%;
  font-size: 1.25rem;
  font-family: inherit;
  outline: none;
  border: 1px solid var(--clr-primary-red);
  border-radius: 50px;
  padding: 1rem 2rem;
  /* TODO: Find more responsive way to set input and button to same height */
  height: 56px;
}

.email-form input:focus,
.email-form button:focus {
  outline: none;
  outline: 2px solid var(--clr-accent-red);
}

.email-form input::placeholder {
  color: var(--clr-primary-red);
}

.email-form button {
  background: linear-gradient(135deg, hsl(0 80% 86%), hsl(0 74% 74%));
  position: absolute;
  top: 0;
  right: 0;
  /* TODO: Find more responsive way to set input and button to same height */
  height: 56px;
  width: 100px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 10px hsla(0, 36%, 70%, 0.25);
  transition: opacity 0.2s ease-in-out;
}

.email-form button:hover {
  /* background: linear-gradient(135deg, hsl(0 80% 86%), hsl(0 74% 74%)); */
  opacity: 0.7;
}

.error-icon {
  display: none;
  position: absolute;
  /* TODO: This is bad to hard-code this! We assume the error icon is always its native height */
  top: 15px;
  right: 125px;
}

.email-form.error .error-icon {
  display: inline-block;
}

.form-feedback {
  /* display: none; */
  color: var(--clr-accent-red);
  margin-top: 1rem;
  margin-left: 2rem;
}

.email-form.error .form-feedback {
  display: inline-block;
  color: var(--clr-accent-red);
}

.email-form.success .form-feedback {
  display: inline-block;
  color: rgb(161, 210, 255);
}

@media screen and (min-width: 800px) {
  .hero-container {
    flex-direction: row;
  }

  .logo {
    margin-block: 3.75rem;
    width: 200px;
  }

  .hero-inner-container {
    text-align: left;
  }

  .background-mobile {
    display: none;
  }

  .column-2 {
    background-image: url('../images/hero-desktop.jpg');
  }
}

.attribution {
  font-size: 1rem;
  color: hsl(228, 45%, 24%);
  text-align: center;
  padding-block: 2rem;
}

.attribution a {
  font-size: 1.1rem;
  color: hsl(228, 45%, 44%);
}
