/* Harta adăposturilor – paleta Declic (declic.ro) */
:root {
  --blue: #C6E2FF;        /* --main-bg-color declic.ro */
  --blue-soft: #EAF4FF;
  --coral: #FC435E;       /* --secondary-bg-color declic.ro */
  --coral-dark: #e90032;
  --black: #000;
  --ink: #221f1f;
  --muted: #555;
  --line: #d9d9d9;
  --white: #fff;
  --s0: #197b30;          /* funcțional   */
  --s1: #f5a300;          /* parțial      */
  --s2: #e90032;          /* nefuncțional */
  --s3: #666666;          /* necunoscută  */
  --panel-w: 380px;
  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Barlow", system-ui, sans-serif;
  color: var(--black);
  background: var(--white);
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--black); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { display: flex; height: 100vh; height: 100dvh; }

/* ---------- Panou stânga ---------- */
.panel {
  width: var(--panel-w);
  flex: 0 0 var(--panel-w);
  overflow-y: auto;
  background: var(--white);
  border-right: 2px solid var(--black);
  padding: 0 20px 20px;
  z-index: 2;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 -20px 16px; padding: 14px 20px;
  background: var(--blue);
  border-bottom: 2px solid var(--black);
}
.logo img { display: block; height: 40px; width: auto; }
.panel-close { display: none; background: none; border: 0; font-size: 32px; line-height: 1; cursor: pointer; }

.title { font-size: 26px; font-weight: 800; line-height: 1.1; margin: 0 0 6px; }
.lead { margin: 0 0 16px; color: var(--ink); }
#totalCount { font-weight: 700; }

.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search input {
  flex: 1; min-width: 0;
  font: inherit; padding: 10px 12px;
  border: 2px solid var(--black); border-radius: var(--radius);
}
.search input:focus, .field input:focus { outline: 3px solid var(--blue); outline-offset: 0; }
/* Focus vizibil la navigarea cu tastatura */
a:focus-visible, button:focus-visible, .check input:focus-visible, .results li:focus-visible {
  outline: 3px solid var(--black); outline-offset: 2px; box-shadow: 0 0 0 6px var(--blue);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  padding: 10px 16px; cursor: pointer;
  border: 2px solid var(--black); border-radius: var(--radius);
  background: var(--blue); color: var(--black);
  transition: background-color .15s, color .15s;
}
.btn:hover { background: var(--white); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-block { width: 100%; }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--white); color: var(--black); }
.btn-accent { background: var(--coral); color: var(--white); }
.btn-accent:hover { background: var(--white); color: var(--black); }

.msg { min-height: 1.2em; margin: 8px 0 0; font-size: 14px; color: var(--coral-dark); }

.filters { border: 2px solid var(--black); border-radius: var(--radius); margin: 12px 0 16px; padding: 10px 14px 12px; }
.filters legend { font-weight: 700; text-transform: uppercase; font-size: 13px; padding: 0 6px; }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--black); margin: 0; flex: none; }
.check em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 14px; }

/* Starea e arătată prin culoare ȘI simbol (✓ ! ✕ ?), pentru cei care nu disting culorile */
.dot, .pin {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; border: 2px solid var(--white);
  font-family: Arial, "Segoe UI Symbol", "DejaVu Sans", sans-serif; font-weight: 700; line-height: 1;
  color: var(--white);
}
.dot { width: 18px; height: 18px; font-size: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.s0 { background: var(--s0); }
.s1 { background: var(--s1); color: var(--black); }
.s2 { background: var(--s2); }
.s3 { background: var(--s3); }
.dot.s0::after, .pin.s0::after { content: "\2713"; }
.dot.s1::after, .pin.s1::after { content: "!"; }
.dot.s2::after, .pin.s2::after { content: "\2715"; }
.dot.s3::after, .pin.s3::after { content: "?"; }
.check-minor { font-size: 14px; color: var(--muted); }

.results h2, .info h2 { font-size: 18px; font-weight: 800; line-height: 1.2; margin: 0 0 10px; }
.results { margin-bottom: 18px; }
.results ol { list-style: none; margin: 0; padding: 0; }
.results li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.results li:hover .r-addr { text-decoration: underline; }
.results li .dot { margin-top: 1px; }
.r-city { font-weight: 700; font-size: 14px; }
.r-addr { font-size: 14px; color: var(--ink); }
.r-dist { margin-left: auto; white-space: nowrap; font-weight: 700; font-size: 14px; }

.info {
  background: var(--blue);
  border: 2px solid var(--black); border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.info h2 { font-size: 20px; }
.info p { margin: 0; }
.steps { margin: 0 0 10px; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.small { font-size: 14px; }
.source { font-size: 12px; color: var(--muted); }
.source a { color: var(--muted); }

/* ---------- Hartă ---------- */
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; }
.loading {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--blue-soft); font-weight: 600;
  padding: 24px; text-align: center;
}
.loading.hidden { display: none; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--blue); border-top-color: var(--black); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.legend {
  position: absolute; left: 12px; bottom: 24px; z-index: 1;
  display: flex; gap: 12px; flex-wrap: wrap;
  background: var(--white); border: 2px solid var(--black); border-radius: var(--radius);
  padding: 6px 10px; font-size: 13px; font-weight: 600;
}
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.panel-open { display: none; }

/* Pini pe hartă */
.pin { width: 22px; height: 22px; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: pointer; }
.pin.hl { width: 30px; height: 30px; font-size: 16px; border: 3px solid var(--black); }
.pin { position: relative; }
.pin.mixed { box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.5); }
/* Câte adăposturi sunt în același punct */
.pin-n {
  position: absolute; top: -8px; right: -10px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--black); color: var(--white); border: 2px solid var(--white);
  font: 700 10px/13px Arial, sans-serif; text-align: center;
}
.pin-user {
  width: 18px; height: 18px; border-radius: 50%;
  background: #1a73e8; border: 3px solid var(--white);
  box-shadow: 0 0 0 6px rgba(26,115,232,.25), 0 1px 4px rgba(0,0,0,.5);
}
.cluster {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--black); color: var(--white);
  border: 3px solid var(--blue); font-weight: 700; font-size: 13px;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* Popup (InfoWindow) */
