:root {
  --bg_main: #0a1f44;
  --text_light: #fff;
  --text_med: #53627c;
  --text_dark: #1e2432;
  --red: #ff1e42;
  --darkred: #c3112d;
  --orange: #ff8c00;
}

/* * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-weight: normal;
} */

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #091f44;
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-weight: 400;
  line-height: 27px;
  overflow: auto;
  &::-webkit-scrollbar {
    width: 1px;
  }
}

.container {
  width: 90dvw;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

h1 {
  font-size: 25px;
  text-align: center;
}

/* input form and submit */
.form__group {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
  width: 100%;
  max-width: 90dvw;
  margin: 0 auto;
}

.form__field {
  font-family: inherit;
  width: 100%;
  border: none;
  border-bottom: 1px solid #ffffff;
  outline: 0;
  font-size: 16px;
  color: #fff;
  padding: 6px 0;
  background: transparent;
  transition: border-color 0.2s;
  margin-right: 10px;
}

.form__field::placeholder {
  color: transparent;
}

.form__field:placeholder-shown ~ .form__label {
  font-size: 22px;
  cursor: text;
  top: 20px;
}

.form__label {
  position: absolute;
  top: 0;
  display: block;
  transition: 0.2s;
  font-size: 17px;
  color: #ffffff;
  pointer-events: none;
}

.form__field:focus {
  padding-bottom: 6px;
  font-weight: 700;
  border-width: 1px;
  border-image: linear-gradient(to right, #116399, #38caef);
  border-image-slice: 1;
}

.form__field:focus ~ .form__label {
  position: absolute;
  top: 0;
  display: block;
  transition: 0.2s;
  font-size: 22px;
  color: #38caef;
  font-weight: 700;
}

/* reset input */
.form__field:required,
.form__field:invalid {
  box-shadow: none;
}

.form__submit {
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  padding: 12px;
  font-size: 18px;
  background-color: #ff1d42;
  color: #ffffff;
  border: 0;
  border-radius: 7px;
}

.top-banner form .form__submit {
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 15px 20px;
  border-radius: 5px;
  background: var(--red);
  transition: background 0.3s ease-in-out;
}

.top-banner form .form__submit:hover {
  background: var(--darkred);
}

.top-banner form .msg {
  position: absolute;
  bottom: -40px;
  left: 0;
  max-width: 450px;
  min-height: 40px;
  text-transform: capitalize;
}

/* CITIES */
.section {
  margin: 70px 0 20px;
}

.section .cities {
  display: grid;
  grid-gap: 32px 20px;
  grid-template-columns: repeat(4, 1fr);
}

.section .city {
  position: relative;
  padding: 40px 8%;
  border-radius: 20px;
  background: var(--text_light);
  color: var(--text_med);
}

.section .city::after {
  content: "";
  width: 90%;
  height: 50px;
  position: absolute;
  bottom: -12px;
  left: 5%;
  z-index: -1;
  opacity: 0.3;
  border-radius: 20px;
  background: var(--text_light);
}

.section figcaption {
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section .city-temp {
  font-size: 5rem;
  font-weight: bold;
  margin-top: 10px;
  color: var(--text_dark);
}

.section .city sup {
  font-size: 0.5em;
}

.section .city-name sup {
  padding: 0.2em 0.6em;
  border-radius: 30px;
  color: var(--text_light);
  background: var(--orange);
}

.section .city-icon {
  margin-top: 10px;
  width: 100px;
  height: 100px;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.logs {
  line-break: anywhere;
}

/* FOOTER
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.page-footer {
  text-align: center;
  font-size: 1rem;
  color: var(--text_light);
  margin-top: 40px;
}

.page-footer span {
  color: var(--red);
}

/* MQ
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media screen and (max-width: 1000px) {
  body {
    padding: 30px;
  }

  .section .cities {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 700px) {
  .heading,
  .section .city-temp {
    font-size: 3rem;
  }

  .section {
    margin-top: 20px;
  }

  .top-banner form {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-banner form input,
  .top-banner form button {
    width: 100%;
  }

  .top-banner form button {
    margin: 20px 0 0 0;
  }

  .top-banner form .msg {
    position: static;
    max-width: none;
    min-height: 0;
    margin-top: 10px;
  }

  .section .cities {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 500px) {
  body {
    padding: 15px;
  }

  .section .cities {
    grid-template-columns: repeat(1, 1fr);
  }
  .form__submit {
    display: none;
  }
}

/* API Key banner
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.api {
  background: #fffbbc;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px;
}

.api a {
  text-decoration: underline;
}

.api a:hover {
  text-decoration: none;
}
