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

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

body {
  background-color:#404b6f /* #2c3550 /*#f4f7f6*/;
  text-align: center;
  font-family: 'Segoe UI', sans-serif;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  display: flex;
  /* padding-left: 20px; */
  /* padding-right: 20px; */

  padding: clamp(10px, 2vw, 20px);

  }

:root {
  --bg-blue: #3b5aa3; /*#005ba4; */
  --bg-green: #32914a; /*#019c16;*/
  --bg-red: #d9463b ;/* #e30613;*/
  --bc-totaux: white; /* #ff3623;*/

  /*LOGIN*/
  --card-bg: #ffffff;
  --input-bg: #f9f9f9;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --accent: #ff1642;
  --accent-hover: #ff0750;
  }

.main-card {
  background: rgb(244, 244, 245);
  width: 95vw;
  height: 98vh;
  /* border-radius: 45px; */
  /* box-shadow: 0 35px 70px rgba(0,0,0,0.15); */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* padding: 1rem; */
  box-sizing: border-box;

  border-radius: clamp(20px, 4vw, 45px);
  box-shadow: 0 clamp(15px, 3vw, 35px) clamp(30px, 6vw, 70px) rgba(0,0,0,0.15);
  padding: clamp(0.5rem, 2vw, 1rem);
  overflow: hidden;
}

/* HEADER */
.header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  /* margin-bottom: 20px; */

  margin-bottom: clamp(10px, 2vh, 20px);
  flex-shrink: 0;
  flex-wrap: wrap; /* Si les éléments ne rentrent pas, ils passent à la ligne */
  gap: 10px; /* Espace entre les éléments flex */
}

.logo-bc { 
  /* height: 60px;  */

  height: clamp(35px, 5vw, 60px);
}

/* .logo {
  max-width: 180px;
  margin-bottom: 45px;
} */

/* SCREENS */
.screen { 
  display: none; 
  flex-grow: 1; 
  animation: fadeIn 0.8s ease-in-out;

  overflow-y: auto;
  min-height: 0;
}

.active { 
  display: flex; 
  flex-direction: column; 
}

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

/* .container {
  max-width: 1024px; /* Légèrement plus large pour accommoder les espaces *//*
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
} */




.counter-wrapper {
  /* margin-bottom: 60px; */

  margin-bottom: clamp(20px, 4vh, 60px);

}

.counter-label {
  /* font-size: 1.7rem; */
  font-weight: 600;
  color: #333;
  /* margin-bottom: 25px; */

  font-size: clamp(1rem, 3.5vw, 2.4rem);
  margin-bottom: clamp(10px, 4vh, 35px);
}

  /* ===== COMPTEUR FLIP PAR BLOCS ===== */
.flip-counter-delta {
  display: flex;
  justify-content: center;
  /*gap: 10px; /* Espacement entre le Nombre et le delta */

  align-items: center;
  gap: clamp(5px, 1vw, 10px);
  flex-wrap: wrap;
}

.flip-counter {
  display: flex;
  justify-content: center;
 /* gap: 8px; /* Espacement standard entre les chiffres */

  gap: clamp(4px, 0.6vw, 8px);
}

.flip-digit {
  /* width: 60px; */
  /* height: 85px; */
  color: #ffffff;
  /* font-size: 3.2rem; */
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  /* border-radius: 10px; */
  box-shadow: inset 0 -4px 0 rgba(255,255,255,0.2);
  font-family: "Courier New", monospace;

  width: clamp(30px, 6vw, 75px);
  height: clamp(45px, 8.5vw, 107px);
  font-size: clamp(1.5rem, 4vw, 4.1rem);
  border-radius: clamp(5px, 1.2vw, 15px);
}

  /* À partir de la droite, ajouter un019c16 espace plus large après chaque groupe de 3 chiffres, sauf le dernier */
.flip-digit:nth-last-child(4),
.flip-digit:nth-last-child(7),
.flip-digit:nth-last-child(10) {
  /* margin-right: 25px; */

  margin-right: clamp(10px, 3vw, 40px);
}