.gm-style .gm-style-iw-c { border-radius: var(--radius); padding: 0 !important; border: 2px solid var(--black); }
.gm-style .gm-style-iw-d { overflow: auto !important; padding: 0 !important; }
.gm-style .gm-style-iw-chr { position: absolute; right: 0; top: 0; }
.popup { font-family: "Barlow", system-ui, sans-serif; width: 290px; max-width: 100%; padding: 14px 16px 16px; font-size: 14px; color: var(--black); }
.popup h3 { font-size: 16px; font-weight: 800; margin: 0 28px 4px 0; }
.popup .p-addr { margin: 0 0 8px; color: var(--ink); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 700; color: var(--white); margin-right: 4px; }
.badge.s0 { background: var(--s0); }
.badge.s1 { background: var(--s1); color: var(--black); }
.badge.s2 { background: var(--s2); }
.badge.s3 { background: var(--s3); }
.badge.type { background: var(--blue); color: var(--black); border: 1px solid var(--black); }
.p-cap { margin: 8px 0 0; }
.p-nav { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.p-nav small { display: block; color: var(--muted); margin-bottom: 6px; }
.p-nav a { display: inline-block; padding: 4px 8px; margin: 0 4px 4px 0; border: 1px solid var(--black); border-radius: var(--radius); font-size: 12px; font-weight: 600; text-decoration: none; }
.p-nav a:hover { background: var(--blue); }
.p-cta { margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--black); }
.p-cta .btn { width: 100%; font-size: 14px; }
.btn-wrap { white-space: normal; text-transform: none; letter-spacing: 0; line-height: 1.25; font-size: 15px; padding: 10px 12px; }
.p-count { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--ink); }
.p-count strong { font-size: 15px; }
.p-back { background: none; border: 0; padding: 0; margin: 0 0 8px; font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; color: var(--black); }
.p-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--line); }
.p-list li { border-bottom: 1px solid var(--line); }
.p-list button {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  background: none; border: 0; padding: 9px 2px; text-align: left; font: inherit; cursor: pointer; color: var(--black);
}
.p-list button:hover .p-list-addr { text-decoration: underline; }
.p-list .dot { margin-top: 1px; }
.p-list-addr { display: block; font-weight: 600; }
.p-list-meta { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal-box {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--white); border: 2px solid var(--black); border-radius: var(--radius);
  padding: 24px; box-shadow: 8px 8px 0 var(--blue);
}
.modal-box h2 { font-size: 22px; font-weight: 800; line-height: 1.15; margin: 0 32px 6px 0; }
.modal-x { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; }
.modal-shelter { background: var(--blue-soft); border-left: 4px solid var(--black); padding: 8px 10px; font-size: 14px; margin: 8px 0 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.field input { width: 100%; font: inherit; padding: 9px 11px; border: 2px solid var(--black); border-radius: var(--radius); }
.field input.invalid { border-color: var(--coral-dark); }
.err { display: block; color: var(--coral-dark); font-size: 13px; min-height: 0; }
.consent { align-items: flex-start; font-size: 14px; }
.consent input { margin-top: 2px; }
.form-error { color: var(--coral-dark); font-weight: 600; min-height: 1.2em; margin: 10px 0; }
.hp { position: absolute; left: -9999px; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .panel {
    position: fixed; inset: 0 auto 0 0; width: min(100%, 420px);
    transform: translateX(-105%); transition: transform .25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.2); z-index: 20;
  }
  .panel.open { transform: none; }
  .panel-close { display: block; }
  .panel-open { display: inline-flex; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
  .legend { bottom: 28px; font-size: 12px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .modal-box { padding: 20px 16px; }
}
