/* HTDiags – Carte d'identité du bâtiment · habillage 1.2.0 */
.htdb{
  --g:#059669; --g2:#10b981; --dark:#0f172a; --navy:#1e3a5f; --y:#FFCD05;
  --ink:#1e293b; --muted:#64748b; --line:#e2e8f0; --soft:#f0fdf4;
  position:relative; box-sizing:border-box; width:100%; max-width:880px;
  margin:2.5rem auto; border-radius:20px; overflow:hidden; background:#fff;
  color:var(--ink); font-family:Roboto,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:16px; line-height:1.6; text-align:left;
  box-shadow:0 24px 60px -24px rgba(15,23,42,.35);
}
.htdb *,.htdb *::before,.htdb *::after{box-sizing:border-box}
.htdb h2,.htdb h3,.htdb h4{font-family:Montserrat,Roboto,system-ui,sans-serif;color:var(--dark);line-height:1.25;margin:0}
.htdb a{color:var(--g);font-weight:600;text-underline-offset:3px}

/* En-tête sombre, logo sur panneau blanc */
.htdb-hero{
  display:flex; align-items:center; gap:28px;
  padding:clamp(22px,4vw,40px);
  background:
    radial-gradient(circle at 92% 0%,rgba(16,185,129,.38),transparent 46%),
    linear-gradient(135deg,#0f172a 0%,#1e3a5f 100%);
}
.htdb-logo-wrap{flex:0 0 auto;padding:14px 18px;border-radius:14px;background:#fff;box-shadow:0 12px 30px -12px rgba(0,0,0,.5)}
.htdb-logo{display:block;width:220px;max-width:100%;height:auto}
.htdb-kicker{display:inline-block;margin:0 0 12px;padding:4px 11px;border-radius:999px;background:var(--y);color:var(--dark);font:700 11px/1.5 Montserrat,Roboto,sans-serif;letter-spacing:.09em;text-transform:uppercase}
.htdb .htdb-hero h2{color:#fff;font-size:clamp(1.35rem,3vw,1.8rem);font-weight:800;letter-spacing:-.01em}
.htdb .htdb-hero p{margin:10px 0 0;color:#cbd5e1;font-size:16px}

/* Corps */
.htdb-body{padding:clamp(18px,4vw,36px)}
.htdb-step{margin-bottom:30px}
.htdb .htdb-step-title{display:flex;align-items:center;gap:12px;margin-bottom:14px;font-size:1.12rem;font-weight:700}
.htdb .htdb-num{
  display:inline-grid; place-items:center; flex:0 0 auto;
  width:32px; height:32px; border-radius:50%;
  background:linear-gradient(135deg,var(--g2),var(--g)); color:#fff;
  font:700 15px/1 Montserrat,Roboto,sans-serif;
  box-shadow:0 6px 14px -6px rgba(5,150,105,.8);
}
.htdb-field{display:block;margin:0 0 14px;font-size:14px;font-weight:600;color:var(--ink)}
.htdb-grid2{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}

.htdb input,.htdb select{
  display:block; width:100%; margin-top:6px; padding:13px 14px;
  border:1.5px solid #cbd5e1; border-radius:12px; background:#fff;
  color:var(--ink); font:500 16px/1.4 Roboto,system-ui,sans-serif;
  transition:border-color .2s,box-shadow .2s;
}
.htdb input:focus,.htdb select:focus{outline:none;border-color:var(--g2);box-shadow:0 0 0 4px rgba(16,185,129,.2)}

/* Boutons */
.htdb button,.htdb .htdb-cta{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:46px; padding:12px 22px; margin:0;
  border:0; border-radius:999px; cursor:pointer; text-decoration:none;
  background:linear-gradient(135deg,var(--g2),var(--g)); color:#fff;
  font:700 15px/1.2 Montserrat,Roboto,sans-serif;
  box-shadow:0 10px 22px -10px rgba(5,150,105,.85);
  transition:transform .15s,box-shadow .2s,filter .2s;
}
.htdb button:hover,.htdb .htdb-cta:hover{transform:translateY(-1px);filter:brightness(1.06)}
.htdb button:focus-visible,.htdb .htdb-cta:focus-visible{outline:3px solid var(--y);outline-offset:2px}
.htdb .htdb-search{width:100%}
.htdb .htdb-cta{background:linear-gradient(135deg,#FFE15C,var(--y) 40%,#f5b800);color:var(--dark);box-shadow:0 12px 24px -12px rgba(245,184,0,.9)}

/* Suggestions d'adresses */
.htdb .htdb-options{display:grid;gap:8px;margin-top:14px}
.htdb .htdb-options:empty{display:none}
.htdb .htdb-options button{
  display:flex; align-items:flex-start; justify-content:flex-start; gap:12px;
  width:100%; min-height:0; padding:12px 14px; margin:0;
  border:1.5px solid var(--line); border-radius:12px; background:#fff; color:var(--ink);
  font:500 15px/1.4 Roboto,system-ui,sans-serif; text-align:left; box-shadow:none; transform:none;
}
.htdb .htdb-options button::before{content:"";flex:0 0 10px;width:10px;height:10px;margin-top:6px;border-radius:50%;background:var(--y);box-shadow:0 0 0 3px #fff7d6}
.htdb .htdb-options button:hover{border-color:var(--g2);background:var(--soft)}

.htdb-status{min-height:1.5em;margin:12px 0 0;font-size:14px;font-weight:600;color:var(--muted)}
.htdb-status:empty{min-height:0;margin:0}

/* Résultats cadastre et BDNB */
.htdb-cadastre,.htdb-results{display:grid;gap:14px;margin-bottom:26px}
.htdb-cadastre{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}
.htdb-results{grid-template-columns:1fr}
.htdb-cadastre:empty,.htdb-results:empty{display:none}
.htdb-cadastre > :not(article),.htdb-results > :not(article){grid-column:1/-1;margin:0}
.htdb-cadastre > h3{padding-top:4px;font-size:1.05rem}
.htdb-cadastre > p,.htdb-cadastre > a,.htdb-results > p{font-size:14px;color:var(--muted);margin:0}
.htdb-cadastre > a{justify-self:start}

.htdb article{
  position:relative; display:flex; flex-direction:column;
  padding:18px 18px 16px 22px; border:1px solid var(--line); border-radius:16px;
  background:linear-gradient(180deg,#fff 0%,#f8fafc 100%);
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}
.htdb article::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:4px;border-radius:0 4px 4px 0;background:linear-gradient(180deg,var(--y),var(--g2))}
.htdb article h3,.htdb article h4{margin:0 0 12px;font-size:1rem;color:var(--g)}

.htdb .htdb-dl{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:9px 16px;margin:0 0 14px;font-size:14px}
.htdb .htdb-dl dt{margin:0;color:var(--muted);font-weight:500}
.htdb .htdb-dl dd{margin:0;color:var(--dark);font-weight:600;overflow-wrap:anywhere}

.htdb .htdb-use{margin-top:auto;width:100%;background:#fff;color:var(--g);border:1.5px solid var(--g2);box-shadow:none;min-height:42px}
.htdb .htdb-use:hover{background:var(--soft)}

/* Diagnostics à prévoir */
.htdb-diags{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.htdb-diag{
  display:grid; grid-template-columns:minmax(120px,170px) 112px minmax(0,1fr);
  align-items:center; gap:8px 14px; margin:0; padding:12px 14px;
  border:1px solid var(--line); border-radius:12px; background:#f8fafc; font-size:15px;
}
.htdb-diag strong{color:var(--dark);font-weight:700}
.htdb-detail{color:var(--ink);font-size:14.5px;line-height:1.5}
.htdb-tag{
  justify-self:start; padding:4px 0; width:100%; text-align:center; border-radius:999px;
  font:700 11px/1.5 Montserrat,Roboto,sans-serif; letter-spacing:.06em; text-transform:uppercase;
}
.htdb-warn{background:#fffbea;border-color:#fde68a}
.htdb-warn .htdb-tag{background:var(--y);color:var(--dark)}
.htdb-check .htdb-tag{background:#fff3c4;color:#7a5a00;box-shadow:inset 0 0 0 1px #f0c94a}
.htdb-ok .htdb-tag{background:#d1fae5;color:#065f46}
.htdb-info .htdb-tag{background:#e2e8f0;color:#334155}

/* Liens utiles et actions */
.htdb-links{display:flex;flex-wrap:wrap;gap:8px 18px;margin:0 0 22px;font-size:14px}
.htdb-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding-top:22px;border-top:1px solid var(--line)}
.htdb .htdb-print{background:#fff;color:var(--dark);border:1.5px solid #cbd5e1;box-shadow:none}
.htdb .htdb-print:hover{background:#f8fafc}

.htdb small{display:block;margin-top:22px;font-size:12.5px;line-height:1.55;color:var(--muted)}

/* Mobile */
@media (max-width:640px){
  .htdb{margin:1.5rem auto;border-radius:16px}
  .htdb-hero{flex-direction:column;align-items:flex-start;gap:18px}
  .htdb-logo{width:190px}
  .htdb-grid2{grid-template-columns:1fr}
  .htdb .htdb-dl{grid-template-columns:1fr;gap:2px 0}
  .htdb .htdb-dl dt{margin-top:8px}
  .htdb .htdb-dl dt:first-child{margin-top:0}
  .htdb-diag{grid-template-columns:minmax(0,1fr) auto;gap:8px 12px}
  .htdb-detail{grid-column:1/-1}
  .htdb-tag{width:auto;padding:4px 10px}
  .htdb-actions{flex-direction:column;align-items:stretch}
  .htdb .htdb-cta,.htdb .htdb-print{width:100%}
}
@media (min-width:641px){
  .htdb .htdb-search{width:auto;min-width:220px}
}

@media (prefers-reduced-motion:reduce){
  .htdb *{transition:none!important}
}
@media print{
  .htdb{box-shadow:none;border:0;margin:0;max-width:none;border-radius:0}
  .htdb-hero{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .htdb button,.htdb .htdb-cta,.htdb-options,.htdb-links,.htdb-actions{display:none!important}
}
