/* eVeriga – demo portal podpisanih dogodkov o vozilih */
:root {
  --ink: #1b2430;
  --ink-2: #3a4553;
  --muted: #5e6875;
  --paper: #f3f5f4;
  --panel: #ffffff;
  --rule: #d6dae0;
  --rule-soft: #e7eaee;
  --plate: #1f4fa3;
  --plate-ink: #10151c;
  --green: #2e7d4f;
  --green-bg: #e6f2eb;
  --amber: #a86a12;
  --amber-bg: #fbf1df;
  --red: #b23a3a;
  --red-bg: #f8e6e6;
  --blue-bg: #e7eef9;
  --radius: 6px;
  --font: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); line-height: 1.5; }
a { color: var(--plate); }
a:hover { color: #163b7c; }
:focus-visible { outline: 3px solid #7fa3e0; outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; margin-top: 1.2em; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.dim { color: var(--muted); }
.small { font-size: .86rem; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.nowrap a + a { margin-left: .7em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Glava */
.topbar { background: var(--panel); border-bottom: 1px solid var(--rule); }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; display: flex; flex-direction: column; line-height: 1.1; }
.brand-name small { font-weight: 400; font-size: .74rem; color: var(--muted); letter-spacing: 0; }
.brand-mark { display: inline-flex; align-items: center; }
.brand-mark i { display: block; width: 14px; height: 18px; border: 2.5px solid var(--plate); border-radius: 4px; }
.brand-mark i + i { margin-left: -5px; }
.brand-mark i:nth-child(2) { border-color: var(--ink-2); transform: translateY(3px); }
.sim-flag { background: var(--amber-bg); color: var(--amber); border: 1px solid #ecd3a6; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.mainnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.mainnav a { text-decoration: none; color: var(--ink-2); padding: 6px 10px; border-radius: var(--radius); font-weight: 500; }
.mainnav a:hover { background: var(--rule-soft); color: var(--ink); }
.who { display: flex; flex-direction: column; align-items: flex-end; font-size: .84rem; line-height: 1.25; padding-left: 14px; border-left: 1px solid var(--rule); }
.who span { color: var(--muted); }
.who a { font-size: .8rem; }

main.wrap { padding-top: 28px; padding-bottom: 40px; }
.foot { color: var(--muted); font-size: .8rem; padding-bottom: 30px; }

.page-title { margin-bottom: 18px; }
.page-title p { margin: 0; }

/* Paneli */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.panel.narrow, .narrow { max-width: 720px; }
.panel.attention { border-left: 4px solid var(--amber); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two-col > .panel { margin-bottom: 0; }
.two-col + * { margin-top: 18px; }
.empty { color: var(--muted); padding: 10px 0; margin: 0; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: var(--green-bg); border-color: #b9dbc6; color: #1e5a37; }
.flash.bad { background: var(--red-bg); border-color: #e7bcbc; color: #7d2323; }
.flash.warn { background: var(--amber-bg); border-color: #ecd3a6; color: #6f470c; }
.flash.info { background: var(--blue-bg); border-color: #c4d4ee; }
.warn { background: var(--amber-bg); color: #6f470c; padding: 10px 14px; border-radius: var(--radius); }

/* Gumbi */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .92rem;
  padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
  text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #aeb6c1; color: var(--ink); }
.btn.primary { background: var(--plate); border-color: var(--plate); color: #fff; }
.btn.primary:hover { background: #193f82; }
.btn.danger { background: var(--panel); border-color: #e0a8a8; color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: .84rem; }
.btn.wide { width: 100%; margin-top: 10px; }
form.inline { display: inline; }

.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--plate); }
.badge.muted { background: var(--rule-soft); color: var(--muted); }

/* VIN */
.vin { font-family: var(--mono); font-size: .86em; letter-spacing: .06em; background: #eef1f4; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }

/* Tabele */
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.list td { padding: 9px 8px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.list tr:last-child td { border-bottom: 0; }
.list.compact td { padding: 5px 8px; }
.panel .list { margin-top: 6px; }
.panel { overflow-x: auto; }

/* Obrazci */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 12px; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input:not([type]), input[type=date], input[type=password], textarea, select {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; font-size: .95rem; padding: 8px 10px;
  border: 1px solid #bfc6cf; border-radius: var(--radius); background: #fff; color: var(--ink); }
select { width: auto; display: inline-block; margin: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--plate); outline: 2px solid #c9d8f2; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 650; font-size: 1.02rem; margin-bottom: 10px; padding: 0; }
.form fieldset + fieldset { border-top: 1px solid var(--rule-soft); padding-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; margin: 0; }
.radio-row { display: flex; gap: 20px; margin-bottom: 12px; }
.radio-row label, .stranka label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
.fill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.big { font-size: 1.1rem; }

.vin-form .row { display: flex; gap: 10px; }
.vin-form .row input { margin: 0; }
.vin-input { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; font-size: 1.05rem !important; }
.demo-hint { margin-top: 14px; font-size: .9rem; }
.demo-hint summary { cursor: pointer; color: var(--muted); }
.chips { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.chips a { font-family: var(--mono); letter-spacing: .05em; }

/* Rezultat preverjanja */
.result { border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; border: 1px solid; }
.result.good { background: var(--panel); border-color: #b9dbc6; border-left: 5px solid var(--green); }
.result.bad { background: var(--red-bg); border-color: #e7bcbc; border-left: 5px solid var(--red); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 24px; margin: 12px 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.doc-facts { grid-template-columns: 1fr 1fr; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.choice { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; background: #fbfcfd; }
.choice:hover { border-color: var(--plate); background: #fff; color: var(--ink); }
.choice strong { display: block; color: var(--plate); }
.choice span { font-size: .88rem; color: var(--ink-2); }

/* Prijava */
.login { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: start; padding-top: 20px; }
.login-intro h1 { font-size: 2.3rem; line-height: 1.12; max-width: 14em; margin-bottom: .6em; }
.login-intro p { max-width: 36em; font-size: 1.02rem; }
.sipass, .sipass-sign { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 20px 18px; }
.sipass-head { display: flex; align-items: center; gap: 12px; margin: 0 -20px 16px; padding: 12px 20px; background: #2d3b4e; color: #fff; border-radius: var(--radius) var(--radius) 0 0; font-size: .9rem; }
.sipass-logo { font-weight: 800; letter-spacing: .04em; background: #fff; color: #2d3b4e; padding: 2px 8px; border-radius: 3px; font-size: .85rem; }
.sipass h2 { font-size: .9rem; color: var(--muted); font-weight: 600; margin: 14px 0 8px; }
.persona-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.persona button { width: 100%; text-align: left; font: inherit; background: #fbfcfd; border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; }
.persona button:hover { border-color: var(--plate); background: #fff; }
.persona strong { font-size: .98rem; }
.persona span { font-size: .84rem; color: var(--ink-2); }
.persona small { font-size: .78rem; color: var(--muted); }

/* Podpis */
.sign-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.hashline { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.hashline code { color: var(--ink); overflow-wrap: anywhere; font-size: .82rem; }
.certs { display: grid; gap: 8px; }
.cert { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; margin: 0; font-weight: 400; cursor: pointer; }
.cert:has(input:checked) { border-color: var(--plate); background: #f5f8fd; }
.cert input { margin-top: 4px; }
.cert-body { display: flex; flex-direction: column; font-size: .88rem; }
.cert-body strong { font-size: .95rem; }
.cert-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cert-tags em { font-style: normal; font-size: .74rem; background: var(--rule-soft); padding: 1px 6px; border-radius: 3px; color: var(--ink-2); }
.cert-tags em.q { background: var(--green-bg); color: var(--green); }
.cert-tags em.nq { background: var(--amber-bg); color: var(--amber); }
.sipass-sign { padding-bottom: 18px; }
.demo-code { background: var(--amber-bg); padding: 8px 12px; border-radius: var(--radius); font-size: .9rem; }
.demo-code strong { font-family: var(--mono); font-size: 1.1rem; letter-spacing: .15em; }

/* Podpisni bloki */
.sigs { display: grid; gap: 10px; }
.sig { border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 14px; font-size: .88rem; }
.sig.ok { border-left: 4px solid var(--green); }
.sig.bad { border-left: 4px solid var(--red); background: #fdf6f6; }
.sig.none { border-style: dashed; color: var(--muted); }
.sig-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; margin-bottom: 4px; }
.sig.ok .sig-state { color: var(--green); }
.sig.bad .sig-state { color: var(--red); }
.sig dl { margin: 0; display: grid; gap: 3px; }
.sig dl div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.sig dt { color: var(--muted); }
.sig dd { margin: 0; overflow-wrap: anywhere; }
.actions-panel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Šalter */
.salter-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 16px; align-items: end; }
.salter-form label, .salter-form fieldset { margin: 0; }
.stranka { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.stranka legend { font-size: .88rem; font-weight: 600; margin-bottom: 4px; }
.stranka input[name=stranka_id] { flex: 1 0 100%; margin: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.verdict { display: grid; grid-template-columns: 76px 1fr; border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; border: 1px solid; }
.verdict-light { display: flex; align-items: flex-start; justify-content: center; padding-top: 22px; }
.verdict-light::before { content: ""; width: 34px; height: 34px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 6px rgba(255,255,255,.35); }
.verdict-body { padding: 18px 22px 18px 0; }
.verdict-body h2 { font-size: 1.45rem; margin-bottom: .35em; }
.verdict-body p { margin-bottom: .3em; }
.verdict-actions { margin-top: 12px; }
.verdict.zeleno { background: var(--green-bg); border-color: #b9dbc6; }
.verdict.zeleno .verdict-light { color: var(--green); background: #d3e8dc; }
.verdict.zeleno h2 { color: #1e5a37; }
.verdict.rumeno { background: var(--amber-bg); border-color: #ecd3a6; }
.verdict.rumeno .verdict-light { color: #d59a2a; background: #f5e3c2; }
.verdict.rumeno h2 { color: #6f470c; }
.verdict.rdece { background: var(--red-bg); border-color: #e7bcbc; }
.verdict.rdece .verdict-light { color: var(--red); background: #f0d2d2; }
.verdict.rdece h2 { color: #7d2323; }
@media (prefers-reduced-motion: no-preference) {
  .verdict { animation: verdict-in .35s ease-out; }
  @keyframes verdict-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}

/* Veriga imetništva: tablice */
.chain { list-style: none; padding: 4px 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px 0; align-items: flex-start; }
.chain li { display: flex; flex-direction: column; gap: 6px; position: relative; padding-right: 46px; }
.chain li:not(:last-child)::after { content: ""; position: absolute; right: 8px; top: 20px; width: 30px; border-top: 2px solid var(--ink-2); }
.chain li:not(:last-child)::before { content: ""; position: absolute; right: 7px; top: 15px; border: 6px solid transparent; border-left: 8px solid var(--ink-2); border-right: 0; }
.chain li.pending::after, .chain li:has(+ li.pending)::after { border-top-style: dashed; }
.plate { display: inline-flex; align-items: stretch; height: 42px; border: 2px solid var(--plate-ink); border-radius: 5px; background: #fff; overflow: hidden; }
.plate .eu { width: 16px; background: var(--plate); }
.plate-txt { display: flex; align-items: center; padding: 0 12px; font-weight: 700; font-size: .95rem; letter-spacing: .02em; white-space: nowrap; font-stretch: condensed; }
.chain-src { font-size: .78rem; color: var(--muted); max-width: 200px; }
.chain li.pending .plate { border-style: dashed; opacity: .75; }
.chain li.is-stranka .plate { box-shadow: 0 0 0 3px #f2c14e; }

.src { font-size: .74rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.src.mrvl { background: var(--rule-soft); color: var(--ink-2); }
.src.portal { background: var(--blue-bg); color: var(--plate); }
.mrvl-row td { color: var(--ink-2); }

.steps { padding-left: 1.3em; margin: 0; display: grid; gap: 10px; max-width: 80ch; }
.steps li { padding-left: 4px; }

/* Izpisi (PDF) */
.print-doc { background: #e9ecef; }
.print-doc main.wrap { max-width: 880px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.doc { background: #fff; padding: 36px 44px; border: 1px solid var(--rule); font-size: .92rem; }
.doc h2 { margin-top: 1.4em; font-size: 1.05rem; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.doc-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 16px; }
.doc-head h1 { font-size: 1.35rem; margin: 0; }
.doc-head p { margin: 0; color: var(--muted); }
.doc-status { margin-left: auto; font-weight: 700; font-size: .85rem; padding: 6px 12px; border-radius: 4px; max-width: 16em; text-align: right; }
.doc-status.ok { background: var(--green-bg); color: var(--green); }
.doc-status.bad { background: var(--red-bg); color: var(--red); }
.doc-status.warn { background: var(--amber-bg); color: var(--amber); }
.doc-event { border-top: 1px solid var(--rule-soft); padding-top: 10px; margin-top: 14px; break-inside: avoid; }
.doc-foot { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 12px; }
.doc-foot p { margin-bottom: .4em; overflow-wrap: anywhere; }
.seal { display: flex; gap: 16px; align-items: flex-start; }
.seal-mark { flex: none; width: 74px; height: 74px; border-radius: 50%; border: 3px double var(--plate); color: var(--plate); display: flex; align-items: center; justify-content: center; font-weight: 800; transform: rotate(-12deg); }

@media print {
  @page { margin: 16mm 14mm; }
  body, .print-doc { background: #fff; }
  .no-print, .foot { display: none !important; }
  .print-doc main.wrap { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; font-size: 10pt; }
  .sig, .doc-status, .badge, .vin { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Ozki zasloni */
@media (max-width: 860px) {
  .two-col, .sign-layout, .login, .salter-form, .grid2, .doc-facts { grid-template-columns: 1fr; }
  .persona-list { grid-template-columns: 1fr; }
  .who { align-items: flex-start; border-left: 0; padding-left: 0; }
  .mainnav { margin-left: 0; }
  .login-intro h1 { font-size: 1.8rem; }
  .doc { padding: 20px; }
  .verdict { grid-template-columns: 56px 1fr; }
}
