@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;600&display=swap");

:root {
  --Desaturated-Red: hsl(0, 36%, 70%);
  --Soft-Red: hsl(0, 93%, 68%);
  --Dark-Grayish-Red: hsl(0, 6%, 24%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Josefin Sans", sans-serif;
  font-size: 16px;
}

header {
  height: auto;
  padding: 2rem;
}

header img {
  width: 8rem;
}

.container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, hsl(0, 0%, 100%), hsl(0, 100%, 98%));
}

.container .left {
  width: 100%;
  height: auto;
  padding: 50px 30px 0 30px;
}

.container .right {
  width: 100%;
  height: 250px;
  background-image: url(/images/hero-mobile.jpg);

  background-size: cover;
  background-position: center center;
}

.container h1 {
  font-size: 3.2rem;
  font-weight: 300;
  text-transform: uppercase;
  color: var(--Desaturated-Red);
  letter-spacing: 0.8rem;
}

.container span {
  font-weight: 600;
  color: var(--Dark-Grayish-Red);
}

.container .left p {
  font-weight: 400;
  color: var(--Desaturated-Red);
  margin: 1rem auto;
  max-width: 28rem;
  line-height: 1.5rem;
}

.container form {
  position: relative;
  display: block;
  height: 3.2rem;
  width: 100%;
  margin: 0 auto;
  max-width: 400px;
}
.container form input {
  position: absolute;
  width: 100%;
  height: 100%;
  outline: none;
  border-radius: 3.2rem;
  left: 0;
  top: 0;
  border: 1px solid var(--Desaturated-Red);
  padding-left: 1.8rem;

  font-family: "Josefin Sans", sans-serif;
  font-size: 1rem;
}

.container form button {
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 4.5rem;
  border-radius: 3.2rem;
  outline: none;
  border: none;
  background: linear-gradient(135deg, hsl(0, 54%, 89%), hsl(0, 74%, 74%));
  box-shadow: 6px 10px 20px var(--Desaturated-Red);
  transition: 0.3s ease box-shadow;
}

.container form button:hover {
  background: linear-gradient(
    135deg,
    hsla(0, 54%, 89%, 0.545),
    hsla(0, 74%, 74%, 0.551)
  );
  box-shadow: 6px 10px 20px hsla(0, 36%, 70%, 0.538);
}

/*.container form input::placeholder {
	color: hsl(0, 36%, 70%);
	font-family: 'Josefin Sans', sans-serif;
	font-size: 1.1rem;
	opacity: .8;
} */

.container form .error-text {
  position: absolute;
  left: 2rem;
  top: 2.6rem;
  color: var(--Soft-Red);
  display: none;
}

.container form .error-icon {
  position: absolute; /*top right..像这种设置一般都是跟着position走的，是来决定
    一个元素的具体位置，而MARGIN 是来决定一个元素周围的空间。
    In CSS, top, right, bottom, and left are used to specify the position of an element, 
    while margin is used to create space around an element. */
transform: translateY(35%);
  right: 5.5rem;
  top: 15%;
  display: none;
}

.container form.error .error-icon,
.container form.error .error-text {
	display: block;
}
.container form.error input {
	border: 2px solid hsl(0, 93%, 68%);
}

@media only screen and (min-width: 768px) {
  header {
    position: absolute;
    padding-left: 10%;
  }
  .container {
    flex-direction: row;
    padding-top: 0;
    padding-bottom: 0;
  }
  .container .right {
    width: 80%;
    height: 100vh;
    background-image: url(./images/hero-desktop.jpg);
  }
  .container .left {
    height: 100vh;
    padding-top: 30vh;
    text-align: left;
    padding-left: 10%;
    background-image: url(./images/bg-pattern-desktop.svg);
    background-position: center;
    background-size: cover;
  }
  .container .left h1 {
    font-size: 5rem;
    line-height: 5.5rem;
  }
  .container .left p {
    margin-left: 0;
    font-size: 1.1rem;
  }

  .container form {
    margin-left: 0;
  }
  .container form button {
    width: 5.5rem;
  }

  header img {
    width: 120px;
  }
}
