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

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

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

html {
  font-size: 62.5%;
}

form,
input,
button {
  font: inherit;
}

body {
  background-image: linear-gradient(to bottom, white, hsla(0, 80%, 86%, 0.1));
  font-family: "Josefin Sans", sans-serif;
  min-height: 100vh;
}

.container {
  max-width: 115rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding-block-start: 2.4rem;
}

.logo {
  width: 100px;
  margin-inline-start: 3rem;
}

.text-and-form {
  display: flex;
  flex-direction: column;
  padding-block-start: 2rem;
  gap: 2rem;
  align-items: center;
  margin-inline: 3rem;
}

h1,
h3 {
  text-align: center;
}

h1 {
  font-size: 4rem;
  text-transform: uppercase;
  letter-spacing: 1rem;
  line-height: 1;
}

.text-light {
  font-weight: 300;
  color: hsl(0, 36%, 70%);
}

h3 {
  font-size: 1.4rem;
  color: hsl(0, 36%, 70%);
  line-height: 1.5;
}

.form-wrapper {
  width: 100%;
}

.form {
  border: 1.5px solid hsla(0, 74%, 86%, 0.332);
  border-right: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
  border-radius: 2.4rem;
  margin-block-end: 0.5rem;
}

:where(.error) .form {
  border: 1.5px solid rgba(255, 0, 0, 0.8);
  border-right: none;
}

.email-input {
  border: none;
  margin-inline-start: 2rem;
  background-color: transparent;
  height: 100%;
  font-size: 1.4rem;

  outline: none;
}

::placeholder {
  color: hsla(0, 36%, 70%, 0.605);
  font-size: 1.4rem;
}

.btn-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  width: 6rem;
  height: 100%;
  border: none;
  background-image: linear-gradient(135deg, hsl(0, 80%, 86%), hsl(0, 74%, 74%));
  cursor: pointer;
  border-radius: 2.4rem;
  transform: scale(1.1);
}

.btn:hover {
  filter: brightness(115%);
}

.error-message {
  display: block;
  width: 100%;
  margin-inline-start: 2.2rem;
  text-align: left;
  font-size: 1.2rem;
  color: rgba(255, 0, 0, 0.8);
  display: none;
}

.success-message {
  display: block;
  width: 100%;
  margin-inline-start: 2.2rem;
  text-align: left;
  font-size: 1.2rem;
  color: rgba(0, 128, 0, 0.8);
  display: none;
  animation: bloop 300ms;
}

.error-icon {
  width: 1.8rem;
  height: 1.8rem;
  display: none;
  animation: shake 250ms;
}

:where(.error) .error-icon,
:where(.error) .error-message {
  display: block;
}

:where(.success) .success-message {
  display: block;
}

/* Footer */
.attribution {
    bottom: .8rem;
    left: 50%;
    font-size: 11px;
    text-align: center;
}

.attribution a {
    color: hsl(228, 45%, 44%);
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(4px);
  }
  50% {
    transform: translateX(-4px);
  }
  74% {
    transform: translateX(4px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes bloop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@media screen and (min-width: 1100px) {
  body {
    display: grid;
    place-content: center;
  }

  .container {
    display: grid;
    grid-template-columns: 3fr 3fr 3fr 3fr 3fr 11fr;
    grid-template-areas:
      ". logo . . . pic"
      ". taf taf taf . pic";
    gap: 0;
    padding: 0;
    box-shadow: -2px 2px 12px 4px rgba(128, 128, 128, 0.322);
    position: relative;
  }

  .container::before {
    content: "";
    position: absolute;
    grid-area: 1 / 1 / 3 / 6;
    background-image: url(images/bg-pattern-desktop.svg);
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -1;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  .logo,
  .text-and-form {
    margin-inline-start: 0;
  }

  .logo {
    grid-area: logo;
    width: 20rem;
    margin-block-start: 5rem;
  }
  picture {
    grid-area: pic;
  }

  .text-and-form {
    grid-area: taf;
  }
  h1,
  h3 {
    text-align: left;
  }

  h1 {
    font-size: 5rem;
  }

  .btn {
    width: 7rem;
  }
}