/* ============================================================
   VigiRoute Sérénité — Système de styles
   ============================================================ */

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

:root {
  --navy:     #1A3C4E;
  --navy-dk:  #0F2634;
  --navy-dp:  #0A1F2B;
  --teal:     #028090;
  --teal-dk:  #01606E;
  --teal-lt:  #E4F3F4;
  --mint:     #02C39A;
  --mint-dk:  #01A07E;
  --mint-lt:  #E4F8F2;
  --offwhite: #F2F7F8;
  --white:    #FFFFFF;
  --gray:     #5A6B76;
  --gray-lt:  #8D9BA5;
  --line:     #D8E3E6;
  --text:     #1E3440;

  --danger:   #C0392B;
  --danger-lt:#FDECEA;
  --warn:     #B7791F;
  --warn-lt:  #FDF6E3;
  --ok:       #1E7A5A;
  --ok-lt:    #E6F5EF;

  --radius:   14px;
  --radius-sm:10px;
  --radius-lg:20px;
  --shadow:   0 2px 10px rgba(15, 38, 52, .07);
  --shadow-lg:0 12px 40px rgba(15, 38, 52, .16);

  --safe-top:  env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; font-weight: 700; color: var(--navy); }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Accessibilité ---------- */
.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;
}
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px;
  border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 700;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  text-align: center; white-space: nowrap;
  min-height: 52px;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-primary { background: var(--mint); color: var(--navy); }
.btn-primary:hover { background: var(--mint-dk); transform: translateY(-2px); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--navy-dk); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--line); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost-light { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.4); }
.btn-ghost-light:hover { border-color: var(--mint); }
.btn-danger { background: var(--danger-lt); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: .9rem; min-height: 40px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ============================================================
   EN-TÊTE PUBLIC
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(15, 38, 52, .97);
  padding-top: var(--safe-top);
  backdrop-filter: blur(10px);
}
.site-header .hdr-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; background: var(--mint);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-family: var(--serif); font-size: 1.06rem; font-weight: 700; color: var(--white); line-height: 1.15; }
.brand-name span { color: var(--mint); }
.hdr-links { display: none; gap: 26px; list-style: none; }
.hdr-links a { color: rgba(255,255,255,.7); font-size: .92rem; font-weight: 500; }
.hdr-links a:hover { color: var(--mint); }
.hdr-actions { display: flex; align-items: center; gap: 10px; }
.lang-select {
  background: rgba(255,255,255,.1); color: var(--white);
  border: 1px solid rgba(255,255,255,.22); border-radius: 8px;
  padding: 8px 9px; font-size: .84rem; cursor: pointer;
}
.lang-select option { color: var(--text); }

@media (min-width: 900px) {
  .hdr-links { display: flex; }
}

/* ============================================================
   ACCUEIL PUBLIC
   ============================================================ */
