/* variables */

:root {
  --main-font: "Poppins", sans-serif;
  --initial-gradient: #48c6ef;
  --final-gradient: #6f86d6;
  --white: #fff;
  --black: #111;
  --red: #ba0909;
}

/* global styles */

html {
  box-sizing: border-box;
  font-size: 62.5%; /* 1rem = 10px */
}

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

body {
  font-family: var(--main-font);
  font-size: 1.4rem;
  line-height: 1.4;
}

[class$="__container"] {
  max-width: 40rem;
  width: 90%; /* cuando el ancho sea menos de 400px va a ocupar el 90% */
  margin: 0 auto; /* centra el contenedor */
}

/* weather-card */

.weather-card {
  background-image: linear-gradient(
    to right,
    var(--initial-gradient) 0%,
    var(--final-gradient) 100%
  );
  margin-top: 7rem;
  margin-bottom: 3rem;
  padding: 2rem;
  border-radius: 2rem;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

@media (min-width: 468px) {
  .weather-card {
    margin-top: 12rem;
    padding: 3rem;
  }
}

.form__select {
  background-color: var(--white);
  margin-top: 2rem;
  width: 80%;
  padding: 0.8rem;
  border-radius: 2rem;
  border-style: solid;
}

.form__container-flex {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.form__input {
  max-width: 80%;
  padding: 0.4rem 2rem;
  border-radius: 2rem;
  border-style: solid;
}

.form__btn {
  width: 4rem;
  height: 4rem;
  background-color: var(--white);
  border-style: solid;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 60%;
}

.form__btn:hover {
  cursor: pointer;
}

.btn-icon {
  width: 60%;
}

/* weather-card__main */
.weather-card__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--white);
}

.weather-card-image {
  margin-top: 4rem;
}

.weather-icon {
  width: 20rem;
  height: 20rem;
}

.information {
  text-align: center;
}

.information__temperature {
  margin: 1rem 0;
  font-size: 4.4rem;
  font-weight: 600;
}

.information__city {
  font-size: 2.4rem;
  font-weight: 600;
}

.information__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-content: center;
}

.information__additional {
  font-size: 1.8rem;
}

/* alerts */

.alerts {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6rem;
}

.alert {
  max-width: 40rem;
  width: 90%;
  background-color: var(--red);
  color: var(--white);
  padding: 0.6rem;
  border-radius: 1rem;
}

.alert__text {
  text-align: center;
  font-weight: 600;
}

/* loader */

.loader {
  margin-top: 6rem;
  margin-bottom: 6rem;
  width: 5rem;
  height: 5rem;
  border: 5px solid #fff;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
