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

body {
  font-family: 'Roboto', sans-serif;
  background: #22234f;
  color: #fff;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

main {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

h1 {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}

#date {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.03em;
}

#cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#cards .card:not(:first-child) {
  opacity: 0.55;
}

.card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card--alert {
  background: rgba(238, 77, 85, 0.12);
  border-color: #ee4d55;
}

.card--closed {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.3);
}

.card__label {
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
}

.card__temp {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.card--alert .card__temp {
  color: #ee4d55;
}

.card__status {
  font-size: 1rem;
  font-weight: 400;
  margin-top: 0.2rem;
}

.card__detail {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.1rem;
}

.error {
  color: #ee4d55;
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
  padding-top: 2rem;
}

/* ─── Chargement ─────────────────────────────────────────────────────────── */

#loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  font-weight: 300;
}

#loading[hidden] { display: none; }

.spinner {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Bouton comparatif ──────────────────────────────────────────────────── */

#compare-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0.25rem 0;
  align-self: center;
}

#compare-btn:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal__panel {
  position: relative;
  background: #2a2b60;
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  max-height: 85dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slide-up 0.22s ease;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal__close {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
}

.modal__title {
  font-size: 1rem;
  font-weight: 700;
  margin-top: -0.5rem;
}

.modal__section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal__plan-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ee4d55;
}

.modal__plan-detail {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.modal__pdf-link {
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
  font-weight: 300;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-top: 0.5rem;
}
