@font-face {
  font-family: "Delius";
  src: url("../fonts/delius.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bleu: #003559;
  --bleu-clair: #eef3f9;
  --rouge: #a91417;
  --gris: #5b6b7b;
  --bordure: #b0d4f1;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--bleu);
  background: #1c2b3a url("../images/fond_login.webp") center center / cover no-repeat fixed;
}

/* Carte centrale, même style que les fenêtres du site */
.carte {
  width: 100%;
  max-width: 760px;
  padding: 36px 30px 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.3);
  animation: apparition 0.8s ease-out both;
}

@keyframes apparition {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

h1 {
  margin: 0 0 6px;
  font-family: "Delius", cursive;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--bleu);
}

.sous-titre {
  margin: 0 0 26px;
  color: var(--gris);
  font-size: 1.05rem;
}
.sous-titre:empty, .pied:empty { display: none; }

.compteur {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.bloc {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 6px 14px;
  background: #f8fbff;
  border: 1px solid var(--bordure);
  border-radius: 14px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.bloc:hover {
  box-shadow: 0 0 0 2px rgba(171, 20, 23, 0.6);
  transform: scale(1.03);
}

.valeur {
  font-family: "Delius", cursive;
  font-size: clamp(2rem, 8vw, 3.6rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--bleu);
}

.unite {
  margin-top: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gris);
}

.date-cible {
  margin: 24px 0 0;
  color: var(--gris);
  font-size: 0.95rem;
}

.message-fin {
  margin: 0;
  font-family: "Delius", cursive;
  font-style: italic;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--rouge);
}

.pied {
  margin: 12px 0 0;
  color: var(--gris);
  font-size: 0.85rem;
}

/* Une fois la date atteinte : on remplace les blocs par le message */
.termine .compteur, .termine .date-cible { display: none; }
.termine .message-fin { margin-top: 10px; }

@media (max-width: 520px) {
  .carte { padding: 28px 16px 22px; }
  .compteur { gap: 8px; }
  .bloc { padding: 14px 2px 10px; }
  .unite { font-size: 0.7rem; letter-spacing: 0.02em; }
}

@media (prefers-reduced-motion: reduce) {
  .carte { animation: none; }
  .bloc { transition: none; }
}
