@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

/* CSS reset */

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

* {
  margin: 0;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* general styling */

:root {
  /* Primary */

  --Red: hsl(0, 100%, 74%);
  --Green: hsl(154, 59%, 51%);

  /* Accent */

  --Blue: hsl(248, 32%, 49%);

  /* Neutral */

  --Dark-Blue: hsl(249, 10%, 26%);
  --Grayish-Blue: hsl(246, 25%, 77%);
}

body {
//   display: flex;
  justify-content: center;
//   padding: 3rem 0;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  color: white;
  background-color: var(--Red);
  background-image: url("images/bg-intro-mobile.png");
}

#main {
//   max-width: 375px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
}

/* separate styling */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 3rem;
}

.hero__title {
  padding: 1rem;
  font-size: 1.75rem;
}

.sign-up {
  width: 100%;
}

.sign-up__desc {
  padding: 1rem 5rem;
  margin-bottom: 1.75rem;
  border-radius: 0.8rem;
  box-shadow: 0 8px 0px rgba(0, 0, 0,0.15);
  background-color: var(--Blue);
  text-align: center;
}

.sign-up__desc span {
  font-weight: bold;
}

.sign-up__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem;
  border-radius: 0.8rem;
  box-shadow: 0 8px 0px rgba(0, 0, 0,0.15);
  color: var(--Grayish-Blue);
  background-color: white;
}

.form__input {
  width: 100%;
  margin-bottom: 1em;
  position: relative;
}

.form__input span {
  position: absolute;
  top: 22%;
  right: 2ch;
  padding: 0 0.65em;
  border-radius: 50%;
  background-color: var(--Red);
  color: white;
  display: none;
}

.form__input.warning span {
  display: inline-block;
}

.form__input input {
  width: 100%;
  padding: 1em;
  border: 2px solid hsla(246, 25%, 77%, 0.25);
  border-radius: 0.5em;
  font-weight: 600;
  color: var(--Dark-Blue);
}

.form__input input:focus {
  outline: none;
  border: 2px solid hsla(246, 25%, 77%, 1);
}

.form__input.warning input {
  border: 2px solid var(--Red);
}

.form__input p {
  margin: 0.2em 0.75em 0 0;
  display: none;
  font-size: 0.75rem;
  text-align: right;
  font-style: italic;
  color: var(--Red);
}

.form__input.warning p {
  display: block;
}

.submit-btn {
  cursor: pointer;
  width: 100%;
  padding: 1em;
  margin-bottom: 1em;
  border: 1px solid var(--Green);
  border-bottom: 5px solid hsl(154, 59%, 47%);
  border-radius: 0.5em;
  background-color: var(--Green);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2ch;
}

.submit-btn:hover {
  background-color: hsl(154, 59%, 60%);
  border-bottom: 5px solid hsl(154, 59%, 55%);
}

.form__terms {
  max-width: 35ch;
  margin-bottom: 0.75em;
  font-size: 0.8rem;
  text-align: center;
}

.form__terms span {
  font-weight: 700;
  color: var(--Red);
}

/* attribution styling */

footer {
  position: absolute;
  top: 0;
}

.attribution {
  color: white;
  opacity: 0.7;
}

.attribution a {
  color: var(--Dark-Blue);
  text-decoration: underline;
}

.attribution a:hover {
  color: var(--Blue);
}

/* media queries */

@media (min-width: 1000px) {
  body {
    align-items: center;
    min-height: 100vh;
    background-image: url("images/bg-intro-desktop.png");
  }

  main {
    max-width: 100vw;
    flex-direction: row;
    justify-content: center;
  }

  .hero {
    align-items: flex-start;
    text-align: left;
    width: 45%;
    margin-right: 1rem;
  }

  .hero__title {
    max-width: 15ch;
    padding: 0;
    margin-bottom: 2rem;
    font-size: 3rem;
    line-height: 1.25em;
  }

  .hero__desc {
    max-width: 75ch;
  }

  .sign-up {
    width: 45%;
  }

  .sign-up__form {
    padding: 1.75rem;
  }

  .sign-up__form input {
    padding-left: 1.5em;
  }

  .form__terms {
    max-width: 55ch;
  }
}
