/* ==========================================================================
   KIOSQUE STORES - TABLETTE 1280x800
   Design épuré, héro sliders verticaux, sans boutons, sans scroll
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  
  --bg-app: #090a0f;
  --bg-card: #14151d;
  --bg-card-sub: #1a1c26;
  --border-card: rgba(255, 255, 255, 0.08);
  --border-slider: rgba(255, 255, 255, 0.12);

  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --radius-card: 26px;
  --radius-slider: 36px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-family);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
}

/* ==========================================================================
   STRUCTURE FLUIDE KIOSK 1280x800 (100dvh, ZERO SCROLL)
   ========================================================================== */
.app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 12px 20px 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
}

/* ==========================================================================
   1. EN-TÊTE : HEURE / DATE + STATUTS TABLETTE (WIFI & BATTERIE)
   ========================================================================== */
.top-bar {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: baseline;
  flex-shrink: 0;
}

.header-left > * + * {
  margin-left: 10px;
}

.clock {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1;
}

.clock-dot {
  color: var(--text-dim);
  font-size: 1.2rem;
  line-height: 1;
}

.date {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* NAVIGATION HAUTE (VOLETS, PRISES, AMPOULES) */
.header-nav {
  display: inline-flex;
  align-items: center;
  background: rgba(20, 21, 29, 0.95);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.header-nav > * + * {
  margin-left: 4px;
}

.nav-tab {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-tab .tab-label {
  margin-left: 8px;
}

.nav-tab .tab-svg {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab:active {
  transform: scale(0.96);
}

.nav-tab.active {
  background: #252738;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.nav-tab.active .tab-svg {
  stroke: var(--accent-cyan);
}

.header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-right > * + * {
  margin-left: 10px;
}

.status-chip {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, color 0.2s;
}

.status-chip .chip-text {
  margin-left: 8px;
}

.apk-download-btn {
  text-decoration: none;
  cursor: pointer;
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

.apk-download-btn[hidden] {
  display: none !important;
}

.apk-download-btn:active {
  transform: scale(0.95);
}

.chip-svg {
  display: block;
  flex-shrink: 0;
}

.chip-text {
  line-height: 1;
  white-space: nowrap;
}

.status-chip.offline {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.status-chip.wifi-indicator {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.status-chip.wifi-indicator.is-online {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.25);
}

.status-chip.wifi-indicator.offline {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   2. GESTION DES VUES (PANELS)
   ========================================================================== */
.view-panel {
  flex: 1;
  min-height: 0;
  display: none;
}

.view-panel.active {
  display: grid;
}

.view-panel[hidden] {
  display: none !important;
}

/* VUES ÉQUIPEMENTS (PRISES & AMPOULES) */
.view-devices.active {
  display: flex;
  flex-direction: column;
}

.devices-panel-inner {
  flex: 1;
  min-height: 0;
  background: linear-gradient(180deg, #151620 0%, #101117 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  overflow-y: auto;
}

.devices-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.panel-title-group {
  display: flex;
  align-items: center;
}

.panel-title-group > * + * {
  margin-left: 14px;
}

.devices-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.devices-count-pill {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.panel-hint {
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Grille des cartes d'appareils */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-gap: 18px;
  gap: 18px;
  align-content: start;
}

/* Carte individuelle d'équipement */
.device-card {
  background: var(--bg-card-sub);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.device-card-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  margin-right: 16px;
}

.device-card-left > * + * {
  margin-left: 16px;
}

.device-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.device-card.is-on .device-icon-box {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.3);
}

.device-card.is-light-card.is-on .device-icon-box {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
}

.device-card.is-on {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(26, 28, 38, 0.95) 100%);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.12);
}

.device-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.device-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.device-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.device-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  margin-right: 6px;
}

.device-card.is-on .device-status-pill {
  color: #4ade80;
}

.device-card.is-on .device-status-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.device-card.is-light-card.is-on .device-status-pill {
  color: #fbbf24;
}

.device-card.is-light-card.is-on .device-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* Bouton Toggle Tactile Ergonomique */
.device-toggle-btn {
  width: 74px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.device-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.device-toggle-btn:active {
  transform: scale(0.94);
}

.device-toggle-btn .toggle-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #94a3b8;
  display: block;
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.device-toggle-btn.is-active {
  background: rgba(34, 197, 94, 0.28);
  border-color: rgba(34, 197, 94, 0.6);
}

.device-card.is-light-card .device-toggle-btn.is-active {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.6);
}

.device-toggle-btn.is-active .toggle-thumb {
  transform: translateX(30px);
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
}

.device-card.is-light-card .device-toggle-btn.is-active .toggle-thumb {
  background: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}

/* État vide (Empty State) */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

.empty-state > * + * {
  margin-top: 16px;
}

.empty-icon-box {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.empty-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
}

.empty-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.5;
}

/* ==========================================================================
   3. GRILLE DES 2 CARTES DE STORES (REMPLISSAGE PLEIN ÉCRAN)
   ========================================================================== */
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 20px;
  gap: 20px;
}

.card {
  background: linear-gradient(180deg, #151620 0%, #101117 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 18px 24px 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* En-tête de la carte : Titre + Tag pièce + Batterie du moteur */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.title-group {
  display: flex;
  align-items: center;
}

.title-group > * + * {
  margin-left: 12px;
}

.card-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.room-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 6px;
}

/* Batterie AM43 du store (interactive, lisible, actualisable au toucher) */
.motor-battery {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.motor-battery > * + * {
  margin-left: 8px;
}

.motor-battery:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.5);
}

.motor-battery:active {
  transform: scale(0.95);
}

.motor-battery:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.motor-battery-pct {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.2px;
}

.battery-reload-icon {
  color: var(--text-muted);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
  flex-shrink: 0;
}

.motor-battery:hover .battery-reload-icon {
  color: #38bdf8;
}

.motor-battery.is-loading .battery-reload-icon {
  animation: spin-reload 0.8s linear infinite;
  color: #38bdf8;
}

@keyframes spin-reload {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   3. LE GRAND SLIDER HERO (REMPLIT L'ESPACE, TACTILE & MODERNE)
   ========================================================================== */
.slider-container {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-slider {
  width: 100%;
  max-width: 380px;
  height: 100%;
  max-height: 520px;
  min-height: 220px;
  position: relative;
  border-radius: var(--radius-slider);
  overflow: hidden;
  background-color: #171822;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 30px,
    rgba(255, 255, 255, 0.035) 30px,
    rgba(255, 255, 255, 0.035) 32px
  );
  border: 2px solid var(--border-slider);
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.7), 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: ns-resize;
  touch-action: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hero-slider:focus-visible,
.hero-slider.is-dragging {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 24px rgba(56, 189, 248, 0.3);
  outline: none;
}

/* CALQUE 1 (ARRIÈRE-PLAN) : Progression physique réelle du volet (60fps fluide) */
.slider-real-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.6) 0%, rgba(2, 132, 199, 0.45) 100%);
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 28px,
    rgba(255, 255, 255, 0.16) 28px,
    rgba(255, 255, 255, 0.16) 30px
  );
  border-top: 3.5px solid #ffffff;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.65);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.hero-slider.is-moving .slider-real-fill {
  opacity: 1;
}