.hero {
  background: linear-gradient(150deg, var(--navy-dk) 0%, var(--teal-dk) 62%, #014D5A 100%);
  color: var(--white); padding: 56px 0 72px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 78% 22%, rgba(2,195,154,.16), transparent 58%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(2,195,154,.14); border: 1px solid rgba(2,195,154,.42);
  color: var(--mint); font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  padding: 7px 15px; border-radius: 30px; text-transform: uppercase; margin-bottom: 22px;
}
.hero h1 { color: var(--white); margin-bottom: 18px; max-width: 620px; }
.hero h1 em { font-style: normal; color: var(--mint); }
.hero-lead {
  font-size: clamp(1rem, 2.1vw, 1.18rem); color: rgba(255,255,255,.76);
  max-width: 540px; margin-bottom: 30px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Cadre téléphone */
.phone-frame {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  border-radius: 26px; padding: 16px; box-shadow: var(--shadow-lg);
}
.phone-screen {
  background: var(--white); border-radius: 16px; overflow: hidden;
}
.phone-bar {
  background: var(--navy); color: var(--white); padding: 11px 15px;
  display: flex; align-items: center; justify-content: space-between;
}
.phone-bar strong { font-size: .86rem; font-family: var(--serif); }
.phone-bar .live {
  display: inline-flex; align-items: center; gap: 6px; font-size: .72rem;
  color: var(--mint); font-weight: 700;
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .28; } }
.phone-map {
  height: 168px; position: relative;
  background: linear-gradient(160deg, #E7F1F3, #D6E7EA);
  overflow: hidden;
}
.phone-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
}
.map-pin i {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
}
.map-pin i svg { width: 13px; height: 13px; transform: rotate(45deg); position: static; }
.map-pin.hi i { background: var(--danger); }
.map-pin.md i { background: var(--warn); }
.map-pin.lo i { background: var(--teal); }
.map-self {
  position: absolute; left: 50%; top: 62%; transform: translate(-50%,-50%);
  width: 15px; height: 15px; border-radius: 50%; background: #1B7BFF;
  border: 3px solid var(--white); box-shadow: 0 0 0 5px rgba(27,123,255,.22);
}
.phone-alert {
  margin: 11px; padding: 12px 14px; background: var(--navy); color: var(--white);
  border-radius: 11px; display: flex; gap: 11px; align-items: center;
}
.phone-alert svg { width: 21px; height: 21px; color: var(--mint); flex-shrink: 0; }
.phone-alert p { font-size: .84rem; line-height: 1.4; }
.phone-row { display: flex; gap: 9px; padding: 0 11px 13px; }
.phone-row div {
  flex: 1; background: var(--offwhite); border-radius: 9px; padding: 9px 11px;
  font-size: .72rem; color: var(--gray);
}
.phone-row div b { display: block; font-size: 1.02rem; color: var(--navy); font-family: var(--serif); }

/* Sections */
.sec { padding: 62px 0; }
.sec-alt { background: var(--offwhite); }
.sec-dark { background: var(--navy); color: rgba(255,255,255,.78); }
.sec-dark h2, .sec-dark h3 { color: var(--white); }
.sec-head { max-width: 660px; margin-bottom: 38px; }
.eyebrow {
  font-size: .76rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 10px;
}
.sec-dark .eyebrow { color: var(--mint); }
.sec-head p { color: var(--gray); font-size: 1.04rem; margin-top: 12px; }
.sec-dark .sec-head p { color: rgba(255,255,255,.62); }

.grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.card-flat { background: var(--offwhite); border: none; }
.sec-dark .card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.sec-dark .card p { color: rgba(255,255,255,.62); }

.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 22px 20px;
  border-top: 4px solid var(--teal); box-shadow: var(--shadow); text-align: center;
}
.stat-card .num { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; color: var(--teal); line-height: 1; }
.stat-card .lbl { font-size: .9rem; color: var(--gray); margin-top: 8px; }
.stat-card .src { font-size: .72rem; color: var(--gray-lt); font-style: italic; margin-top: 5px; }

