/* Home (bot_home) — v2 « classe / épuré / simple »
   Police : Satoshi (Fontshare). Pictos : Lucide (SVG inline, trait 1.8).
   Fond blanc cassé, cartes blanches, turquoise en accent unique. */
* { box-sizing: border-box; margin: 0; }

/* Palette affinée d'après le panel bot_style :
   - encre bleutée (astuce Stripe #0A2540) au lieu du noir pur → premium
   - turquoise profond (esprit N26 / Perplexity) pour les accents texte
   - fond crème bleuté, turquoise vif réservé aux actions */
:root {
  --bg: #f6f9f9;
  --surface: #ffffff;
  --ink: #0b2830;
  --muted: #72858d;
  --line: #e9efef;
  --accent: #00b8c4;
  --accent-deep: #0f7f8a;
  --accent-dark: #0f7f8a;
  --tint: #e4f6f7;
  --soft: #f1f5f5;
  --ok: #2bb673;
  --danger: #e35d5d;
  --danger-tint: #fdeeee;
  --radius: 22px;
  --shadow:
    0 1px 1px rgba(11, 40, 48, .03),
    0 3px 8px rgba(11, 40, 48, .04),
    0 14px 36px rgba(11, 40, 48, .06);
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Satoshi', -apple-system, system-ui, sans-serif;
  font-size: 15px;
  min-height: 100vh;
  padding: calc(env(safe-area-inset-top) + 10px) 0 calc(env(safe-area-inset-bottom) + 32px);
  max-width: 1100px;
  margin: 0 auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }

/* ---------- entête ---------- */
header { display: flex; align-items: center; gap: 14px; padding: 18px 22px 8px; }
.logo {
  width: 46px; height: 46px; border-radius: 16px;
  background: linear-gradient(150deg, #16cdd8, #009fab);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 900; font-size: 1.05rem; letter-spacing: .01em;
  box-shadow: 0 2px 4px rgba(0, 159, 171, .25), 0 8px 20px rgba(0, 159, 171, .3);
}
.h-titles { flex: 1; }
h1 { font-size: 1.75rem; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.h-sub {
  color: var(--muted); font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
h2 {
  font-size: 1.05rem; font-weight: 900; letter-spacing: -.01em;
  padding: 30px 22px 14px; color: var(--ink);
}

.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.on  { background: var(--ok); }
.dot.off { background: var(--danger); }

/* ---------- températures ---------- */
.temps { display: flex; gap: 10px; padding: 14px 22px 2px; }
.temp-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px 8px 10px;
  font-weight: 700; font-size: .88rem;
}
.temp-pill svg { color: var(--accent-dark); }
.temp-pill .t-label { color: var(--muted); font-weight: 500; }

/* ---------- carrousel ---------- */
.carousel {
  display: flex; gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 18px 22px 6px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.module {
  flex: 0 0 86%;
  scroll-snap-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-height: 290px;
  display: flex; flex-direction: column;
}
.m-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.m-chip {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--tint); color: var(--accent-dark);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.m-title { font-weight: 900; font-size: 1.02rem; letter-spacing: -.01em; flex: 1; }
.m-state { color: var(--muted); font-weight: 700; font-size: .8rem; }
.m-state.active { color: var(--accent-dark); }
.m-state.alert { color: var(--danger); }

/* aperçu caméra / zone d'état */
.cam-view {
  flex: 1; border-radius: 15px;
  background: var(--soft);
  color: var(--muted);
  display: grid; place-items: center; text-align: center;
  font-size: .85rem; font-weight: 600; padding: 18px;
  min-height: 150px;
}
.cam-view svg { margin: 0 auto 10px; opacity: .55; }

/* boutons pilule */
.btn {
  border: none; cursor: pointer; font: inherit;
  border-radius: 999px; padding: 15px 26px;
  font-weight: 800; font-size: .98rem; letter-spacing: -.01em;
  background: linear-gradient(180deg, #0cc3cf, #00a9b6);
  color: #fff;
  transition: transform .06s, filter .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  margin-top: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 2px 4px rgba(0, 169, 182, .25),
    0 8px 20px rgba(0, 169, 182, .3);
}
.btn:active { transform: scale(.97); filter: brightness(.96); }
.btn.secondary { background: var(--soft); color: var(--ink); box-shadow: none; }
.btn.armed {
  background: linear-gradient(180deg, #e96c6c, #d94f4f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 4px rgba(217, 79, 79, .25), 0 8px 20px rgba(217, 79, 79, .28);
}
.btn[disabled] { background: var(--soft); color: #b3bdbe; cursor: default; box-shadow: none; }

/* lignes à interrupteur */
.row { display: flex; align-items: center; gap: 13px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.row:last-of-type { border-bottom: none; }
.r-icon {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--soft); color: var(--muted);
  display: grid; place-items: center;
}
.row.on .r-icon { background: var(--tint); color: var(--accent-dark); }
.r-name { flex: 1; font-weight: 700; }

.switch {
  width: 50px; height: 30px; border-radius: 999px;
  background: #dde4e4; border: none; cursor: pointer; position: relative;
  transition: background .2s; flex-shrink: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: left .2s;
}
.switch.on { background: linear-gradient(180deg, #0cc3cf, #00a9b6); }
.switch.on::after { left: 23px; }

/* points de pagination */
.dots { display: flex; justify-content: center; gap: 7px; padding: 16px 0 0; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: #dbe2e2; transition: all .2s; }
.dots span.active { background: var(--accent); width: 18px; border-radius: 4px; }

/* ---------- actions rapides ---------- */
.quick { display: flex; gap: 20px; padding: 4px 22px; flex-wrap: wrap; }
.quick button {
  border: none; background: none; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  color: var(--muted); font-weight: 700; font-size: .78rem;
  -webkit-tap-highlight-color: transparent;
}
.q-circle {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink);
  display: grid; place-items: center;
  transition: all .15s;
  box-shadow: var(--shadow);
}
.quick button:active .q-circle { transform: scale(.93); }
.quick button.on { color: var(--accent-dark); }
.quick button.on .q-circle {
  background: linear-gradient(150deg, #16cdd8, #009fab);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 4px rgba(0, 159, 171, .25), 0 8px 20px rgba(0, 159, 171, .3);
}

/* carte de login posée sur le fond, comme une carte du dashboard */
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 40px 28px 32px;
}

/* ---------- page login ---------- */
.login-wrap {
  min-height: 88vh; display: grid; place-items: center; padding: 24px;
}
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .logo { width: 64px; height: 64px; border-radius: 21px; margin: 0 auto 18px; font-size: 1.4rem; }
.login-card h1 { margin-bottom: 4px; }
.login-card .h-sub { margin-bottom: 30px; }
.login-card input {
  width: 100%; font: inherit; font-weight: 700; text-align: center;
  padding: 16px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--surface);
  outline: none; transition: border-color .15s;
}
.login-card input:focus { border-color: var(--accent); }
.login-card .btn { width: 100%; margin-top: 14px; }
.login-err { color: var(--danger); font-weight: 700; font-size: .85rem; margin-top: 14px; min-height: 1.2em; }

/* ---------- desktop ---------- */
@media (min-width: 920px) {
  .carousel { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; }
  .module { flex: 1 1 calc(33% - 14px); min-width: 300px; }
  .dots { display: none; }
}
