/* =========================================================
   MODULE QUALITÉ DE L'EAU — V2 PREMIUM FULL WIDTH
   Fichiers : pages/qualite-eau.php + assets/js/qualite-eau.js
========================================================= */

.water-v2-page {
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 99, 235, .10), transparent 30%),
    radial-gradient(circle at 95% 12%, rgba(14, 165, 233, .14), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  padding: 24px 0 56px;
}

.water-v2-container {
  max-width: 1240px;
}

.water-v2-main {
  display: grid;
  gap: 24px;
  color: #071b44;
}

.water-v2-hero,
.water-v2-city-card,
.water-v2-score-card,
.water-v2-info-strip,
.water-v2-analysis-section,
.water-v2-trust-grid article,
.water-v2-map-section,
.water-v2-source,
.water-v2-loading,
.water-v2-error {
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(255,255,255,.92);
  box-shadow: 0 22px 70px rgba(15, 23, 42, .08);
  backdrop-filter: blur(18px);
}

.water-v2-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.55fr .85fr;
  gap: 28px;
  border-radius: 32px;
  padding: 34px;
}

.water-v2-hero::before {
  content: "";
  position: absolute;
  inset: -160px -120px auto auto;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, .18), transparent 66%);
  pointer-events: none;
}

.water-v2-pills,
.water-v2-note-line,
.water-v2-labels,
.water-v2-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.water-v2-pills span,
.water-v2-note-line span,
.water-v2-labels span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.water-v2-pills span:first-child {
  color: #1d4ed8;
  background: #dbeafe;
}

.water-v2-pills span:last-child,
.water-v2-labels span:last-child {
  color: #047857;
  background: #dcfce7;
}

.water-v2-hero h1 {
  max-width: 720px;
  margin: 20px 0 12px;
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: .95;
  letter-spacing: -2.5px;
  font-weight: 950;
  color: #06163a;
}

.water-v2-hero p {
  max-width: 760px;
  margin: 0;
  color: #526079;
  font-size: 16px;
  line-height: 1.65;
}

.water-v2-search {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.35fr .62fr auto;
  align-items: end;
  gap: 12px;
  max-width: 760px;
  margin-top: 26px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.94));
  border: 1px solid rgba(148, 163, 184, .28);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .10);
}

.water-v2-field label {
  display: block;
  margin: 0 0 8px;
  color: #112b62;
  font-size: 12px;
  font-weight: 900;
}

.water-v2-field input {
  width: 100%;
  height: 52px;
  border: 1px solid #d6e1f1;
  border-radius: 16px;
  padding: 0 16px;
  background: #fff;
  color: #071b44;
  font-size: 15px;
  font-weight: 800;
  outline: none;
  transition: .18s ease;
}

.water-v2-field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .12);
}

.water-v2-submit {
  height: 52px;
  min-width: 138px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  background: linear-gradient(135deg, #ff0000 0%, #c40000 100%);
  box-shadow: 0 18px 34px rgba(255, 0, 0, .24);
  transition: transform .18s ease, box-shadow .18s ease;
}

.water-v2-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px rgba(255, 0, 0, .32);
}

.water-v2-note-line {
  margin-top: 16px;
}

.water-v2-note-line span {
  color: #0f2a5f;
  background: #f8fafc;
  border: 1px solid #d8e4f2;
}

.water-v2-hero-score {
  position: relative;
  min-height: 260px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 82%, rgba(37, 99, 235, .28), transparent 27%),
    linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  border: 1px solid #dbe7f7;
}

.water-v2-hero-score::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: 220px;
  height: 60px;
  transform: translateX(-50%);
  background: rgba(37, 99, 235, .18);
  filter: blur(24px);
  border-radius: 999px;
}

.water-v2-orb {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 190px;
  min-height: 160px;
  padding: 22px;
  border-radius: 26px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 20px 60px rgba(37, 99, 235, .10);
  text-align: center;
}

.water-v2-orb span {
  text-transform: uppercase;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
}

.water-v2-orb strong {
  display: block;
  margin: 4px 0;
  color: #0a214f;
  font-size: 58px;
  line-height: 1;
  letter-spacing: -3px;
}

.water-v2-orb small {
  font-size: 22px;
  letter-spacing: -1px;
}