.feat { display: flex; gap: 16px; align-items: flex-start; }
.feat-ico {
  width: 50px; height: 50px; border-radius: 13px; background: var(--teal-lt);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.feat-ico svg { width: 24px; height: 24px; color: var(--teal); }
.sec-dark .feat-ico { background: rgba(2,195,154,.16); }
.sec-dark .feat-ico svg { color: var(--mint); }
.feat h3 { margin-bottom: 6px; }
.feat p { font-size: .93rem; }
.tag {
  display: inline-block; margin-top: 10px; background: var(--teal-lt); color: var(--teal);
  font-size: .7rem; font-weight: 800; letter-spacing: .05em; padding: 4px 10px; border-radius: 20px;
}
.sec-dark .tag { background: rgba(2,195,154,.18); color: var(--mint); }
.sec-dark .card-featured { background: var(--mint); border-color: var(--mint); }
.sec-dark .card-featured h3, .sec-dark .card-featured .price { color: var(--navy); }
.sec-dark .card-featured p, .sec-dark .card-featured li { color: rgba(15,38,52,.82) !important; }
.sec-dark .card-featured .price small { color: rgba(15,38,52,.65); }

.steps-list { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 820px) { .steps-list { grid-template-columns: repeat(4, 1fr); } }
.step-item { text-align: center; }
.step-num {
  width: 62px; height: 62px; border-radius: 50%; background: var(--mint); color: var(--navy);
  font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.step-item h3 { font-size: 1rem; margin-bottom: 6px; }
.step-item p { font-size: .9rem; color: rgba(255,255,255,.6); }

/* Tarif */
.price-tag { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; color: var(--navy); line-height: 1; }
.price-tag small { font-size: .95rem; color: var(--gray); font-family: var(--font); font-weight: 500; }
.plan-list { list-style: none; margin: 20px 0 24px; display: flex; flex-direction: column; gap: 11px; }
.plan-list li { display: flex; gap: 11px; align-items: flex-start; font-size: .94rem; color: var(--gray); }
.plan-list li svg { width: 19px; height: 19px; color: var(--mint); flex-shrink: 0; margin-top: 2px; }
.sec-dark .plan-list li svg { color: var(--mint); }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .9rem; font-weight: 700; color: var(--navy); margin-bottom: 7px; }
.field .hint { font-size: .8rem; color: var(--gray-lt); margin-top: 5px; font-weight: 400; }
.input, .select, .textarea {
  width: 100%; padding: 14px 15px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text); font-size: 1rem;
  transition: border-color .16s ease, box-shadow .16s ease;
  min-height: 52px;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(2,128,144,.1);
}
.input::placeholder, .textarea::placeholder { color: var(--gray-lt); }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; gap: 0 16px; } }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: none; }
.switch-row .sw-txt strong { display: block; font-size: .96rem; color: var(--navy); }
.switch-row .sw-txt span { font-size: .85rem; color: var(--gray); }
.switch {
  position: relative; width: 58px; height: 32px; border-radius: 20px; background: var(--line);
  flex-shrink: 0; transition: background .2s ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s ease;
}
.switch.on { background: var(--mint); }
.switch.on::after { transform: translateX(26px); }

/* ============================================================
   STRUCTURE APPLICATION
   ============================================================ */
.app-top {
  position: sticky; top: 0; z-index: 60;
  background: var(--navy); padding-top: var(--safe-top);
  box-shadow: 0 2px 12px rgba(15,38,52,.16);
}
.app-top .top-inner {
  max-width: 940px; margin: 0 auto; padding: 0 16px;
  min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.app-top .brand-mark { width: 34px; height: 34px; }
.app-top .brand-mark svg { width: 19px; height: 19px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1); color: var(--white); transition: background .18s ease;
}
.icon-btn:hover { background: rgba(255,255,255,.2); }
.icon-btn svg { width: 21px; height: 21px; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px;
  font-size: .76rem; font-weight: 800; letter-spacing: .03em;
}
.badge-premium { background: rgba(2,195,154,.18); color: var(--mint); }
.badge-free { background: rgba(255,255,255,.12); color: rgba(255,255,255,.72); }

.app-main {
  max-width: 940px; margin: 0 auto; padding: 22px 16px 0;
}
.app-view { padding-bottom: 108px; }
.view-head { margin-bottom: 22px; }
.view-head h2 { margin-bottom: 6px; }
.view-head p { color: var(--gray); font-size: .96rem; }

.greeting { margin-bottom: 22px; }
.greeting h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
.greeting p { color: var(--gray); font-size: 1rem; margin-top: 4px; }

/* Barre de navigation basse */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: var(--white); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 16px rgba(15,38,52,.08);
}
.tabbar-inner {
  max-width: 940px; margin: 0 auto; display: flex; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabbar-inner::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; min-width: 74px; padding: 10px 8px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--gray-lt); font-size: .7rem; font-weight: 700;
  transition: color .16s ease; border-top: 3px solid transparent;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--teal); border-top-color: var(--mint); }
.tab:hover { color: var(--teal); }

