:root{
  --esn-cyan:#00AEEF;
  --esn-blue:#2E3192;

  --bg:#F6FAFC;
  --text:#0B1220;
  --muted:#4B5563;
  --border:rgba(15,23,42,.12);
  --radius:18px;
  --shadow:0 14px 32px rgba(2,8,23,.12);

  --danger:#D90429;
  --danger2:#9B0020;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:"Lato", system-ui, sans-serif;
  background:
    radial-gradient(900px 400px at 20% -10%, rgba(0,174,239,.25), transparent 60%),
    radial-gradient(700px 360px at 85% 0%, rgba(46,49,146,.18), transparent 55%),
    var(--bg);
  color:var(--text);
}

header{
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(10px);
  background: rgba(246,250,252,.85);
  border-bottom:1px solid var(--border);
}

.header-inner{
  max-width:1100px;
  margin:auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:14px;
}

.header-actions{
  margin-left:auto;
  display:flex;
  gap:10px;
  align-items:center;
}

.logo-img{
  height:44px;
  width:auto;
  padding:6px;
  background:white;
  border-radius:14px;
  box-shadow:0 10px 24px rgba(0,0,0,.15);
}

.brand{
  font-weight:900;
  font-size:18px;
  line-height:1.15;
}

.brand small{
  display:block;
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}

.wrap{
  max-width:1100px;
  margin:auto;
  display:grid;
  grid-template-columns:380px 1fr;
  min-height:calc(100vh - 72px);
}

.panel{ padding:16px; }

.panel-box{
  background:rgba(255,255,255,.95);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}

label{
  display:block;
  margin:14px 0 6px;
  font-size:12px;
  color:var(--muted);
}

select{
  width:100%;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  font-size:14px;
  background:white;
}

button{
  width:100%;
  margin-top:14px;
  padding:14px;
  border-radius:16px;
  border:none;
  font-weight:900;
  font-size:14px;
  color:white;
  background:linear-gradient(135deg,var(--esn-cyan),var(--esn-blue));
  cursor:pointer;
  box-shadow:0 16px 28px rgba(0,174,239,.3);
}

button:disabled{
  opacity:.65;
  cursor:not-allowed;
}

.secondary{
  background:#fff;
  color:var(--text);
  border:1px solid var(--border);
  box-shadow:none;
}

.ghost{
  background:transparent;
  color:var(--text);
  border:1px solid var(--border);
  box-shadow:none;
  padding:10px 12px;
  border-radius:14px;
  font-weight:900;
  cursor:pointer;
}

.divider{
  height:1px;
  background:var(--border);
  margin:14px 0;
}

.muted{ color:var(--muted); font-size:13px; }
.geo-status{ margin-top:10px; }
.geo-row{ display:flex; gap:10px; margin-top:6px; }
.geo-row .secondary{ margin-top:0; }
.geo-row .ghost{ margin-top:0; width:auto; }

.card{
  margin-top:16px;
  padding:14px;
  border-radius:16px;
  border:1px solid var(--border);
  background:white;
}

.result-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.card h2{
  margin:0 0 6px;
  font-size:16px;
}

.meta{
  margin-top:10px;
  padding:10px 12px;
  border:1px dashed var(--border);
  border-radius:14px;
  font-size:13px;
  color:var(--muted);
  background:rgba(2,8,23,.02);
}

.actions{
  display:flex;
  gap:10px;
  margin-top:12px;
}

.link, .call{
  display:inline-block;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  text-decoration:none;
  font-weight:900;
  color:var(--text);
  background:#fff;
}

.call{
  background:var(--esn-cyan);
  color:white;
  border:none;
}

.badge{
  font-weight:900;
  font-size:12px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(2,8,23,.03);
  color:var(--text);
  white-space:nowrap;
}

.badge-urgences{ background:rgba(217,4,41,.08); border-color:rgba(217,4,41,.25); }
.badge-pharmacie{ background:rgba(0,174,239,.10); border-color:rgba(0,174,239,.25); }
.badge-police{ background:rgba(46,49,146,.10); border-color:rgba(46,49,146,.25); }

.footer-note{
  margin-top:14px;
  line-height:1.35;
}

#map{
  height:100%;
  border-left:1px solid var(--border);
}

/* ===== PRIORITÉ 1 : Emergency box ===== */
.emergency-box{
  border-radius:16px;
  border:1px solid rgba(217,4,41,.25);
  background:linear-gradient(135deg, rgba(217,4,41,.10), rgba(217,4,41,.04));
  padding:14px;
}

.emergency-title{
  font-weight:900;
  font-size:14px;
  margin-bottom:4px;
}

.emergency-sub{
  font-size:13px;
  color:var(--muted);
  margin-bottom:10px;
}

.emergency-actions{
  display:flex;
  gap:10px;
}

.btn-emg{
  flex:1;
  text-align:center;
  padding:12px 10px;
  border-radius:14px;
  text-decoration:none;
  font-weight:900;
  color:white;
  background:linear-gradient(135deg, var(--danger), var(--danger2));
  box-shadow:0 14px 26px rgba(217,4,41,.25);
}

.emergency-note{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
}

/* ===== PRIORITÉ 3 : Mode discret / sombre ===== */
body.discreet{
  background:#0B0F19;
  color:#E6E8EE;
}

body.discreet header{
  background: rgba(11,15,25,.85);
  border-bottom:1px solid rgba(255,255,255,.10);
}

body.discreet .panel-box{
  background: rgba(17,24,39,.85);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:none;
}

body.discreet .muted,
body.discreet label,
body.discreet .brand small{
  color: rgba(230,232,238,.70);
}

body.discreet select{
  background: rgba(11,15,25,.85);
  color:#E6E8EE;
  border:1px solid rgba(255,255,255,.10);
}

body.discreet .card{
  background: rgba(11,15,25,.75);
  border:1px solid rgba(255,255,255,.10);
}

body.discreet .meta{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.15);
  color: rgba(230,232,238,.75);
}

body.discreet .link{
  background: rgba(255,255,255,.06);
  color:#E6E8EE;
  border:1px solid rgba(255,255,255,.12);
}

body.discreet .ghost,
body.discreet .secondary{
  background: rgba(255,255,255,.06);
  color:#E6E8EE;
  border:1px solid rgba(255,255,255,.12);
}

body.discreet button{
  box-shadow:none;
}

body.discreet #map{
  filter: grayscale(1) contrast(1.05) brightness(.9);
  border-left:1px solid rgba(255,255,255,.10);
}

@media(max-width:900px){
  .wrap{ grid-template-columns:1fr; }
  #map{ height:60vh; border-left:none; border-top:1px solid var(--border); }
  body.discreet #map{ border-top:1px solid rgba(255,255,255,.10); }
}
