/* ============================================================================
 * PAGE HOME — toutes les sections
 * ============================================================================ */

/* ═══════════════════════════════════════════════════════════════
 * BRAND HEADER
 * ═══════════════════════════════════════════════════════════════ */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
}
.brand-logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}
.brand-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 5px;
}
.brand-info { flex: 1; text-align: center; }
.brand-info .sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
 * CLOCK CARD (avec météo SVG premium)
 * ═══════════════════════════════════════════════════════════════ */
.clock-card {
  padding: 22px 22px 22px 24px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  /* overflow visible pour laisser le halo de la météo déborder */
  overflow: visible;
}
.clock-date {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}
.clock-time {
  font-size: 3.4rem;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  color: #fff;
}
.clock-weather {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.clock-weather svg { width: 100%; height: 100%; position: relative; z-index: 1; }

/* Halo doré chaud GROS qui déborde la card */
.clock-weather::before {
  content: "";
  position: absolute;
  inset: -50px;
  background:
    radial-gradient(circle at 38% 38%, rgba(251, 191, 36, 0.55), transparent 50%),
    radial-gradient(circle, rgba(251, 191, 36, 0.32), transparent 70%);
  filter: blur(20px);
  z-index: 0;
  animation: weather-halo-pulse 5s ease-in-out infinite;
}

@keyframes weather-halo-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Animations météo */
@keyframes sun-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes sun-rays-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes cloud-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-2px); }
}