/* ============================================================
   COMPOSANTS APPLICATION
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
@media (min-width: 720px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.kpi {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: relative; overflow: hidden;
}
.kpi .k-lbl { font-size: .78rem; color: var(--gray); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi .k-val {
  font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--navy);
  line-height: 1.1; margin: 6px 0 3px;
}
.kpi .k-sub { font-size: .8rem; color: var(--gray-lt); }
.kpi.accent { border-top: 4px solid var(--mint); }
.kpi.accent .k-val { color: var(--teal); }

.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.panel-head h3 { font-size: 1.05rem; }
.panel-head .sub { font-size: .84rem; color: var(--gray); font-weight: 400; font-family: var(--font); }

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 16px; display: flex; gap: 14px; align-items: flex-start;
}
.item-main { flex: 1; min-width: 0; }
.item-main .t { font-weight: 700; color: var(--navy); font-size: .98rem; }
.item-main .s { font-size: .85rem; color: var(--gray); margin-top: 3px; }
.item-side { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item-ico {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--teal-lt); flex-shrink: 0;
}
.item-ico svg { width: 21px; height: 21px; color: var(--teal); }
.item-ico.warn { background: var(--warn-lt); }
.item-ico.warn svg { color: var(--warn); }
.item-ico.danger { background: var(--danger-lt); }
.item-ico.danger svg { color: var(--danger); }
.item-ico.ok { background: var(--ok-lt); }
.item-ico.ok svg { color: var(--ok); }

.badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: .74rem; font-weight: 800; letter-spacing: .03em; }
.badge-ok { background: var(--ok-lt); color: var(--ok); }
.badge-warn { background: var(--warn-lt); color: var(--warn); }
.badge-danger { background: var(--danger-lt); color: var(--danger); }
.badge-neutral { background: var(--offwhite); color: var(--gray); }
.badge-teal { background: var(--teal-lt); color: var(--teal); }

.empty {
  text-align: center; padding: 42px 20px; color: var(--gray);
  background: var(--white); border: 2px dashed var(--line); border-radius: var(--radius);
}
.empty svg { width: 44px; height: 44px; color: var(--gray-lt); margin: 0 auto 14px; }
.empty p { font-size: .95rem; }
.empty .empty-cta { margin-top: 16px; }

.notice {
  display: flex; gap: 12px; padding: 15px 17px; border-radius: var(--radius-sm);
  font-size: .92rem; align-items: flex-start; margin-bottom: 16px; line-height: 1.5;
}
.notice svg { width: 21px; height: 21px; flex-shrink: 0; margin-top: 1px; }
.notice-info { background: var(--teal-lt); color: var(--navy); }
.notice-info svg { color: var(--teal); }
.notice-warn { background: var(--warn-lt); color: #6B4A0D; }
.notice-warn svg { color: var(--warn); }
.notice-danger { background: var(--danger-lt); color: #7E2A20; }
.notice-danger svg { color: var(--danger); }
.notice-ok { background: var(--ok-lt); color: #14553E; }
.notice-ok svg { color: var(--ok); }

/* Bouton SOS */
.sos-block { text-align: center; padding: 26px 18px; }
.sos-btn {
  width: 168px; height: 168px; border-radius: 50%; margin: 0 auto 18px;
  background: linear-gradient(160deg, #E74C3C, #C0392B); color: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 10px 30px rgba(192,57,43,.35); transition: transform .16s ease, box-shadow .16s ease;
}
.sos-btn:hover { transform: scale(1.03); box-shadow: 0 14px 38px rgba(192,57,43,.45); }
.sos-btn:active { transform: scale(.97); }
.sos-btn svg { width: 46px; height: 46px; }
.sos-btn b { font-size: .86rem; letter-spacing: .1em; }
.sos-block h3 { margin-bottom: 6px; }
.sos-block > p { color: var(--gray); font-size: .93rem; max-width: 380px; margin: 0 auto; }

/* Carte */
.map-box {
  position: relative; height: 300px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #E7F1F3, #D6E7EA); border: 1px solid var(--line);
}
.map-box svg.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-box .map-pin { z-index: 3; }
.map-box .map-self { z-index: 4; }
.map-legend {
  position: absolute; bottom: 12px; left: 12px; z-index: 5;
  background: rgba(255,255,255,.94); border-radius: var(--radius-sm); padding: 10px 13px;
  display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: var(--gray);
  box-shadow: var(--shadow);
}
.map-legend span { display: flex; align-items: center; gap: 8px; }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; display: block; }

