/* ============================================================
   Carte de visite numérique — WATER HOME
   Charte du site waterhome.ci : bleu #1E40AF / #3B82F6, fond #EFF6FF
   Mobile : une colonne ; grand écran (≥ 860 px) : identité à gauche,
   contenu à droite.
   ============================================================ */
:root {
  --navy: #1E3A8A;
  --navy-2: #1E40AF;
  --blue: #3B82F6;
  --blue-soft: #93C5FD;
  --wa: #25d366;
  --bg-page-1: #EFF6FF;
  --bg-page-2: #DBEAFE;
  --card-bg: #ffffff;
  --row-bg: #EFF6FF;
  --row-bg-hover: #DBEAFE;
  --text: #0F172A;
  --text-soft: #475569;
  --ic-bg: #ffffff;
  --border: rgba(30, 58, 138, 0.09);
  --shadow: 0 18px 50px rgba(30, 58, 138, 0.22);
  --radius: 24px;
  --band: linear-gradient(165deg, #1E3A8A 0%, #1E40AF 55%, #2563EB 100%);
}
:root[data-theme="dark"] {
  --navy: #E0EAFF;
  --navy-2: #C7D7FE;
  --blue: #60A5FA;
  --blue-soft: #2563EB;
  --bg-page-1: #0B1A3F;
  --bg-page-2: #060E24;
  --card-bg: #0F1F4A;
  --row-bg: #162B5E;
  --row-bg-hover: #1D3773;
  --text: #E6EEFF;
  --text-soft: #A9BCE6;
  --ic-bg: #0B1A3F;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --band: linear-gradient(165deg, #0B1A3F 0%, #1E3A8A 60%, #1E40AF 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Pas de hauteur fixe sur html/body : le document suit le contenu, donc la
   page défile normalement partout (iOS ne défile pas ce qui dépasse d'un
   body à hauteur fixe). Le décor est porté par .bg-overlay (fixe). */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  background: var(--bg-page-2);
  transition: background .4s, color .4s;
}
.bg-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, .18), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(30, 58, 138, .2), transparent 55%),
    linear-gradient(160deg, var(--bg-page-1) 0, var(--bg-page-2) 100%);
}
.bg-overlay::after {
  content: ""; position: absolute; inset: 0;
  background: url("img/fond.webp") center/cover no-repeat;
  opacity: .14;
}
:root[data-theme="dark"] .bg-overlay::after { opacity: .07; }

/* ---------- Carte ---------- */
.card {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: auto;            /* centré quand la carte tient dans l'écran, sinon en haut */
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: cardIn .55s cubic-bezier(.2, .8, .2, 1) both;
  transition: background .4s;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }

.toolbar { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 5; }
.tool-btn {
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  border-radius: 50px;
  font-weight: 800;
  font-size: 13px;
  height: 34px;
  min-width: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
  backdrop-filter: blur(4px);
}
.tool-btn--lang { padding: 0 12px; letter-spacing: 1px; }
.tool-btn:hover { background: rgba(255, 255, 255, .28); transform: translateY(-1px); }
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn .ic-moon { display: none; }
:root[data-theme="dark"] .tool-btn .ic-sun { display: none; }
:root[data-theme="dark"] .tool-btn .ic-moon { display: block; }

/* ---------- Identité ---------- */
.identity {
  text-align: center;
  padding: 22px 24px 18px;
  position: relative;
}
.identity::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 190px;
  background: var(--band);
  z-index: 0;
}
.identity > * { position: relative; z-index: 1; }
.identity__logo {
  height: 96px; width: auto;
  display: block; margin: 0 auto 16px;
  background: #fff; padding: 8px 14px; border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.identity__photo-ring {
  width: 140px; height: 140px;
  margin: 0 auto 12px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--blue), #fff);
  box-shadow: 0 10px 26px rgba(30, 58, 138, .3);
  animation: riseIn .5s .1s both;
}
.identity__photo {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover; object-position: center 20%;
  display: block;
  background: #fff;
}
.identity__name {
  color: var(--navy);
  font-size: 27px;
  letter-spacing: .5px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 6px;
  animation: riseIn .5s .16s both;
}
.identity__role {
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 13.5px;
  margin-top: 6px;
  animation: riseIn .5s .2s both;
}
.identity__company { color: var(--navy); font-weight: 800; letter-spacing: 1px; margin-top: 4px; animation: riseIn .5s .24s both; }
.identity__tagline { color: var(--text-soft); font-size: 13px; font-style: italic; margin: 2px 0 18px; animation: riseIn .5s .26s both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.btn-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #fff; text-decoration: none;
  font-weight: 800; font-size: 16px;
  padding: 15px 22px; border-radius: 50px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .4);
  transition: transform .2s, box-shadow .2s;
  animation: riseIn .5s .3s both;
}
.btn-save svg { width: 22px; height: 22px; flex-shrink: 0; }
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(37, 99, 235, .5); }
.hint { font-size: 12px; color: var(--text-soft); margin-top: 8px; line-height: 1.4; }

