/* Design tokens */
:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --ink: #12222b;
  --ink-soft: #46606d;
  --line: #d8e2e8;
  --accent: #0b6e7f;
  --accent-ink: #ffffff;
  --accent-soft: #e2f3f6;
  --warn: #8a5a00;
  --radius: 16px;
  --radius-sm: 10px;
  --space: 1rem;
  --shadow: 0 1px 2px rgba(18, 34, 43, .06), 0 8px 24px rgba(18, 34, 43, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid #0a3d49; outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: .6rem; min-height: 60px; }
.logo { font-weight: 800; letter-spacing: -.01em; font-size: 1.25rem; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.logo svg { width: 28px; height: 28px; }

/* Hero + form */
.hero { padding: 2rem 0 1rem; }
.hero-grid { display: grid; gap: 1.75rem; }
.eyebrow { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; margin-bottom: .9rem; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3.1rem); letter-spacing: -.02em; }
.lead { color: var(--ink-soft); font-size: 1.15rem; max-width: 34em; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 1.4rem; }
.form-card h2 { font-size: 1.2rem; }

.field { margin-bottom: 1.1rem; }
label, .label { display: block; font-weight: 650; margin-bottom: .35rem; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: .95rem; }
input[type="text"], input[type="number"], select {
  width: 100%; min-height: 48px; padding: .6rem .85rem;
  font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid #8ca3af; border-radius: var(--radius-sm);
}
input:hover, select:hover { border-color: var(--accent); }
.row { display: grid; gap: 1rem; }

input[type="range"] { width: 100%; min-height: 48px; accent-color: var(--accent); }
.range-ends { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: .9rem; margin-top: -.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; width: 100%; padding: .7rem 1.5rem;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.btn:hover { background: #09596a; }

.error { color: #a31212; font-weight: 600; margin: .35rem 0 0; min-height: 1.3em; }

/* Results */
.results { padding: 1.5rem 0 1rem; }
.results[hidden] { display: none; }
.results-head p { color: var(--ink-soft); }
.tiers { display: grid; gap: 1rem; margin-top: 1rem; }
.tier { padding: 1.35rem; position: relative; display: flex; flex-direction: column; }
.tier.is-pick { border: 2px solid var(--accent); background: linear-gradient(180deg, var(--accent-soft), #fff 40%); }
.badge { position: absolute; top: -.8rem; left: 1.2rem; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; padding: .2rem .8rem; border-radius: 999px; }
.tier h3 { font-size: 1.3rem; margin-bottom: .1rem; }
.tier .tag { color: var(--ink-soft); margin-bottom: 1rem; }
.big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--accent); }
.big small { font-size: 1rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.big-label { color: var(--ink-soft); font-size: .92rem; margin: .25rem 0 1rem; }
.stats { margin: 0 0 1rem; padding: 0; }
.stats div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.stats dt { color: var(--ink-soft); }
.stats dd { margin: 0; font-weight: 650; text-align: right; }
.points { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }
.notice { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm); background: #fff6e0; color: var(--warn); font-size: .95rem; }

/* Content */
.content { padding: 1.5rem 0 3rem; }
.content-grid { display: grid; gap: 2rem; }
.content h2 { font-size: 1.5rem; margin-top: 1.5rem; }
.content h2:first-child { margin-top: 0; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .6rem; }
summary { cursor: pointer; padding: .9rem 1rem; min-height: 48px; font-weight: 650; }
details p { padding: 0 1rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1.5rem 0; color: var(--ink-soft); font-size: .92rem; }

/* Tablet */
@media (min-width: 640px) {
  .row { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 1.75rem; }
}

/* Desktop */
@media (min-width: 960px) {
  .hero { padding: 3.5rem 0 1.5rem; }
  .hero-grid { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 3rem; }
  .tiers { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
  .content-grid { max-width: 820px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, input, select { transition: background .15s, border-color .15s; }
}

/* Dimenzija: trije meniji v vrsti */
fieldset.dim-field { border: 0; margin: 0 0 1.1rem; padding: 0; min-width: 0; }
fieldset.dim-field legend { padding: 0; margin-bottom: .35rem; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.trio label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.trio select { padding-left: .6rem; padding-right: .3rem; }
@media (max-width: 360px) { .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trio > div:last-child { grid-column: 1 / -1; } }
.row > .field, .trio > div { min-width: 0; }
.mala { margin: .75rem 0 0; font-size: .88rem; color: var(--warn); }
.site-footer a { color: var(--accent); font-weight: 600; }

/* ---- Logo, glava in dodelava dizajna ---- */
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 10; border-radius: 0 0 var(--radius-sm) 0; }
.skip:focus { left: 0; }

.site-header { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); }
.site-header .wrap { min-height: 68px; }
.logo { gap: .65rem; font-size: 1.35rem; border-radius: var(--radius-sm); }
.logo .logo-mark { width: 36px; height: 36px; flex: none; }
.logo:hover .logo-mark { transform: rotate(30deg); }
.logo-mark { transition: transform .35s ease; }

.hero { background: linear-gradient(180deg, #e8f4f7 0%, var(--bg) 100%); padding-bottom: 2rem; }
.hero h1 { color: #0a3d49; }
.form-card { border-top: 4px solid var(--accent); box-shadow: 0 2px 4px rgba(18,34,43,.06), 0 16px 40px rgba(18,34,43,.10); }
.form-card h2 { margin-bottom: 1.1rem; }
input[type="text"], input[type="number"], select { border-color: #6b8695; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.btn { box-shadow: 0 2px 0 #074a57; transition: background .15s, transform .1s, box-shadow .1s; }
.btn:active { transform: translateY(2px); box-shadow: none; }

.tier { transition: transform .15s, box-shadow .15s; }
.tier:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(18,34,43,.06), 0 16px 36px rgba(18,34,43,.12); }
.results-head h2 { font-size: 1.6rem; }
summary:hover { color: var(--accent); }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: .6rem; }

/* Podstrani */
.page { max-width: 760px; padding-top: 2.5rem; padding-bottom: 3rem; }
.page h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); letter-spacing: -.02em; }
.page h2 { margin-top: 1.8rem; font-size: 1.3rem; }
.page a { color: var(--accent); font-weight: 600; }

@media (max-width: 480px) {
  .site-header .wrap { min-height: 60px; }
  .logo { font-size: 1.2rem; }
  .logo .logo-mark { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-mark, .tier, .btn { transition: none; }
  .logo:hover .logo-mark, .tier:hover { transform: none; }
}

/* Poravnaj vnosna polja v vrsti, tudi če se oznaka prelomi */
@media (min-width: 640px) {
  .row { align-items: end; }
  .row > .field { display: flex; flex-direction: column; justify-content: flex-end; }
}

/* Noga s podatki podjetja */
.site-footer .legal-links { margin: 0 0 12px; }
.site-footer .legal-company { margin: 0 0 12px; line-height: 1.6; font-size: 0.95rem; }
.site-footer .legal-note { margin: 0; font-size: 0.9rem; opacity: 1; }

/* Vodnik (vsebinske strani) */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.nav-link:hover { text-decoration: underline; }
.article .crumbs { font-size: .9rem; margin: 0 0 .5rem; }
.article .lead { font-size: 1.1rem; line-height: 1.6; }
.article ul { padding-left: 1.2rem; line-height: 1.6; }
.article li { margin: .3rem 0; }
.data-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; display: block; overflow-x: auto; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.data-table th { background: #f1f6f7; }
.data-table th, .data-table td { overflow-wrap: normal; word-break: normal; hyphens: none; }
.data-table tr > :first-child { min-width: 7.5rem; }
.data-table tr > :not(:first-child) { min-width: 3rem; }
.data-table { -webkit-overflow-scrolling: touch; }
@media (max-width: 480px) { .data-table { font-size: .9rem; } .data-table th, .data-table td { padding: .5rem .55rem; } }
.formula { background: #f1f6f7; border-left: 4px solid var(--accent); padding: .8rem 1rem; border-radius: 6px; font-weight: 600; }
.cta-box { background: #f1f6f7; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin: 1.8rem 0; }
.cta-box p { margin: .3rem 0; }
.btn-link { display: inline-block; background: var(--accent); color: #fff !important; padding: .6rem 1.1rem; border-radius: 8px; text-decoration: none; }
.source { font-size: .9rem; color: #5a6a6d; }
.guide-list { list-style: none; padding: 0 !important; }
.guide-list li { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin: .8rem 0; }
.guide-list span { color: #5a6a6d; }

/* Spustni meni "Koristne informacije" (zgoraj desno) */
.site-nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.nav-menu { position: relative; background: none; border: 0; border-radius: 0; margin: 0; }
.nav-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; min-height: 44px; border: 1.5px solid var(--accent); border-radius: var(--radius-sm); color: var(--accent); font-weight: 650; background: #fff; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.nav-menu[open] > summary { background: var(--accent); color: #fff; border-bottom: 1.5px solid var(--accent); margin: 0; }
.nav-menu[open] > summary::after { transform: rotate(225deg); }
.nav-menu > summary:hover { color: var(--accent); }
.nav-menu[open] > summary:hover { color: #fff; }
.nav-menu > summary:focus-visible { outline: 3px solid #0a3d49; outline-offset: 2px; }
.nav-panel { position: absolute; right: 0; top: calc(100% + .5rem); width: min(380px, calc(100vw - 2rem)); max-height: calc(100vh - 100px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 2px 4px rgba(18,34,43,.06), 0 16px 40px rgba(18,34,43,.16); padding: .5rem; z-index: 20; }
.nav-panel ul { list-style: none; margin: 0; padding: 0; }
.nav-panel li { margin: 0; }
.nav-panel li a { display: block; padding: .65rem .75rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 400; }
.nav-panel li a:hover, .nav-panel li a:focus-visible { background: #e8f4f7; }
.nav-panel li strong { display: block; color: var(--accent); }
.nav-panel li span { display: block; font-size: .9rem; color: var(--ink-soft); line-height: 1.4; margin-top: .15rem; }
.nav-panel .nav-sources { margin: .4rem .75rem .5rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-soft); line-height: 1.5; }
.nav-panel .nav-sources a { color: var(--accent); font-weight: 600; }
@media (max-width: 480px) {
  .nav-menu > summary { padding: .5rem .7rem; font-size: .92rem; }
  .logo-text { font-size: 1.05rem; }
}

/* ---- Dodelava uporabnosti ---- */
/* Lepljiva glava ne sme prekriti naslova po pomiku na rezultate ali sidra */
html { scroll-behavior: smooth; }
#results, #main, [id] { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.trust { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem .6rem; padding: 0; margin: 1.25rem 0 0; }
.trust li { display: inline-flex; align-items: center; gap: .4rem; font-weight: 650; font-size: .92rem; color: #0a3d49; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; }
.trust li::before { content: ""; width: .8rem; height: .45rem; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg) translateY(-1px); }

.steps-section { padding: 1.5rem 0 .5rem; }
.steps-section h2 { font-size: 1.5rem; }
.steps { list-style: none; counter-reset: korak; display: grid; gap: .9rem; padding: 0; margin: 1rem 0 0; }
.steps li { counter-increment: korak; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1rem 3.6rem; box-shadow: var(--shadow); }
.steps li::before { content: counter(korak); position: absolute; left: 1rem; top: 1rem; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; }
.steps strong { display: block; }
.steps span { color: var(--ink-soft); font-size: .95rem; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.btn-ghost { font: inherit; font-weight: 650; min-height: 44px; padding: .5rem 1rem; border: 1.5px solid var(--accent); background: #fff; color: var(--accent); border-radius: var(--radius-sm); cursor: pointer; }
.btn-ghost:hover { background: var(--accent-soft); }
.share-msg { margin-left: .75rem; color: var(--ink-soft); font-size: .92rem; }
#results-title:focus { outline: none; }

/* Povezave v besedilu naj bodo vidne */
.content p a, .page p a, .page li a { text-decoration: underline; text-underline-offset: 2px; }
.nav-panel a, .guide-list a { text-decoration: none; }

.site-footer .legal-links a { display: inline-block; padding: .25rem 0; }

@media (max-width: 480px) {
  .tier .big { font-size: 2.2rem; }
  .btn-ghost { width: 100%; }
  .share-msg { display: block; margin: .4rem 0 0; }
}

@media print {
  .site-header, .site-footer, .nav-menu, .btn, .btn-ghost, .cta-box, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, .tier { box-shadow: none; border: 1px solid #999; }
  a { color: #000; }
}

/* Ime konkretnega modela na kartici rezultata */
.model-name { margin: .35rem 0 .6rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.model-name a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Cookie banner */
#cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: .75rem; pointer-events: none; }
#cookie-banner .cookie-box {
  pointer-events: auto; max-width: 720px; margin: 0 auto; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(18, 34, 43, .22); padding: 1rem 1.25rem;
}
#cookie-banner h2 { font-size: 1.1rem; margin: 0 0 .35rem; }
#cookie-banner p { margin: 0 0 .75rem; font-size: .95rem; color: var(--ink-soft); }
#cookie-banner a { color: var(--accent); }
.cookie-details { margin: 0 0 .75rem; display: grid; gap: .5rem; }
.cookie-details[hidden], .cookie-btn[hidden] { display: none; }
.cookie-row { display: flex; gap: .65rem; align-items: flex-start; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cookie-row input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; }
.cookie-row small { display: block; color: var(--ink-soft); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.cookie-btn { font: inherit; font-weight: 600; padding: .6rem 1rem; border-radius: var(--radius-sm); border: 2px solid var(--accent); cursor: pointer; min-height: 44px; }
.cookie-btn-primary { background: var(--accent); color: var(--accent-ink); }
.cookie-btn-ghost { background: transparent; color: var(--accent); }
.cookie-btn:focus-visible { outline: 3px solid #0a3d49; outline-offset: 2px; }
@media (max-width: 480px) { .cookie-btn { flex: 1 1 100%; } }
@media print { #cookie-banner { display: none; } }