/* Jauge */
.gauge { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gauge-ring { position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.gauge-ring svg { transform: rotate(-90deg); width: 116px; height: 116px; }
.gauge-ring .g-val {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gauge-ring .g-val b { font-family: var(--serif); font-size: 1.9rem; color: var(--navy); line-height: 1; }
.gauge-ring .g-val span { font-size: .7rem; color: var(--gray); text-transform: uppercase; letter-spacing: .06em; }
.gauge-info { flex: 1; min-width: 180px; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; justify-content: flex-end; height: 100%; }
.bar-fill {
  width: 100%; max-width: 42px; border-radius: 6px 6px 0 0; background: var(--teal);
  min-height: 4px; transition: height .5s ease;
}
.bar-col.is-max .bar-fill { background: var(--mint); }
.bar-col span { font-size: .72rem; color: var(--gray); }

.danger-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.danger-row:last-child { border-bottom: none; }
.danger-row .dr-ico {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.danger-row .dr-ico svg { width: 19px; height: 19px; }
.danger-row .dr-txt { flex: 1; min-width: 0; }
.danger-row .dr-txt b { display: block; font-size: .93rem; color: var(--navy); font-weight: 700; }
.danger-row .dr-txt span { font-size: .82rem; color: var(--gray); }
.danger-row .dr-dist { font-size: .85rem; font-weight: 700; color: var(--teal); flex-shrink: 0; }

/* Langues */
.lang-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .lang-grid { grid-template-columns: repeat(3, 1fr); } }
.lang-opt {
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 15px;
  text-align: center; background: var(--white); transition: border-color .16s ease, background .16s ease;
}
.lang-opt strong { display: block; font-size: 1rem; color: var(--navy); }
.lang-opt span { font-size: .82rem; color: var(--gray); }
.lang-opt.active { border-color: var(--mint); background: var(--mint-lt); }

/* Notifications */
.toast-zone {
  position: fixed; top: calc(var(--safe-top) + 12px); left: 12px; right: 12px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--navy); color: var(--white); border-radius: var(--radius-sm);
  padding: 14px 17px; font-size: .92rem; box-shadow: var(--shadow-lg);
  display: flex; gap: 11px; align-items: flex-start; max-width: 480px; margin: 0 auto; width: 100%;
  animation: slideDown .28s ease;
}
.toast svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--mint); }
.toast.err svg { color: #FF8A7A; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* Modale */
.modal-zone {
  position: fixed; inset: 0; z-index: 250; background: rgba(10,31,43,.6);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 640px) { .modal-zone { align-items: center; padding: 24px; } }
.modal-card {
  background: var(--white); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  animation: slideUp .26s ease;
}
@media (min-width: 640px) { .modal-card { border-radius: var(--radius-lg); } }
@keyframes slideUp { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal-head h3 { font-size: 1.2rem; }
.modal-head p { font-size: .88rem; color: var(--gray); margin-top: 4px; }
.modal-close {
  width: 38px; height: 38px; border-radius: 10px; background: var(--offwhite); color: var(--gray);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-close svg { width: 19px; height: 19px; }

/* Détails paiement */
.pay-method {
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 16px;
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px;
  transition: border-color .16s ease, background .16s ease;
}
.pay-method.active { border-color: var(--mint); background: var(--mint-lt); }
.pay-method.off { opacity: .6; }
.pay-method .pm-ico {
  width: 46px; height: 46px; border-radius: 12px; background: var(--navy); color: var(--mint);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pay-method .pm-ico svg { width: 23px; height: 23px; }
.pay-method .pm-txt { flex: 1; min-width: 0; }
.pay-method .pm-txt strong { display: block; font-size: .99rem; color: var(--navy); }
.pay-method .pm-txt .num { font-family: monospace; font-size: .95rem; color: var(--teal); font-weight: 700; }
.pay-method .pm-txt p { font-size: .84rem; color: var(--gray); margin-top: 3px; }

.steps-mini { list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.steps-mini li { display: flex; gap: 12px; font-size: .91rem; color: var(--gray); counter-increment: s; }
.steps-mini li::before {
  content: counter(s); width: 25px; height: 25px; border-radius: 50%; background: var(--teal);
  color: var(--white); font-size: .78rem; font-weight: 800; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}

.ref-box {
  background: var(--offwhite); border: 2px dashed var(--line); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; margin-bottom: 16px;
}
.ref-box .ref-lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gray); font-weight: 700; }
.ref-box .ref-val { font-family: monospace; font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-top: 5px; word-break: break-all; }

/* Tableau générique (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 620px; }
table.data th {
  background: var(--navy); color: var(--white); text-align: left; padding: 12px 14px;
  font-size: .79rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--gray); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--offwhite); }
table.data td b { color: var(--navy); }

/* Bannière domaine */
.domaine-banner {
  background: var(--teal-lt); border: 1px solid rgba(2,128,144,.28); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px;
}
.domaine-banner .db-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.domaine-banner .db-top svg { width: 21px; height: 21px; color: var(--teal); }
.domaine-banner .db-top strong { font-size: .93rem; color: var(--navy); }
.domaine-banner p { font-size: .87rem; color: var(--gray); margin-bottom: 14px; }

/* Pied de page */
.site-footer {
  background: var(--navy-dp); color: rgba(255,255,255,.5); padding: 40px 0 108px;
}
.site-footer .f-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 740px) { .site-footer .f-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { color: var(--white); font-size: .95rem; margin-bottom: 14px; font-family: var(--font); }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.site-footer a { color: rgba(255,255,255,.55); font-size: .89rem; }
.site-footer a:hover { color: var(--mint); }
.site-footer .f-bottom {
  margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1);
  font-size: .82rem;
}

/* ============================================================
   AJUSTEMENTS POUR PETITS ECRANS
   Les barres du haut portent le logo, plusieurs commandes et des
   libelles : on reduit progressivement pour qu aucun element ne
   deborde sur un ecran de 360 a 430 px.
   ============================================================ */
.site-header .hdr-inner { gap: 10px; }
.brand { min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 520px) {
  .site-header .hdr-inner,
  .app-top .top-inner,
  .admin-top .top-inner { padding: 0 12px; gap: 8px; }
  .site-header .hdr-actions .btn-sm { padding: 9px 13px; font-size: .84rem; }
  .brand-name { font-size: 1rem; }
  .top-actions, .hdr-actions { gap: 6px; }
}

@media (max-width: 430px) {
  .brand-mark { width: 32px; height: 32px; }
  .app-top .brand-mark,
  .admin-top .brand-mark { width: 30px; height: 30px; }
  .app-top .brand-name,
  .admin-top .brand-name { font-size: .92rem; }
  #planBadge { display: none; }
  .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
  .icon-btn svg { width: 19px; height: 19px; }
  .lang-select { padding: 7px 7px; font-size: .78rem; }
  .admin-tag { display: none; }
  .tab { min-width: 68px; font-size: .66rem; }
  .tab svg { width: 20px; height: 20px; }
  .admin-tabbar .tab { min-width: 70px; font-size: .66rem; }
}

@media (max-width: 350px) {
  .site-header .hdr-actions .btn-sm { display: none; }
  .app-top .brand-name { display: none; }
}
/* Animation d'apparition */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot-live { animation: none; }
}

/* Impression */
@media print {
  .tabbar, .app-top, .toast-zone, .site-header { display: none !important; }
  .app-view { padding-bottom: 0; }
}
