:root {
  --red: #b5121b;
  --red-dark: #8c0d14;
  --ink: #1f1b1a;
  --ink-soft: #5b5552;
  --line: #e4ddd8;
  --bg: #f6f3f0;
  --card: #ffffff;
  --amber: #f2a900;
  --ok: #1e7a3d;
  --info: #1d4f8c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 27, 26, .06), 0 2px 8px rgba(31, 27, 26, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-dark); }
a:hover { color: var(--red); }
h1, h2 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: .2em 0 .5em; }
h2 { font-size: 1.25rem; margin: 1.2em 0 .5em; }
code { background: #f0e9e4; padding: .1em .35em; border-radius: 4px; font-size: .9em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: #fff; padding: 8px 12px; }
.inline { display: inline; }

/* antet */
.site-header { background: var(--ink); color: #fff; border-bottom: 4px solid var(--red); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.brand strong { display: block; font-size: 1.1rem; line-height: 1.2; }
.brand small { display: block; color: #cfc6c1; font-size: .85rem; }
.nav-toggle { display: none; background: transparent; color: #fff; border: 1px solid #6b625e; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
.site-nav { background: #2b2524; }
.nav-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.site-nav a, .site-nav .linklike { color: #f0e9e4; text-decoration: none; padding: 12px 14px; display: inline-block; font: inherit; }
.site-nav a:hover, .site-nav .linklike:hover { background: rgba(255,255,255,.07); color: #fff; }
.site-nav a.active { box-shadow: inset 0 -3px 0 var(--amber); color: #fff; }
.nav-spacer { flex: 1; }
.site-nav a.nav-alert { background: var(--red); color: #fff; font-weight: 700; border-radius: 6px; padding: 8px 16px; margin: 4px 6px; }
.site-nav a.nav-alert:hover { background: var(--red-dark); }
.admin-nav { background: #fbf8f6; border-bottom: 1px solid var(--line); }
.admin-nav a { color: var(--ink); text-decoration: none; padding: 10px 12px; font-size: .95rem; }
.admin-nav a.active { box-shadow: inset 0 -3px 0 var(--red); font-weight: 600; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav .nav-inner { flex-direction: column; align-items: stretch; padding: 4px 0 10px; }
  .site-nav a, .site-nav .linklike { width: 100%; text-align: left; }
  .site-nav a.nav-alert { margin: 6px 0; text-align: center; }
  .nav-spacer { display: none; }
  .admin-nav .nav-inner { flex-wrap: nowrap; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
}

/* elemente */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.narrow { max-width: 460px; margin: 24px auto; }
.narrow-form { max-width: 560px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #c9beb7; color: var(--ink); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); color: #fff; }
.btn-outline-danger { color: var(--red); border-color: #e7b8bb; background: #fff; }
.btn-big { padding: 16px 24px; font-size: 1.15rem; width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--red-dark); cursor: pointer; text-decoration: underline; }
.linklike.danger { color: var(--red); }
.badge { display: inline-block; background: #f0e9e4; color: var(--ink-soft); border-radius: 999px; padding: 1px 10px; font-size: .85rem; font-weight: 600; }
.badge-warn { background: #fdf0d0; color: #7a5200; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border-left: 4px solid; background: #fff; }
.flash-success { border-color: var(--ok); background: #eef8f1; }
.flash-error { border-color: var(--red); background: #fdeeee; }
.flash-info { border-color: var(--info); background: #edf3fb; }

/* formulare */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form label.check, .filters label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input[type=text], input:not([type]), input[type=search], input[type=password], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfc5bf; border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(181, 18, 27, .35); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--red); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr 2fr 1fr; }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 8px; }
.filters label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.filters select, .filters input[type=search] { min-width: 200px; }

/* tabele */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #fbf8f6; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { color: #9b938f; }
.table .clip { max-width: 280px; }
.table .actions { white-space: nowrap; display: flex; gap: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* acasa */
.hero { background: linear-gradient(135deg, var(--red-dark), var(--red)); color: #fff; border-radius: var(--radius); padding: clamp(24px, 5vw, 44px); margin-bottom: 24px; }
.hero h1 { margin-top: 0; }
.hero .lead { font-size: 1.1rem; color: #ffe3e0; margin: 0 0 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-primary { background: #fff; color: var(--red-dark); border-color: #fff; }
.hero .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.prose { max-width: 78ch; font-size: 1.05rem; }
.prose p { margin: 0 0 1em; }
.prose h2:first-child { margin-top: 0; }

/* echipa */
.team-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.team-card { display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px 16px; }
.team-card strong { display: block; }
.team-card small { color: var(--ink-soft); }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: #f6dcdd; color: var(--red-dark); display: grid; place-items: center; font-weight: 700; }

/* galerie si poze */
.photo-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.photo-grid a, .photo-row a { display: block; border-radius: 8px; overflow: hidden; background: #e9e2dd; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .2s; }
.photo-grid a:hover img { transform: scale(1.03); }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.photo-row img { width: 140px; height: 105px; object-fit: cover; }
.admin-photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 12px 0 16px; }
.admin-photos figure { margin: 0; display: grid; gap: 6px; }
.admin-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }

.lightbox { position: fixed; inset: 0; background: rgba(15, 12, 11, .92); display: grid; place-items: center; z-index: 50; padding: 16px; }
.lightbox img { max-height: 88vh; max-width: 100%; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; font-size: 1.6rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; }
.lightbox .lb-next { right: 16px; top: 50%; }

/* hidranti */
.search-box input { font-size: 1.15rem; padding: 14px 16px; }
.street-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.street-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.street-list a:hover { border-color: var(--red); color: var(--red-dark); }
.street-list small { color: var(--ink-soft); font-weight: 400; }
.hydrant-list { display: grid; gap: 16px; }
.hydrant { margin: 0; }
.hydrant header { display: flex; align-items: center; gap: 10px; }
.hydrant h2 { margin: 0; font-size: 1.2rem; color: var(--red-dark); }
.hydrant p { margin: 10px 0 0; }
.note { background: #fff7e3; border-radius: 6px; padding: 8px 12px; }

/* alerta */
.alert-page { max-width: 620px; margin: 0 auto; }
.alert-types { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.alert-types legend { font-weight: 600; margin-bottom: 8px; }
.choice { position: relative; display: block !important; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; text-align: center; padding: 16px 10px; border: 2px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 1.05rem; cursor: pointer; background: #fff; }
.choice input:checked + span { border-color: var(--red); background: #fdeeee; color: var(--red-dark); }
.choice input:focus-visible + span { outline: 3px solid rgba(181, 18, 27, .35); }
.confirm { border: 2px solid var(--red); }
.sms-preview { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f6f3f0; padding: 12px 14px; border-radius: 8px; font-size: 1.05rem; }
.confirm-actions { display: grid; gap: 10px; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain-list small { display: block; }

/* admin */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 8px; }
.stat { text-decoration: none; color: var(--ink); margin: 0; }
.stat strong { display: block; font-size: 2rem; color: var(--red-dark); }
.stat:hover { border-color: var(--red); color: var(--ink); }

/* subsol */
.site-footer { background: var(--ink); color: #cfc6c1; padding: 24px 0; font-size: .95rem; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-inner p { margin: 0; }
.emergency strong { color: #fff; font-size: 1.1rem; }

/* ajustari */
.form > .btn:not(.btn-big) { justify-self: start; }
.card > h2:first-child { margin-top: 0; }
@media (max-width: 760px) {
  .brand small { display: none; }
  .brand img { width: 44px; height: 44px; }
  .brand strong { font-size: 1rem; }
}

/* mod test / real */
.flash-test { border-color: var(--amber); background: #fff6dc; }
.mode-card { border-width: 2px; }
.mode-card.is-test { border-color: var(--amber); background: #fffaf0; }
.mode-card.is-real { border-color: var(--ok); background: #f3faf5; }
.mode-label { margin: 0; color: var(--ink-soft); }
.mode-value { margin: 0 0 8px; font-size: 1.8rem; font-weight: 800; letter-spacing: .02em; }
.is-test .mode-value { color: #8a5d00; }
.is-real .mode-value { color: var(--ok); }

/* buton de alerta in antet, doar pe telefon */
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.header-alert { display: none; }
@media (max-width: 760px) {
  .header-alert {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--red); color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .04em;
    font-size: 1.05rem; padding: 0 18px; min-height: 48px; border-radius: 10px;
    border: 2px solid #ff5a62; box-shadow: 0 2px 10px rgba(181, 18, 27, .45);
  }
  .header-alert:hover, .header-alert:focus { color: #fff; background: var(--red-dark); }
  .header-alert.active { background: var(--red-dark); }
  .nav-toggle { min-height: 48px; }
  .brand strong { font-size: .95rem; }
  .site-nav a.nav-alert { display: none; }
}
@media (max-width: 360px) {
  .brand span { display: none; }
}

/* instalare aplicatie */
.install-app, .install-ios { width: 100%; }
.btn-install { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-install:hover { color: #fff; border-color: #fff; }
[hidden] { display: none !important; }

/* harti */
.map-wrap { position: relative; }
.map { width: 100%; height: 70vh; min-height: 380px; border-radius: var(--radius); border: 1px solid var(--line); background: #e9e2dd; z-index: 0; }
.map-small { height: 360px; min-height: 260px; margin: 10px 0; }
.map-locate { position: absolute; z-index: 500; right: 12px; bottom: 24px; box-shadow: var(--shadow); font-size: 1rem; }
.map-note { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
.map-wrap .map-note { position: absolute; z-index: 500; left: 12px; bottom: 24px; background: rgba(255,255,255,.92); padding: 4px 8px; border-radius: 6px; margin: 0; }
.small { font-size: .88rem; }
.map-popup { font: 14px/1.4 system-ui, sans-serif; }
.mp-title { display: block; font-size: 1.05rem; color: var(--red-dark); }
.mp-addr { color: var(--ink-soft); margin-bottom: 4px; }
.mp-aprox { display: inline-block; background: #fdf0d0; color: #7a5200; border-radius: 4px; padding: 0 6px; font-size: .8rem; margin-bottom: 4px; }
.mp-img { width: 100%; height: auto; border-radius: 6px; margin: 4px 0; }
.mp-text { white-space: pre-line; }
.mp-obs { background: #fff7e3; border-radius: 4px; padding: 2px 6px; margin-top: 4px; white-space: pre-line; }
.mp-links { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.mp-btn { background: var(--red); color: #fff !important; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-weight: 700; }
.geo-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.geo-box legend { font-weight: 700; padding: 0 6px; }
.geo-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hyd-pin { background: var(--red); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 6px rgba(0,0,0,.45); }
.geo-run { margin-top: 14px; }
.geo-log { list-style: none; padding: 0; margin: 8px 0; max-height: 220px; overflow: auto; font-size: .9rem; }
.geo-log li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.geo-log .ok { color: var(--ok); }
.geo-log .warn { color: #8a5d00; }
.geo-log .err { color: var(--red); }
.leaflet-container a.mp-btn { color: #fff; }
.hyd-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px !important; }
.hyd-links .btn { padding: 6px 14px; }
.map-note:empty { display: none; }