.water-v2-orb p {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.water-v2-loading,
.water-v2-error {
  border-radius: 24px;
  padding: 18px 20px;
}

.water-v2-loading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.water-v2-loading span {
  width: 20px;
  height: 20px;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: waterSpin .7s linear infinite;
}

@keyframes waterSpin { to { transform: rotate(360deg); } }

.water-v2-error {
  color: #991b1b;
  background: #fff1f2;
  border-color: #fecdd3;
  font-weight: 900;
}

.water-v2-results {
  display: grid;
  gap: 22px;
}

.water-v2-dashboard {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
}

.water-v2-city-card,
.water-v2-score-card,
.water-v2-analysis-section,
.water-v2-map-section {
  border-radius: 30px;
  padding: 26px;
}

.water-v2-card-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.water-v2-labels span:first-child {
  color: #1d4ed8;
  background: #eff6ff;
}

.water-v2-city-card h2 {
  margin: 15px 0 6px;
  color: #06163a;
  font-size: clamp(36px, 5vw, 62px);
  line-height: .95;
  letter-spacing: -2px;
  font-weight: 950;
}

.water-v2-city-card h2 small {
  color: #64748b;
  font-size: 20px;
  letter-spacing: 0;
}

.water-v2-city-card p {
  color: #526079;
  margin: 0;
  line-height: 1.55;
}

.water-v2-score-mini {
  min-width: 130px;
  text-align: right;
}

.water-v2-score-mini strong {
  display: block;
  color: #06163a;
  font-size: 56px;
  line-height: .9;
  letter-spacing: -2px;
}

.water-v2-score-mini span {
  font-size: 20px;
}

.water-v2-score-mini em,
#waterGlobalBadge {
  display: inline-flex;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.is-excellent { color: #047857 !important; background: #dcfce7 !important; }
.is-good { color: #1d4ed8 !important; background: #dbeafe !important; }
.is-correct { color: #92400e !important; background: #fef3c7 !important; }
.is-watch { color: #b91c1c !important; background: #fee2e2 !important; }
.is-bad { color: #b91c1c !important; background: #fee2e2 !important; }
.is-neutral { color: #475569 !important; background: #f1f5f9 !important; }

.water-v2-warning {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff, #f8fbff);
  color: #1e3a8a;
  font-weight: 750;
  line-height: 1.5;
}

.water-v2-score-card {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
}

.water-v2-ring {
  width: 218px;
  height: 218px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#2563eb calc(var(--score) * 1%), #56c567 0, #56c567 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 22px 55px rgba(37, 99, 235, .18);
}

.water-v2-ring > div {
  display: grid;
  place-items: center;
  width: 162px;
  height: 162px;
  border-radius: 50%;
  background: #fff;
  color: #06163a;
}

.water-v2-ring span {
  text-transform: uppercase;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
}

.water-v2-ring strong {
  font-size: 52px;
  line-height: .8;
  letter-spacing: -2px;
}

.water-v2-ring small {
  font-weight: 950;
}

.water-v2-stats {
  display: grid;
  gap: 10px;
  width: 100%;
}

.water-v2-stats div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.water-v2-stats span {
  color: #64748b;
  font-weight: 800;
}

.water-v2-stats strong {
  color: #071b44;
  font-weight: 950;
  text-align: right;
}

.water-v2-info-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-radius: 26px;
  padding: 22px;
}

.water-v2-info-strip article {
  min-width: 0;
  padding: 4px 14px;
  border-left: 1px solid #e2e8f0;
}

.water-v2-info-strip article:first-child {
  border-left: 0;
}

.water-v2-info-strip span {
  display: block;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 8px;
}

.water-v2-info-strip strong {
  display: block;
  color: #06163a;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 950;
}

.water-v2-info-strip small {
  display: block;
  margin-top: 4px;
  color: #0f2a5f;
  font-weight: 800;
}

.water-v2-section-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

.water-v2-section-head > div:first-child > span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.water-v2-section-head h3 {
  margin: 5px 0 6px;
  color: #06163a;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.8px;
}

.water-v2-section-head p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}

.water-v2-legend span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.water-v2-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
}
.water-v2-legend i.good { background: #22c55e; }
.water-v2-legend i.watch { background: #f59e0b; }
.water-v2-legend i.bad { background: #ef4444; }

.water-v2-analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.water-v2-analysis-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #f9fbff);
  border: 1px solid #dfe8f5;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.water-v2-analysis-card:hover {
  transform: translateY(-4px);
  border-color: #bfdbfe;
  box-shadow: 0 20px 45px rgba(15, 23, 42, .10);
}

.water-v2-analysis-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #cbd5e1;
}

.water-v2-analysis-card.is-good::before { background: #22c55e; }
.water-v2-analysis-card.is-watch::before { background: #f59e0b; }
.water-v2-analysis-card.is-bad::before { background: #ef4444; }

.water-v2-analysis-top {
  display: flex;
  align-items: start;
  gap: 12px;
}

.water-v2-analysis-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: #eff6ff;
  font-size: 20px;
}

.water-v2-analysis-top h4 {
  margin: 2px 0 3px;
  color: #071b44;
  font-size: 15px;
  font-weight: 950;
}

.water-v2-analysis-top p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.water-v2-analysis-top em {
  margin-left: auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.water-v2-analysis-value {
  margin-top: 22px;
  color: #06163a;
}

.water-v2-analysis-value strong {
  font-size: 34px;
  line-height: .95;
  letter-spacing: -1.4px;
  font-weight: 950;
}

.water-v2-analysis-value span {
  margin-left: 5px;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
}

.water-v2-analysis-ref {
  min-height: 34px;
  margin-top: 14px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 750;
}

.water-v2-analysis-status {
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.water-v2-trust-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 16px;
}

.water-v2-trust-grid article {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-radius: 24px;
  padding: 20px;
}

.water-v2-trust-grid article.is-primary {
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
  border-color: #bbf7d0;
}

.water-v2-trust-grid i {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #eff6ff;
  font-style: normal;
  font-weight: 950;
}

.water-v2-trust-grid h4 {
  margin: 0 0 6px;
  color: #071b44;
  font-size: 15px;
  font-weight: 950;
}

.water-v2-trust-grid p {
  margin: 0;
  color: #64748b;
  line-height: 1.48;
  font-size: 13px;
}

.water-v2-map-badge {
  min-width: 150px;
  padding: 13px 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-align: right;
}

.water-v2-map-badge strong,
.water-v2-map-badge span {
  display: block;
}

.water-v2-map-badge strong {
  color: #06163a;
  font-size: 17px;
  font-weight: 950;
}

.water-v2-map-badge span {
  color: #64748b;
  font-weight: 850;
}

.water-v2-map-frame {
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid #dce7f5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}

.water-v2-map {
  height: 455px;
  width: 100%;
  background: #eef2f7;
}

.water-v2-marker {
  position: relative;
  width: 34px;
  height: 34px;
  border: 4px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 18px 32px rgba(37, 99, 235, .34);
}

.water-v2-marker::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  top: 8px;
  left: 8px;
  border-radius: 50%;
  background: #fff;
}

.water-v2-source {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-radius: 22px;
  padding: 16px 20px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

#waterLoading[hidden],
#waterError[hidden],
#waterResults[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .water-v2-hero,
  .water-v2-dashboard {
    grid-template-columns: 1fr;
  }
  .water-v2-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .water-v2-trust-grid,
  .water-v2-info-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .water-v2-page { padding-top: 12px; }
  .water-v2-hero,
  .water-v2-city-card,
  .water-v2-score-card,
  .water-v2-analysis-section,
  .water-v2-map-section {
    border-radius: 24px;
    padding: 20px;
  }
  .water-v2-hero h1 {
    font-size: 34px;
    letter-spacing: -1.4px;
  }
  .water-v2-search,
  .water-v2-card-top,
  .water-v2-section-head {
    grid-template-columns: 1fr;
    display: grid;
  }
  .water-v2-submit { width: 100%; }
  .water-v2-dashboard,
  .water-v2-analysis-grid,
  .water-v2-trust-grid,
  .water-v2-info-strip {
    grid-template-columns: 1fr;
  }
  .water-v2-info-strip article {
    border-left: 0;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
  }
  .water-v2-info-strip article:first-child {
    border-top: 0;
  }
  .water-v2-score-mini {
    text-align: left;
  }
  .water-v2-map { height: 360px; }
  .water-v2-source { flex-direction: column; }
}
