/* ===== Moj Logatec · Pobude ===== */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/instrument-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/instrument-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --navy: #0057BD; --navy-deep: #062D66; --navy-soft: #E6EFFA;
  --sun: #8FDC00; --sun-light: #B8EC5A;
  --text: #062D66; --muted: rgba(6,45,102,.6); --line: rgba(6,45,102,.12);
  --danger: #c2410c; --radius: 1rem; --shadow: 0 10px 30px rgba(6,45,102,.10);
  --topbar-h: 68px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Instrument Sans', system-ui, sans-serif; color: var(--text); background: #F5F8FC; line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--navy); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.muted { color: var(--muted); }
.hl { background: linear-gradient(transparent 62%, var(--sun) 62%, var(--sun) 92%, transparent 92%); }
.hidden { display: none !important; }

/* ---- top bar ---- */
.topbar { background: var(--navy-deep); color: #fff; position: sticky; top: 0; z-index: 1000; }
.topbar-inner { max-width: 1400px; margin: 0 auto; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.25rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; }
.brand img { height: 40px; width: auto; }
.brand-tag { font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; background: var(--sun); color: var(--navy-deep); padding: .15rem .55rem; border-radius: 999px; }
.nav { display: flex; align-items: center; gap: 1.25rem; font-weight: 600; font-size: .95rem; }
.nav a { color: #fff; text-decoration: none; opacity: .85; }
.nav a:hover, .nav a.active { opacity: 1; text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav a.btn { opacity: 1; text-decoration: none; }
@media (max-width: 640px) {
  .brand img { height: 30px; } .brand-tag { display: none; }
  .nav { gap: .8rem; font-size: .88rem; } .nav .btn { padding: .5rem .8rem; }
}

/* ---- buttons / fields ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 999px; padding: .7rem 1.25rem; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; } .btn-primary:hover { background: #004aa3; }
.btn-sun { background: var(--sun); color: var(--navy-deep); } .btn-sun:hover { background: var(--sun-light); }
.btn-ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); } .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem .9rem; font-size: .9rem; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
.polje { display: block; width: 100%; border-radius: var(--radius); border: 1px solid rgba(6,45,102,.15); background: #fff; padding: .85rem 1.05rem; font: inherit; font-size: 1.02rem; color: var(--navy-deep); transition: border-color .2s, box-shadow .2s; }
.polje::placeholder { color: rgba(6,45,102,.45); }
.polje:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,87,189,.18); }
.polje.invalid { border-color: var(--danger); }
textarea.polje { min-height: 140px; resize: vertical; }
select.polje { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230057BD' d='M0 0h12L6 8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1.05rem center; padding-right: 2.6rem; }
.counter { font-size: .8rem; color: var(--muted); text-align: right; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; }
.check input { margin-top: .2rem; width: 1.15rem; height: 1.15rem; accent-color: var(--navy); flex-shrink: 0; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- layout ---- */
.main { flex: 1; }
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.card { background: #fff; border-radius: 1.5rem; box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2.25rem); }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.footer { background: var(--navy-deep); color: rgba(255,255,255,.75); font-size: .88rem; }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 1.1rem 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer a { color: #fff; } .footer .muted { color: rgba(255,255,255,.5); margin-left: auto; }

/* pins */
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin-new { background: var(--sun); width: 32px; height: 32px; }
/* ---- submit page: full-screen map behind, floating cards ---- */
.map-stage { position: relative; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); overflow: hidden; }
#pickMap { position: absolute; inset: 0; z-index: 0; background: #e9eef5; }
.map-overlay { position: absolute; inset: 0; z-index: 500; pointer-events: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem; }
.map-overlay > .card { pointer-events: auto; box-shadow: 0 12px 40px rgba(6,45,102,.22); }
.map-card { width: clamp(320px, 27vw, 410px); display: grid; gap: .9rem; padding: 1.25rem; }
.form-card { width: clamp(380px, 34vw, 520px); max-height: 100%; overflow-y: auto; display: grid; gap: 1.1rem; padding: 1.5rem; overscroll-behavior: contain; }
.form-h1 { font-size: clamp(1.4rem, 2vw, 1.85rem); margin-bottom: .35rem; }
.lead { margin: 0; font-size: .95rem; }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
body.page-map .footer { display: none; }
@media (max-width: 900px) {
  .map-stage { height: auto; overflow: visible; }
  #pickMap { position: relative; height: 55vh; height: 55dvh; min-height: 340px; }
  .map-overlay { position: static; display: grid; padding: 1rem; pointer-events: auto; }
  .map-card, .form-card { width: auto; max-height: none; overflow: visible; }
  body.page-map .footer { display: block; }
}
.step-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: .5rem; flex-wrap: wrap; }
.combo { position: relative; }
/* list spans the whole street + number row (wider on phones) */
.addr-row .combo { position: static; }
.combo-field { position: relative; }
.combo-input { padding-right: 2.6rem; }
.combo-toggle { position: absolute; top: 0; right: 0; bottom: 0; width: 2.6rem; border: 0; background: transparent; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230057BD' d='M0 0h12L6 8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; transition: transform .15s; }
.combo.open .combo-toggle { transform: rotate(180deg); }
.combo-list { position: absolute; z-index: 1500; left: 0; right: 0; top: calc(100% + .35rem); max-height: 300px; overflow-y: auto; margin: 0; padding: .35rem;
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.combo-list li { padding: .55rem .75rem; border-radius: .6rem; cursor: pointer; display: flex; justify-content: space-between; gap: .75rem; }
.combo-list li small { color: var(--muted); white-space: nowrap; }
.combo-list li.active, .combo-list li:hover { background: var(--navy-soft); }
.combo-list li.selected { font-weight: 700; }
.combo-list li.empty { color: var(--muted); cursor: default; background: none; }
.auto-hint { font-weight: 600; font-size: .8rem; color: #3f7d00; margin-left: .35rem; }
select.polje.auto { border-color: rgba(77,154,0,.55); background-color: #f6fbef; }
.addr-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem; align-items: end; margin-top: -.45rem; gap: .75rem; }
.pick-status.bad { color: var(--danger); font-weight: 600; }
.pick-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.pick-status { font-size: .92rem; color: var(--muted); } .pick-status.ok { color: #3f7d00; font-weight: 600; }
.drop { position: relative; border: 2px dashed rgba(6,45,102,.2); border-radius: var(--radius); padding: 1.25rem; text-align: center; color: var(--muted); background: #fff; transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--navy); background: var(--navy-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-preview { display: flex; gap: 1rem; align-items: center; justify-content: center; }
.drop-preview img { max-height: 120px; max-width: 100%; min-width: 0; height: auto; object-fit: contain; border-radius: .6rem; }
.drop, .drop-preview { min-width: 0; max-width: 100%; overflow: hidden; }
.form-card > *, .map-card > *, .field > * { min-width: 0; }
.form-error { background: #fff4ed; color: var(--danger); border-radius: var(--radius); padding: .8rem 1rem; font-weight: 600; }
.notice { background: var(--navy-soft); border-radius: var(--radius); padding: .8rem 1rem; font-size: .9rem; }

/* ---- dialog ---- */
.dlg-backdrop { position: fixed; inset: 0; background: rgba(6,45,102,.45); display: grid; place-items: center; z-index: 5000; padding: 1rem; animation: dlgFade .15s ease-out; }
.dlg { background: #fff; border-radius: 1.25rem; box-shadow: 0 20px 60px rgba(6,45,102,.3); max-width: 440px; width: 100%; padding: 1.5rem; }
.dlg h3 { margin: 0 0 .5rem; } .dlg p { margin: 0 0 1.25rem; white-space: pre-wrap; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; }
@keyframes dlgFade { from { opacity: 0; } }

/* ---- overflow guards ---- */
.grid-2 > *, .map-overlay > * { min-width: 0; }
select.polje { text-overflow: ellipsis; }
@media (max-width: 640px) { .topbar-inner { padding: 0 .9rem; } }
