:root {
  --bg-dark: rgba(0,0,0,.55);
  --accent-green: #22c55e;  /* vert (chiffres/tonalité générale) */
  --accent-blue:  #2563eb;  /* bleu (bouton Modifier) */
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}

/* Centrage parfait de la carte */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  overflow-x: hidden;
}

/* Calque image de fond flouté (défini dans index.php via style inline .bg) */
.bg {
  position: fixed; inset: 0; z-index: -2;
  filter: blur(12px);
  transform: scale(1.06); /* évite les bords visibles après blur */
}

/* Overlay assombri au-dessus du fond */
.overlay {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.65));
}

/* Carte principale */
.card {
  position: relative; z-index: 0;
  width: min(960px, 92vw);
  background: var(--bg-dark);
  color:#fff;
  border:1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  padding: clamp(20px,5vw,40px);
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

/* En-tête */
.header {
  display:flex; align-items:center; justify-content:center;
  gap:16px; margin-bottom:16px;
}
.logo {
  height: clamp(36px,6vw,64px);
  width:auto;
  border-radius:10px;
  background: rgba(255,255,255,.08);
  padding:6px;
}
.title {
  font-size: clamp(22px,4vw,34px);
  font-weight: 700;
  letter-spacing: .5px;
}

/* Compteur */
.countdown {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 16px;
}
.box {
  background: rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.15);
  border-radius:16px;
  padding: clamp(14px,3vw,20px);
}
.num {
  font-size: clamp(28px,7vw,56px);
  font-weight: 800;
  line-height:1;
  color: var(--accent-green);       /* Nombres en vert */
}
.label {
  font-size: clamp(11px,2.2vw,14px);
  opacity:.95;
  margin-top:6px;
  text-transform: uppercase;
  letter-spacing:.08em;
  color: #86efac;                   /* Libellés vert clair */
}

/* Barre de progression */
.progress-wrap { margin-top: 28px; }
.progress-bar {
  height: 14px;
  background: rgba(255,255,255,.18);
  border-radius:999px; overflow:hidden;
  border:1px solid rgba(255,255,255,.2);
}
.progress-inner {
  height: 100%; width:0%;
  background: linear-gradient(90deg,#bbf7d0,#86efac,#22c55e);
  transition: width .6s ease;
}
.progress-meta {
  display:flex; justify-content:space-between; flex-wrap:wrap;
  font-size:12px; opacity:.9; margin-top:8px; gap:8px;
}

/* Boutons */
.actions {
  margin-top: 28px;
  display:flex; flex-wrap:wrap;
  gap:12px; justify-content:center;
}
.btn {
  border:none; border-radius:999px;
  padding:10px 18px;
  font-weight:700; cursor:pointer;
  color:#fff;
  background: linear-gradient(135deg,#22c55e,#16a34a); /* vert par défaut */
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.btn.btn-edit {
  background: linear-gradient(135deg,#3b82f6,#2563eb); /* bouton “Modifier la date” en bleu */
}
.btn.secondary {
  background: rgba(255,255,255,.15);
  color:#fff;
  border:1px solid rgba(255,255,255,.25);
}

/* Dialogs */
dialog {
  width:min(520px,92vw);
  border:1px solid rgba(255,255,255,.2);
  border-radius:16px;
  background:#1f1f28;
  color:#fff;
  padding:20px;
}
dialog::backdrop {
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.modal-head { font-weight:800; font-size:20px; margin-bottom:10px; }
.field { display:grid; gap:6px; margin:12px 0; }
input[type="datetime-local"], input[type="password"] {
  width:100%; padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color:#fff;
}
.row { display:flex; gap:10px; justify-content:flex-end; margin-top:6px; }
.msg-error { color:#fca5a5; display:none; margin-top:8px; }

/* =========================
   RESPONSIVE — mobile
   1ère ligne : JOURS (pleine largeur)
   2e  ligne : HEURES (pleine largeur)
   3e  ligne : MINUTES + SECONDES (2 colonnes)
   ========================= */
@media (max-width: 640px) {
  .countdown {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "days days"
      "hours hours"
      "minutes seconds";
  }

  /* map tuiles -> zones */
  .box-days    { grid-area: days; }
  .box-hours   { grid-area: hours; }
  .box-minutes { grid-area: minutes; }
  .box-seconds { grid-area: seconds; }
}

/* Très petit écran : 1 tuile par ligne (ordre conservé) */
@media (max-width: 380px) {
  .countdown {
    grid-template-columns: 1fr;
    grid-template-areas:
      "days"
      "hours"
      "minutes"
      "seconds";
  }
}