.quick { display: flex; justify-content: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; animation: riseIn .5s .36s both; }
.quick__btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--text-soft);
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  min-width: 64px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.quick__btn span.ic {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--row-bg); color: var(--navy);
  border: 1px solid var(--border);
  transition: transform .2s, background .2s, color .2s;
}
.quick__btn span.ic svg { width: 22px; height: 22px; }
.quick__btn:hover span.ic { transform: translateY(-3px); background: var(--navy-2); color: #fff; }
:root[data-theme="dark"] .quick__btn:hover span.ic { color: var(--bg-page-2); }
.quick__btn--wa span.ic { background: var(--wa); color: #fff; border-color: transparent; }
.quick__btn--wa:hover span.ic { background: #1ebe5b; color: #fff; }

/* ---------- Contenu ---------- */
.card__main { min-width: 0; }

.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 2px 24px 14px;
  padding: 4px;
  background: var(--row-bg);
  border-radius: 14px;
}
.tab {
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 14px;
  color: var(--text-soft);
  padding: 10px 6px; border-radius: 11px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tab.is-active { background: var(--card-bg); color: var(--navy); box-shadow: 0 2px 8px rgba(30, 58, 138, .12); }
.tab:hover:not(.is-active) { color: var(--navy); }

.panel { display: none; padding: 0 24px 22px; }
.panel.is-active { display: block; animation: fade .3s; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel__intro { font-size: 14px; color: var(--text-soft); text-align: center; margin: 0 0 14px; line-height: 1.45; }

/* ---------- Lignes de contact ---------- */
.rows { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rows li {
  display: flex; align-items: center; gap: 12px;
  background: var(--row-bg);
  padding: 10px 12px 10px 10px;
  border-radius: 14px;
  transition: background .2s, transform .2s;
}
.rows li:hover { background: var(--row-bg-hover); transform: translateX(2px); }
.rows .ic {
  flex-shrink: 0; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--ic-bg); color: var(--blue);
  box-shadow: 0 2px 6px rgba(30, 58, 138, .12);
}
.rows .ic svg { width: 20px; height: 20px; }
.rows .ic--wa { color: var(--wa); }
.rows .ic--in { color: #0A66C2; }
:root[data-theme="dark"] .rows .ic--in { color: #70B5F9; }
.rows .txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rows .txt small { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-soft); }
.rows a, .rows button.addr {
  color: var(--navy); text-decoration: none; font-weight: 700; font-size: 14.5px;
  overflow-wrap: anywhere; line-height: 1.3;
  background: none; border: none; padding: 0; font-family: inherit; text-align: left; cursor: pointer;
}
.rows a:hover, .rows button.addr:hover { color: var(--blue); }
.rows .txt--long a { font-size: 13.5px; letter-spacing: -.1px; }
.rows .addr-hint { display: block; font-size: 12px; color: var(--blue); font-weight: 700; margin-top: 2px; }
.rows .go { flex-shrink: 0; color: var(--text-soft); opacity: .6; width: 18px; height: 18px; }
@media (max-width: 400px) { .rows .go { display: none; } }

.map-wrap {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .4s, opacity .4s, margin .4s;
  border-radius: 14px; margin: 0;
}
.map-wrap.is-open { max-height: 300px; opacity: 1; margin: 10px 0 6px; }
.map-wrap iframe { width: 100%; height: 190px; border: 0; border-radius: 14px; display: block; }
.map-link { display: inline-block; font-size: 13px; font-weight: 700; color: var(--blue); text-decoration: none; margin-top: 8px; }
.map-link:hover { text-decoration: underline; }

.menu-link {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  text-decoration: none;
  font-size: 15px; font-weight: 700;
  color: var(--navy);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--blue);
  padding: 13px 14px; border-radius: 14px;
  transition: .22s;
}
.menu-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.menu-link__arrow { margin-left: auto; opacity: .7; }
.menu-link:hover { color: #fff; background: var(--band); border-bottom-color: var(--navy-2); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(30, 58, 138, .22); }

/* ---------- Partager ---------- */
.qr { text-align: center; margin-bottom: 16px; }
.qr__canvas {
  display: inline-block; padding: 12px; background: #fff; border-radius: 16px;
  border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(30, 58, 138, .12);
}
.qr__canvas canvas, .qr__canvas img { display: block; }
.qr__url { font-size: 13px; font-weight: 700; color: var(--navy); margin: 10px 0 8px; word-break: break-all; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--row-bg); color: var(--navy);
  border: 1px solid var(--border); border-radius: 50px;
  padding: 9px 16px; font-weight: 700; font-size: 13.5px; font-family: inherit;
  cursor: pointer; transition: background .2s, transform .2s;
}
.btn-ghost svg { width: 17px; height: 17px; }
.btn-ghost:hover { background: var(--row-bg-hover); transform: translateY(-1px); }

.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--row-bg); color: var(--navy);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 10px; font-weight: 700; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: background .2s, transform .2s, color .2s;
}
.share-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.share-btn:hover { background: var(--navy-2); color: #fff; transform: translateY(-2px); }
.share-btn--wa { background: var(--wa); color: #fff; border-color: transparent; }
.share-btn--wa:hover { background: #1ebe5b; color: #fff; }
.share-btn[hidden] { display: none; }

/* ---------- Galerie ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery figure { position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--row-bg); }
.gallery img { width: 100%; height: 124px; object-fit: cover; display: block; transition: transform .3s; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(15, 23, 42, .85));
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 18px 8px 7px;
}

.card__footer {
  text-align: center; font-size: 12px; color: var(--text-soft);
  padding: 12px 24px 16px; border-top: 1px solid var(--border);
}
.card__footer a { color: var(--blue); font-weight: 700; text-decoration: none; }

/* ---------- Lightbox, WhatsApp flottant, toast ---------- */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .93); z-index: 100; place-items: center; padding: 20px; }
.lightbox.is-open { display: grid; animation: fade .25s; }
.lightbox__fig { margin: 0; text-align: center; }
.lightbox__img { max-width: 92vw; max-height: 78vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox__cap { color: #fff; margin-top: 12px; font-weight: 600; font-size: 15px; }
.lightbox__close { position: absolute; top: 18px; right: 22px; background: none; border: none; color: #fff; font-size: 40px; cursor: pointer; line-height: 1; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .15); border: none; color: #fff; font-size: 40px; width: 54px; height: 54px; border-radius: 50%; cursor: pointer; transition: background .2s; }
.lightbox__nav:hover { background: rgba(255, 255, 255, .3); }
.lightbox__prev { left: 14px; }
.lightbox__next { right: 14px; }

.wa-float {
  position: fixed; right: 18px; bottom: 18px;
  width: 58px; height: 58px;
  background: var(--wa); color: #fff; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(37, 211, 102, .45);
  z-index: 60; animation: waPop .5s .6s both;
}
.wa-float[hidden] { display: none; }
.wa-float svg { width: 32px; height: 32px; }
.wa-float::after { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: waPulse 2.2s infinite; }
@keyframes waPulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .45); } 70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }
@keyframes waPop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: #1E3A8A; color: #fff;
  padding: 12px 20px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none; z-index: 200;
  transition: opacity .3s, transform .3s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Tablette ---------- */
@media (min-width: 600px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Grand écran : deux colonnes ---------- */
@media (min-width: 860px) {
  body { padding: 32px 24px; }
  .card {
    max-width: 1000px;
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    align-items: stretch;
  }
  .identity {
    padding: 44px 32px 40px;
    background: var(--band);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  .identity::before { display: none; }
  .identity__logo { height: 112px; margin-bottom: 22px; }
  .identity__photo-ring { width: 176px; height: 176px; margin-bottom: 16px; }
  .identity__name { color: #fff; font-size: 30px; }
  .identity__role { color: #BFDBFE; font-size: 14px; }
  .identity__company { color: #fff; }
  .identity__tagline { color: rgba(255, 255, 255, .75); margin-bottom: 22px; }
  .identity .hint { color: rgba(255, 255, 255, .72); }
  .btn-save { background: #fff; color: #1E40AF; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); max-width: 320px; }
  .btn-save:hover { box-shadow: 0 14px 30px rgba(0, 0, 0, .3); }
  .quick { gap: 18px; margin-top: 20px; }
  .quick__btn { color: rgba(255, 255, 255, .88); }
  .quick__btn span.ic { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .22); }
  .quick__btn:hover span.ic { background: #fff; color: #1E40AF; }
  .quick__btn--wa span.ic { background: var(--wa); border-color: transparent; }

  .card__main { display: flex; flex-direction: column; padding: 30px 32px 10px; }
  .toolbar { top: 18px; right: 18px; }
  .tool-btn { border-color: var(--border); background: var(--row-bg); color: var(--navy); backdrop-filter: none; }
  .tool-btn:hover { background: var(--row-bg-hover); }
  .tabs { margin: 34px 0 20px; }
  .panel { padding: 0 0 24px; }
  .panel__intro { text-align: left; }
  .rows { gap: 12px; }
  .rows li { padding: 12px 16px 12px 12px; }
  .rows a, .rows button.addr, .rows .txt--long a { font-size: 15.5px; letter-spacing: 0; }
  .map-wrap iframe { height: 240px; }
  .map-wrap.is-open { max-height: 340px; }
  .share-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .gallery img { height: 150px; }
  .card__footer { margin-top: auto; padding: 14px 0; }
}
@media (min-width: 1200px) {
  .card { max-width: 1080px; grid-template-columns: 430px minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 360px) {
  .identity, .panel { padding-left: 16px; padding-right: 16px; }
  .tabs { margin-left: 16px; margin-right: 16px; }
  .identity__name { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
