/* ============ Maji — styles ============ */
:root {
  --blue-900: #0B3C5D;
  --blue-700: #0E7490;
  --blue-500: #0EA5C9;
  --blue-100: #E0F4FA;
  --ink: #102A38;
  --muted: #5B7484;
  --bg: #F2F8FB;
  --card: #FFFFFF;
  --ok: #0E9F6E;
  --ok-bg: #E6F7F0;
  --warn: #D97706;
  --warn-bg: #FEF3E2;
  --cut: #DC2626;
  --cut-bg: #FDECEC;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(11, 60, 93, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 84px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* ---- bandeau données ---- */
.data-banner {
  background: var(--warn-bg);
  color: #92400E;
  font-size: .78rem;
  padding: 8px 14px;
  text-align: center;
  border-bottom: 1px solid #FBD9A5;
}

/* ---- header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700) 60%, var(--blue-500));
  color: #fff;
  border-radius: 0 0 22px 22px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-drop { width: 34px; height: 34px; color: #A5E8F7; }
.brand h1 { font-size: 1.45rem; letter-spacing: .5px; line-height: 1; }
.tagline { font-size: .74rem; opacity: .85; }
.icon-btn {
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
}
.icon-btn:active { background: rgba(255,255,255,.3); }

/* ---- vues ---- */
.view { padding: 14px 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.view-title { font-size: 1.1rem; color: var(--blue-900); }

.village-chip {
  align-self: flex-start;
  background: var(--blue-100);
  color: var(--blue-900);
  border: 1px solid #BEE7F3;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}

/* ---- carte statut ---- */
.status-card {
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.status-card.ok   { background: var(--ok-bg);   border: 1.5px solid #9FDFC6; }
.status-card.cut  { background: var(--cut-bg);  border: 1.5px solid #F3B4B4; }
.status-card.soon { background: var(--warn-bg); border: 1.5px solid #F5D08C; }
.status-emoji { font-size: 2.2rem; }
.status-title { font-size: 1.25rem; font-weight: 800; margin: 6px 0 2px; }
.status-card.ok  .status-title  { color: var(--ok); }
.status-card.cut .status-title  { color: var(--cut); }
.status-card.soon .status-title { color: var(--warn); }
.status-sub { font-size: .95rem; color: var(--ink); }
.countdown { font-size: 1.7rem; font-weight: 800; margin-top: 8px; color: var(--blue-900); font-variant-numeric: tabular-nums; }
.countdown-label { font-size: .78rem; color: var(--muted); }

/* ---- cartes ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: .98rem; color: var(--blue-900); margin-bottom: 8px; }

.cut-list { list-style: none; }
.cut-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid #EDF3F7; font-size: .9rem;
}
.cut-list li:last-child { border-bottom: none; }
.cut-when { font-weight: 700; color: var(--blue-900); }
.cut-dur { color: var(--muted); font-size: .8rem; }
.badge-exc { background: var(--warn-bg); color: var(--warn); font-size: .7rem; padding: 2px 8px; border-radius: 999px; }

.notif-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notif-card p { font-size: .78rem; margin-top: 2px; }

.meta-line { font-size: .72rem; color: var(--muted); text-align: center; }

/* ---- switch ---- */
.switch { position: relative; width: 48px; height: 27px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #C8D8E2; border-radius: 999px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; width: 21px; height: 21px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(21px); }

/* ---- planning ---- */
.day-block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; }
.day-title { font-weight: 800; color: var(--blue-900); font-size: .92rem; margin-bottom: 6px; }
.day-ok { color: var(--ok); font-size: .88rem; }
.day-cut { display: flex; gap: 8px; align-items: center; font-size: .88rem; padding: 3px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.cut { background: var(--cut); }

/* ---- points d'eau ---- */
.map { height: 300px; border-radius: var(--radius); box-shadow: var(--shadow); }
.points-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.points-list li {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.point-name { font-weight: 700; font-size: .9rem; }
.point-meta { font-size: .76rem; color: var(--muted); }
.point-go {
  background: var(--blue-100); color: var(--blue-900); text-decoration: none;
  font-size: .8rem; font-weight: 700; padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}

/* ---- formulaires ---- */
.field-label { display: block; font-size: .8rem; font-weight: 700; color: var(--blue-900); margin: 10px 0 4px; }
.input {
  width: 100%; padding: 11px 12px; border: 1.5px solid #D5E3EC; border-radius: 12px;
  font-size: .92rem; background: #fff; color: var(--ink); font-family: inherit;
}
.input:focus { outline: none; border-color: var(--blue-500); }
.input.code { font-family: Consolas, monospace; font-size: .74rem; margin-top: 10px; }

.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn {
  border: none; border-radius: 12px; padding: 12px 16px;
  font-size: .9rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:active { background: var(--blue-900); }
.btn-primary:disabled { opacity: .5; }
.btn-secondary { background: var(--blue-100); color: var(--blue-900); }
.btn-danger { background: var(--cut-bg); color: var(--cut); }
.btn-block { width: 100%; margin-top: 12px; }

/* ---- conseils ---- */
.tip-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; }
.tip-card h3 { font-size: .95rem; color: var(--blue-900); margin-bottom: 6px; }
.tip-card ul { padding-left: 18px; font-size: .86rem; line-height: 1.55; }

/* ---- onboarding ---- */
.onboarding {
  position: fixed; inset: 0; z-index: 60;
  background: linear-gradient(160deg, var(--blue-900), var(--blue-700));
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.onboarding-box {
  background: #fff; border-radius: 22px; padding: 28px 22px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.onb-drop { width: 54px; height: 54px; color: var(--blue-500); margin-bottom: 8px; }
.onboarding-box h2 { color: var(--blue-900); margin-bottom: 8px; }
.onboarding-box p { font-size: .88rem; color: var(--muted); margin-bottom: 16px; }

/* ---- navigation ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 50;
  display: flex; background: #fff;
  border-top: 1px solid #E2ECF2;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(11,60,93,.08);
}
.nav-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  padding: 9px 2px 8px; font-size: .66rem; font-weight: 700; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: inherit;
}
.nav-ico { font-size: 1.25rem; }
.nav-btn.active { color: var(--blue-700); }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%);
  background: var(--blue-900); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: .85rem; z-index: 70;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); white-space: nowrap;
}

/* ---- géolocalisation signalement ---- */
.geo-chip {
  border-radius: 12px; padding: 10px 12px; font-size: .84rem; font-weight: 700;
  margin-bottom: 10px;
}
.geo-chip.ok      { background: var(--ok-bg);   color: var(--ok); }
.geo-chip.pending { background: var(--blue-100); color: var(--blue-900); }
.geo-chip.denied  { background: var(--warn-bg); color: var(--warn); }
.geo-help {
  background: var(--warn-bg); border: 1px solid #F5D08C; border-radius: 12px;
  padding: 12px; font-size: .82rem; margin-bottom: 10px;
}
.geo-help ul { padding-left: 18px; margin: 8px 0; }
.geo-help li { margin-bottom: 6px; }
.geo-help .btn { margin-top: 4px; }
/* ---- coupure imminente (1 h → 30 min) ---- */
.status-card.urgent { background: var(--cut-bg); border-color: #F3B4B4; animation: rano-pulse 1.2s ease-in-out infinite; }
.status-card.urgent .status-title { color: var(--cut); }
.status-card.urgent .countdown { color: var(--cut); }
@keyframes rano-pulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(220, 38, 38, .15); }
  50%      { box-shadow: 0 2px 22px rgba(220, 38, 38, .45); }
}
.cut-progress {
  height: 8px; border-radius: 999px; background: rgba(0,0,0,.08);
  margin-top: 12px; overflow: hidden;
}
.cut-progress div {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--warn), var(--cut));
  transition: width 1s linear;
}
/* ---- sources & fil communautaire ---- */
.src-badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; margin: 10px 0 4px;
}
.src-badge.official  { background: var(--blue-100); color: var(--blue-900); }
.src-badge.community { background: var(--warn-bg); color: #92400E; }
.src-badge a { color: inherit; }

.check-line { display: flex; align-items: center; gap: 8px; font-size: .86rem; margin: 12px 0 4px; font-weight: 600; color: var(--blue-900); }
.check-line input { width: 18px; height: 18px; }

.post-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px;
}
.post-head { display: flex; justify-content: space-between; align-items: center; }
.post-type { font-weight: 800; color: var(--blue-900); font-size: .9rem; }
.post-time { font-size: .72rem; color: var(--muted); }
.post-place { font-size: .78rem; color: var(--muted); margin: 2px 0 6px; }
.post-content { font-size: .92rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.post-actions { display: flex; gap: 8px; margin-top: 10px; }
.post-act {
  background: var(--blue-100); color: var(--blue-900); border: none; border-radius: 999px;
  padding: 7px 14px; font-size: .82rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.post-act:disabled { opacity: .55; }
.comments { border-top: 1px solid #EDF3F7; margin-top: 10px; padding-top: 8px; }
.comment { font-size: .84rem; padding: 6px 0; border-bottom: 1px dashed #EDF3F7; word-break: break-word; }
.comment-compose { display: flex; gap: 8px; margin-top: 8px; }
.comment-compose .input { flex: 1; }

/* 6 onglets : libellés compacts */
.nav-btn { font-size: .6rem; }
/* ---- logo ---- */
.brand-logo { width: 40px; height: 40px; border-radius: 12px; }
.onb-logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 10px; }
/* ---- premium / paywall ---- */
.header-actions { display: flex; gap: 8px; }
.icon-btn.star { background: rgba(255, 200, 60, .25); }
.lock-ico { font-size: .72rem; }
.tier-badge {
  display: inline-block; font-size: .7rem; font-weight: 800; padding: 3px 10px;
  border-radius: 999px; background: var(--blue-100); color: var(--blue-900); vertical-align: middle;
}
.tier-badge.premium { background: linear-gradient(90deg, #FDE68A, #FBBF24); color: #78350F; }
.tier-badge.pro { background: linear-gradient(90deg, #C7D2FE, #818CF8); color: #1E1B4B; }

.period-toggle { display: flex; gap: 8px; justify-content: center; }
.period-btn {
  border: 1.5px solid #D5E3EC; background: #fff; color: var(--muted);
  border-radius: 999px; padding: 9px 20px; font-weight: 700; font-size: .88rem; cursor: pointer; font-family: inherit;
}
.period-btn.active { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.save-badge { background: var(--ok-bg); color: var(--ok); font-size: .68rem; padding: 2px 7px; border-radius: 999px; }
.period-btn.active .save-badge { background: rgba(255,255,255,.25); color: #fff; }

.plan-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; border: 1.5px solid transparent;
}
.plan-card.featured { border-color: var(--blue-500); position: relative; }
.plan-card.featured::before {
  content: "Le plus choisi"; position: absolute; top: -10px; right: 14px;
  background: var(--blue-700); color: #fff; font-size: .66rem; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
}
.plan-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.plan-head h3 { color: var(--blue-900); }
.plan-price { font-size: 1.3rem; font-weight: 800; color: var(--blue-900); }
.plan-price span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.plan-features { list-style: none; font-size: .86rem; line-height: 1.9; margin-bottom: 10px; }

.villages-list { list-style: none; margin-bottom: 8px; }
.villages-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #EDF3F7; font-size: .9rem;
}
.v-remove { background: none; border: none; color: var(--cut); font-size: 1rem; cursor: pointer; }

.village-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.village-switch .village-chip.inactive { background: #fff; border-color: #E2ECF2; color: var(--muted); font-weight: 600; }

.alert-delays { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.delay-chip {
  border: 1.5px solid #D5E3EC; background: #fff; color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: .78rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.delay-chip.on { background: var(--blue-100); border-color: var(--blue-500); color: var(--blue-900); }

.legal { margin-top: 10px; }
.legal summary { font-size: .84rem; font-weight: 700; color: var(--blue-900); cursor: pointer; padding: 4px 0; }
.legal p { margin-top: 6px; line-height: 1.6; }

/* ---- finitions pro ---- */
.btn, .post-act, .nav-btn, .period-btn, .delay-chip { transition: transform .08s ease, background .15s ease, box-shadow .15s ease; }
.btn:active, .post-act:active { transform: scale(.97); }
:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; border-radius: 4px; }
.card, .post-card, .plan-card, .day-block { transition: box-shadow .2s ease; }
/* ---- détection GPS du village ---- */
.detect-result { display: flex; flex-direction: column; gap: 6px; }
.detect-hit {
  text-align: left; background: var(--blue-100); border: 1.5px solid #BEE7F3;
  color: var(--blue-900); border-radius: 12px; padding: 10px 12px;
  font-size: .86rem; cursor: pointer; font-family: inherit;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.detect-hit.best { border-color: var(--blue-700); background: #D5F0F9; }
.detect-dist { font-size: .72rem; color: var(--muted); white-space: nowrap; }
/* ---- vitrine S.B GROUPE ---- */
.partners { margin-top: 4px; }
.partners-title { font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; text-align: center; }
.partners-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.partner-card {
  flex: 0 0 240px; display: flex; gap: 10px; align-items: center;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px; font-size: .78rem; line-height: 1.35;
  text-decoration: none; color: var(--ink);
}
.partner-mono {
  flex: 0 0 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; letter-spacing: .5px;
}
.partner-go { color: var(--blue-700); font-weight: 700; white-space: nowrap; }
/* ---- modération ---- */
.post-hidden { opacity: .75; border: 1.5px dashed var(--cut); }
.post-act.mod { background: var(--cut-bg); color: var(--cut); }
.c-act { background: none; border: none; cursor: pointer; font-size: .8rem; padding: 0 3px; }
/* ---- boutons offres payantes (tête d'accueil) ---- */
.home-cta { display: flex; gap: 10px; }
.cta-btn {
  flex: 1; border: none; border-radius: 14px; padding: 12px 12px;
  font-family: inherit; font-weight: 800; font-size: .95rem; color: #fff;
  cursor: pointer; text-align: left; box-shadow: var(--shadow);
}
.cta-btn span { display: block; font-weight: 600; font-size: .68rem; opacity: .92; margin-top: 3px; line-height: 1.35; }
.cta-premium { background: linear-gradient(135deg, #B45309, #F59E0B); }
.cta-pro { background: linear-gradient(135deg, #312E81, #6366F1); }
.cta-active { background: linear-gradient(135deg, var(--ok), #34D399); }
.cta-btn:active { transform: scale(.98); }