.weather-sun-body { animation: sun-breathe 4s ease-in-out infinite; transform-origin: center; }
.weather-sun-rays { animation: sun-rays-rotate 30s linear infinite; transform-origin: center; }
.weather-cloud { animation: cloud-drift 6s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════════
 * BADGE PROGRESS — 4 segments de progression sous l'heure
 * ═══════════════════════════════════════════════════════════════ */
.badge-progress {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Rangée des 4 segments */
.badge-progress-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.badge-segment {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

/* Segment rempli — gradient cyan/teal lumineux */
.badge-segment.done {
  background: linear-gradient(90deg, #34d399 0%, #38bdf8 50%, #4d97ff 100%);
  border-color: transparent;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: segment-fill var(--duration-base) var(--ease-out);
}

@keyframes segment-fill {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

/* Segment "next" — pulse subtil pour indiquer la prochaine action */
.badge-segment.next {
  border-color: rgba(77, 151, 255, 0.32);
  background: rgba(77, 151, 255, 0.08);
  animation: segment-pulse 2.2s ease-in-out infinite;
}

@keyframes segment-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(77, 151, 255, 0);
    border-color: rgba(77, 151, 255, 0.32);
  }
  50% {
    box-shadow: 0 0 12px rgba(77, 151, 255, 0.5);
    border-color: rgba(77, 151, 255, 0.6);
  }
}

/* Ligne info : label prochaine étape + compteur X/04 */
.badge-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}

.badge-progress-label {
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.badge-progress-label .label-prefix {
  color: var(--text-dim);
  font-weight: 500;
}

.badge-progress-label .label-step {
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-progress-counter {
  color: var(--text-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Quand journée terminée */
.badge-progress.done .badge-progress-label .label-step {
  color: var(--success);
}

.badge-progress.done .badge-progress-counter {
  color: var(--success);
}

/* ═══════════════════════════════════════════════════════════════
 * CHANTIER (4 icônes + input + bouton +)
 * ═══════════════════════════════════════════════════════════════ */
.chantier-wrap {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 8px;
}
.chantier-side { display: flex; flex-direction: column; gap: 8px; }
.side-btn {
  flex: 1;
  min-height: 60px;
  border-radius: var(--radius-icon);
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  display: grid; place-items: center;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-base) var(--ease-out);
}
.side-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.08);
}
.side-btn svg {
  width: 28px; height: 28px;
  fill: none; stroke: #fff;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.25));
}

.chantier-input-wrap {
  position: relative;
}
.chantier-input {
  padding: 16px;
  padding-right: 44px;
  border-radius: var(--radius-button);
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  color: var(--text);
  width: 100%;
  font-size: 1.02rem;
  height: 100%;
  min-height: 128px;
}
.chantier-input::placeholder { color: var(--text-muted); }

.chantier-add-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(77, 151, 255, 0.35);
  transition: transform var(--duration-fast) var(--ease-out);
}
.chantier-add-btn:active { transform: scale(0.92); }
.chantier-add-btn svg {
  width: 16px; height: 16px;
  fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round;
}

/* Card "Chantier 2" qui apparaît si on tap + */
.chantier-second {
  display: none;
  margin-top: 8px;
  position: relative;
  padding: 14px 44px 14px 16px;
  border-radius: var(--radius-button);
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  animation: page-enter var(--duration-base) var(--ease-out);
}
.chantier-second.show { display: block; }
.chantier-second-label {
  font-size: 0.7rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-bottom: 4px;
}
.chantier-second-input {
  background: transparent;
  border: none;
  color: var(--text);
  width: 100%;
  font-size: 0.96rem;
  outline: none;
}
.chantier-second-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  display: grid; place-items: center;
}
.chantier-second-remove svg {
  width: 14px; height: 14px;
  fill: none; stroke: #ef4444; stroke-width: 2.5; stroke-linecap: round;
}

/* ═══════════════════════════════════════════════════════════════
 * BADGER — Plus flash, animation plus marquée
 * ═══════════════════════════════════════════════════════════════ */
.badge-btn {
  height: 92px;
  border-radius: 24px;
  /* Plus flash : 3 stops avec un highlight cyan au centre */
  background: linear-gradient(135deg, #3b82ff 0%, #5fa8ff 35%, #4dc1ff 70%, #5fa8ff 100%);
  color: #fff;
  font-size: 1.36rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  box-shadow:
    0 24px 56px rgba(77, 151, 255, 0.55),
    0 6px 20px rgba(77, 151, 255, 0.32),
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 8px rgba(20, 60, 140, 0.4);
  transition: transform var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Reflet brillant qui balaye le bouton */
.badge-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%);
  transform: skewX(-20deg);
  animation: badge-scan 3.5s ease-in-out infinite;
  pointer-events: none;
}

.badge-btn:active {
  transform: scale(0.985);
}

.badge-btn.done {
  background: linear-gradient(135deg, var(--success), var(--success-2));
  box-shadow:
    0 18px 44px rgba(16, 185, 129, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.badge-btn.done::after {
  display: none;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 24px 56px rgba(77, 151, 255, 0.55),
      0 6px 20px rgba(77, 151, 255, 0.32),
      inset 0 2px 0 rgba(255, 255, 255, 0.32),
      inset 0 -2px 8px rgba(20, 60, 140, 0.4);
  }
  50% {
    transform: scale(1.022);
    box-shadow:
      0 30px 70px rgba(77, 151, 255, 0.75),
      0 10px 28px rgba(77, 151, 255, 0.5),
      0 0 0 4px rgba(77, 151, 255, 0.18),
      inset 0 2px 0 rgba(255, 255, 255, 0.4),
      inset 0 -2px 8px rgba(20, 60, 140, 0.4);
  }
}

@keyframes badge-scan {
  0%, 80%, 100% { left: -50%; }
  40%, 50% { left: 110%; }
}

.badge-btn.pulse {
  animation: pulse-badge 1.8s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════
 * MEAL CARD — Pause repas (4 boutons) + Déplacement / Organisation
 * ═══════════════════════════════════════════════════════════════ */
.meal-card {
  border-radius: var(--radius-card);
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
}
.meal-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}
.meal-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.meal-btn {
  min-height: 50px;
  border-radius: var(--radius-icon);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.meal-btn:active { transform: scale(0.96); }
.meal-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(77, 151, 255, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.meal-divider {
  border-top: 1px solid var(--card-stroke);
  margin: 14px 0;
}
.transport-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.transport-btn {
  min-height: 52px;
  border-radius: var(--radius-icon);
  border: 1px solid var(--card-stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.transport-btn:active { transform: scale(0.97); }
.transport-btn.active {
  border-color: rgba(16, 185, 129, 0.55);
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

/* ═══════════════════════════════════════════════════════════════
 * COUNTERS
 * ═══════════════════════════════════════════════════════════════ */
.counters { display: flex; flex-direction: column; gap: 12px; }
.counter {
  border-radius: var(--radius-card);
  padding: 22px 24px;
  display: flex; align-items: center; gap: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
}
.counter-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  display: grid; place-items: center; flex-shrink: 0;
}
.counter-ico svg {
  width: 28px; height: 28px;
  fill: none; stroke: var(--accent);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(77, 151, 255, 0.4));
}
.counter-label {
  flex: 1;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.counter-value {
  font-size: 2.4rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

/* ═══════════════════════════════════════════════════════════════
 * POINTAGES DU JOUR
 * ═══════════════════════════════════════════════════════════════ */
.pointages-section { margin-top: 8px; }
.section-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  margin-bottom: 10px;
  padding-left: 4px;
}
.pointages-card {
  border-radius: var(--radius-card);
  padding: 6px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
}
.pointage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-stroke);
}
.pointage-row:last-child { border-bottom: none; }
.pointage-label {
  flex: 1;
  font-weight: 700;
  font-size: 1rem;
}
.pointage-time {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(15, 30, 60, 0.7);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
}
.pointage-action {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  border: 1px solid;
  transition: transform var(--duration-fast) var(--ease-out);
}
.pointage-action:active { transform: scale(0.92); }
.pointage-action.ok {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}
.pointage-action.del {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.36);
  color: #ef4444;
}
.pointage-action svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round;
}
.pointage-pending {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
}
.pointage-pending-label {
  flex: 1;
  color: var(--orange);
  font-weight: 700;
}
.pointage-add-btn {
  padding: 9px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  transition: transform var(--duration-fast) var(--ease-out);
}
.pointage-add-btn:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════════════════════════
 * TOAST
 * ═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid var(--card-stroke);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
  z-index: 300;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}