:root {
  font-size: 62.5%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", system-ui, sans-serif;
}

.hidden {
  display: none;
}

.app {
  min-height: 100vh;
  background: #f6f9fc;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.card {
  width: 100%;
  max-width: 42rem;
  background: white;
  padding: 3rem 2.5rem;
  border-radius: 2rem;
  box-shadow: 0 2rem 4rem rgba(0,0,0,0.08);
  text-align: center;
}

.card h1 {
  font-size: 3.2rem;
  color: #2563eb;
  margin-bottom: 2.4rem;
}

form {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

form input {
  flex: 1;
  padding: 1.1rem 1.3rem;
  border-radius: 1rem;
  border: 0.15rem solid #2563eb;
  font-size: 1.5rem;
  outline: none;
}

form input::placeholder {
  color: #9ca3af;
}

form button {
  padding: 1.1rem 1.6rem;
  border-radius: 1rem;
  border: none;
  background: #2563eb;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.2s ease;
}

form button:hover {
  background: #1d4ed8;
}

.weather h2 {
  font-size: 2.6rem;
  color: #111827;
  margin-bottom: 1rem;
}

.temp {
  font-size: 4.2rem;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 0.6rem;
}

.desc {
  font-size: 1.6rem;
  color: #6b7280;
  margin-bottom: 2rem;
  text-transform: capitalize;
}

.meta {
  display: flex;
  justify-content: space-between;
  font-size: 1.4rem;
  color: #374151;
}

.loader {
  width: 3.6rem;
  height: 3.6rem;
  border: 0.4rem solid #e5e7eb;
  border-top: 0.4rem solid #2563eb;
  border-radius: 50%;
  margin: 2rem auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.error {
  color: #dc2626;
  font-size: 1.4rem;
  margin-top: 1.4rem;
}

/* ✅ Responsive */

@media (max-width: 768px) {
  .card {
    padding: 2.5rem 2rem;
  }

  .temp {
    font-size: 3.8rem;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 58%;
  }

  form {
    flex-direction: column;
  }

  form button {
    width: 100%;
  }

  .card {
    padding: 2.3rem 1.8rem;
  }

  .temp {
    font-size: 3.4rem;
  }

  .meta {
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (max-width: 360px) {
  :root {
    font-size: 55%;
  }
}