.delta-big {
  /* margin-left: 30px;  */
  /* padding: 10px 25px;  */
  background: #f8f9fa; 
  /* border-radius: 20px; */
  /* border-left: 4px solid #019c16;  */
  text-align: left; 
  /* height: 100%; */

  margin-left: clamp(10px, 3vw, 50px);
  padding: clamp(6px, 1vw, 20px) clamp(12px, 3vw, 40px);
  border-radius: clamp(10px, 2vw, 30px);
  border-left: clamp(3px, 0.6vw, 8px) solid #019c16;
}

.delta-big-val { 
  /* font-size: 2.0rem;  */
  font-weight: 800; 
  color: #019c16; 

  font-size: clamp(1.1rem, 2.5vw, 2.5rem);
}

.delta-big-label { 
  /* font-size: 0.80rem;  */
  color: #888; 
  text-transform: uppercase; 
  letter-spacing: 1px; 

  font-size: clamp(0.6rem, 1vw, 1rem);
}

.bg-red { background: var(--bg-red); }
.bg-blue { background: var(--bg-blue);}
.bg-green { background: var(--bg-green); }

#timestamp { 
  font-weight: 600; 
  color: #555; 

  font-size: clamp(0.8rem, 1.2vw, 1rem);
}


  /* Bouton Page suivante (style principal) */
.btn-next {
    /* padding: 12px 24px; */
    background: linear-gradient(135deg, #ff1642, #ff5407);
    border: none;
    /* border-radius: 10px; */
    color: white;
    font-family: 'Inter', sans-serif;
    /* font-size: 0.95rem; */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;

    padding: clamp(8px, 1.2vw, 12px) clamp(16px, 2vw, 24px);
    border-radius: clamp(6px, 1vw, 10px);
    font-size: clamp(0.75rem, 1.1vw, 0.95rem);
    transition: all 0.2s ease;
}

.btn-next:hover {
  background: linear-gradient(135deg, #ff0750, #ff5a01);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 22, 66, 0.3);
}

  /* Bouton Déconnexion (style secondaire) */
.btn-logout {
  /* padding: 12px 24px; */
  background: transparent;
  border: 2px solid #ff1642;
  /* border-radius: 10px; */
  color: #ff1642;
  font-family: 'Inter', sans-serif;
  /* font-size: 0.95rem; */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;

  padding: clamp(8px, 1.2vw, 12px) clamp(16px, 2vw, 24px);
  border-radius: clamp(6px, 1vw, 10px);
  font-size: clamp(0.75rem, 1.1vw, 0.95rem);
}

.btn-logout:hover {
  background: #ff1642;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 22, 66, 0.3);
}

  /* FOOTER */
.footer { 
  margin-top: auto; 
  /* padding-top: 20px;  */
  border-top: 1px solid #eee; 
  text-align: center; 
  color: #bbb; 
  /* font-size: 0.9rem;  */

  padding-top: clamp(10px, 1.5vh, 20px);
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  flex-shrink: 0;
}


/* RESPONSIVE */
/* Tablette portrait */
@media (max-width: 768px) {
    .flip-counter-delta {
        flex-direction: column;
    }
    
    .delta-big {
        margin-left: 0;
        margin-top: 10px;
        border-left: none;
        border-top: 3px solid #019c16;
        text-align: center;
    }
    
    .header {
        justify-content: center;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .main-card {
        border-radius: 15px;
        padding: 8px;
    }
    
    .flip-digit {
        width: 22px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .flip-digit:nth-last-child(4),
    .flip-digit:nth-last-child(7),
    .flip-digit:nth-last-child(10) {
        margin-right: 8px;
    }
}
/* Mobile paysage */
@media (max-height: 500px) {
    .counter-wrapper {
        margin-bottom: 15px;
    }
    
    .flip-digit {
        height: 40px;
    }
}