/* CALQUE 2 (PREMIER-PLAN) : Jauge de consigne demandée par l'utilisateur */
.slider-track-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 100%),
                    repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(0, 0, 0, 0.14) 30px, rgba(0, 0, 0, 0.14) 32px);
  border-top: 3.5px solid #ffffff;
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.65);
  pointer-events: none;
  transition: height 0.08s ease-out, opacity 0.3s ease;
  z-index: 2;
}

/* En glissement direct : 0ms de latence pour coller immédiatement au doigt */
.hero-slider.is-dragging .slider-track-fill {
  transition: none !important;
}

/* En mouvement : la consigne reste visible à son niveau avec repère néon */
.hero-slider.is-moving .slider-track-fill {
  opacity: 0.35;
  border-top: 2.5px dashed #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

/* Repère lumineux de la cible demandée */
.target-marker {
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
}

.hero-slider.is-moving .target-marker,
.hero-slider.is-dragging .target-marker {
  opacity: 1;
}

.target-marker-tag {
  background: #0284c7;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

/* Contenu textuel et indicateurs superposés */
.slider-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 22px 18px;
  pointer-events: none;
  z-index: 4;
}

/* Flèches indicatrices haut/bas */
.slider-top-arrow,
.slider-bottom-arrow {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.arrow-icon {
  font-size: 1rem;
  color: var(--accent-cyan);
}

.arrow-label {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-left: 8px;
}

/* Métriques centrales : grand pourcentage + statut */
.slider-metrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.95);
  pointer-events: auto;
}

.slider-number {
  font-size: 5.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 0.92;
  letter-spacing: -2.5px;
  display: flex;
  align-items: baseline;
}

.pct-sign {
  font-size: 2.3rem;
  font-weight: 700;
  color: #bae6fd;
  margin-left: 4px;
}

.slider-status {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #ffffff;
  text-transform: uppercase;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.45);
  padding: 5px 18px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

/* Badge d'interruption instantanée (Tap / Clic direct) */
.slider-stop-badge {
  display: none;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  padding: 12px 32px;
  min-height: 48px;
  border-radius: 28px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.5);
  animation: stopPulse 1.2s infinite alternate ease-in-out;
  transition: transform 0.1s, background-color 0.15s;
  z-index: 50;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.slider-stop-badge:active {
  transform: scale(0.92);
  background: #dc2626;
}

.stop-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.stop-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-left: 10px;
}

@keyframes stopPulse {
  0% { transform: scale(0.97); box-shadow: 0 0 14px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.03); box-shadow: 0 0 26px rgba(239, 68, 68, 0.95); }
}

/* État actif pendant le mouvement du volet */
.hero-slider.is-moving {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 28px rgba(56, 189, 248, 0.45);
}

.hero-slider.is-moving .slider-status {
  background: rgba(2, 132, 199, 0.65);
  border-color: rgba(56, 189, 248, 0.6);
  color: #e0f2fe;
}

.hero-slider.is-moving .slider-stop-badge {
  display: inline-flex;
}

/* ==========================================================================
   4. TOAST DISCRET
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e2029;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 26px;
  border-radius: 24px;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.2s;
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   5. PLAN 3D INTERACTIF DES LUMIÈRES (VUE SATELLITE PURE)
   ========================================================================== */
.lights-panel-inner {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  padding: 0;
  overflow: hidden;
}

.floorplan-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.floorplan-canvas {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-card);
  background: #10151c;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.floorplan-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.floorplan-glow-layer,
.floorplan-hotspots {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.floorplan-glow-layer {
  pointer-events: none;
}

.plan-light-glow {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.5) 0%, rgba(245, 158, 11, 0.2) 44%, transparent 72%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.plan-light-glow.is-on {
  opacity: 1;
}

.plan-light-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 3;
}

.plan-light-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.plan-light-hotspot:active .plan-light-orb {
  transform: scale(0.92);
}

.plan-light-hotspot:focus-visible .plan-light-orb {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 3px;
}

.plan-light-hotspot.is-off .plan-light-orb {
  background: rgba(15, 18, 28, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.plan-light-hotspot.is-on .plan-light-orb {
  background: radial-gradient(circle at 35% 30%, #fef08a 0%, #fbbf24 55%, #d97706 100%);
  border: 2px solid #fef9c3;
  color: #291800;
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.92), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.plan-light-hotspot.is-unavailable .plan-light-orb {
  background: rgba(15, 18, 28, 0.84);
  border: 2px dashed rgba(148, 163, 184, 0.55);
  color: #94a3b8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   6. ÉCRAN DE CONNEXION PAR MOT DE PASSE (/login)
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
  background: radial-gradient(circle at top, #151828 0%, var(--bg-app) 65%);
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: linear-gradient(180deg, #161824 0%, #11121a 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-card > * + * {
  margin-top: 12px;
}

.login-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.login-form > * + * {
  margin-top: 12px;
}

.login-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  background: #0d0f17;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1.05rem;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.login-error {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
}

.login-submit {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.login-submit:active {
  transform: scale(0.98);
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}
