/* ============================================================
   ZANESLJIVI DELAVCI — COMPONENT LIBRARY
   Every component built only from tokens.css. No page-only styles.
   ============================================================ */

/* ------------------------------------------------------------
   BUTTONS
   variants: primary / secondary / tertiary
   states:   default / hover / focus / disabled / loading
   sizes:    sm / (default) / lg
   ------------------------------------------------------------ */
.btn {
  --btn-pad-y: 12px;
  --btn-pad-x: 22px;
  --btn-font: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  font-family: var(--font-body);
  font-size: var(--btn-font);
  font-weight: 600;
  line-height: 1;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background-color var(--duration-default) var(--easing-default),
              border-color var(--duration-default) var(--easing-default),
              color var(--duration-default) var(--easing-default);
  position: relative;
}
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.btn--sm { --btn-pad-y: 9px; --btn-pad-x: 16px; --btn-font: 14px; }
.btn--lg { --btn-pad-y: 16px; --btn-pad-x: 30px; --btn-font: 17px; }

/* primary — ochre fill */
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; }

/* secondary — ochre border, transparent fill */
.btn--secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--secondary:hover { background: var(--color-primary-tint); color: var(--color-primary-hover); border-color: var(--color-primary-hover); }

/* tertiary — text only */
.btn--tertiary { background: transparent; color: var(--color-primary); padding-inline: 8px; }
.btn--tertiary:hover { background: var(--color-primary-tint); color: var(--color-primary-hover); }

/* disabled */
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}

/* loading */
.btn[data-loading="true"] { color: transparent !important; pointer-events: none; }
.btn[data-loading="true"]::after {
  content: ""; position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  color: #fff;
}
.btn--secondary[data-loading="true"]::after,
.btn--tertiary[data-loading="true"]::after { color: var(--color-primary); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-icon { width: 18px; height: 18px; stroke-width: 1.8; }

/* ------------------------------------------------------------
   FORM FIELDS
   states: default / focus / filled / error / disabled
   ------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: var(--space-8); }
.field-label {
  font-size: var(--type-small-size);
  font-weight: 600;
  color: var(--color-text);
}
.field-label .req { color: var(--color-primary); margin-left: 2px; }
.field-optional { font-weight: 400; color: var(--color-text-muted); }

.input, .textarea, .select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--type-body-size);
  line-height: 1.4;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color var(--duration-fast) var(--easing-default);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--color-text-muted); opacity: 0.7; }

/* focus — 2px ochre border, no halo glow */
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

.textarea { resize: vertical; min-height: 120px; }

/* select with custom chevron */
.select-wrap { position: relative; }
.select { padding-right: 42px; cursor: pointer; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%;
  width: 10px; height: 10px; pointer-events: none;
  margin-top: -3px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
}
.select:invalid, .select option[value=""] { color: var(--color-text-muted); }

/* error */
.field--error .input, .field--error .textarea, .field--error .select {
  border-color: var(--color-error);
  background: var(--color-error-tint);
}
.field--error .input:focus, .field--error .textarea:focus, .field--error .select:focus {
  box-shadow: inset 0 0 0 1px var(--color-error);
}
.field-error {
  font-size: var(--type-small-size);
  color: var(--color-error);
  display: none;
}
.field--error .field-error { display: block; }

/* disabled */
.input:disabled, .textarea:disabled, .select:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

/* radio group */
.radio-group { display: flex; flex-direction: column; gap: var(--space-12); }
.radio-group--row { flex-direction: row; flex-wrap: wrap; gap: var(--space-12); }
.radio {
  display: flex; align-items: flex-start; gap: var(--space-12);
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--color-surface);
  transition: border-color var(--duration-fast) var(--easing-default),
              background-color var(--duration-fast) var(--easing-default);
  flex: 1 1 0; min-width: 200px;
}
.radio:hover { border-color: var(--color-border-strong); }
.radio input { position: absolute; opacity: 0; }
.radio-dot {
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
  position: relative;
  transition: border-color var(--duration-fast) var(--easing-default);
}
.radio input:checked + .radio-dot { border-color: var(--color-primary); }
.radio input:checked + .radio-dot::after {
  content: ""; position: absolute; inset: 3px;
  background: var(--color-primary); border-radius: 50%;
}
.radio input:checked ~ .radio-text .radio-title,
.radio:has(input:checked) { border-color: var(--color-primary); }
.radio:has(input:checked) { background: var(--color-primary-tint); }
.radio input:focus-visible + .radio-dot { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.radio-text { display: flex; flex-direction: column; gap: 2px; }
.radio-title { font-weight: 600; font-size: var(--type-body-size); }
.radio-desc { font-size: var(--type-small-size); color: var(--color-text-muted); }

/* checkbox (incl. GDPR consent) */
.checkbox {
  display: flex; align-items: flex-start; gap: var(--space-12);
  cursor: pointer;
}
.checkbox input { position: absolute; opacity: 0; }
.checkbox-box {
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  border: 2px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  position: relative;
  transition: border-color var(--duration-fast) var(--easing-default),
              background-color var(--duration-fast) var(--easing-default);
}
.checkbox input:checked + .checkbox-box { background: var(--color-primary); border-color: var(--color-primary); }
.checkbox input:checked + .checkbox-box::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox input:focus-visible + .checkbox-box { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.checkbox-label { font-size: var(--type-small-size); color: var(--color-text-muted); line-height: 1.5; }
.field--error .checkbox-box { border-color: var(--color-error); }

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-32);
}

/* icon chip — ochre tinted circle */
.icon-chip {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--color-primary-tint);
  display: grid; place-items: center;
  color: var(--color-primary);
  flex: none;
}
.icon-chip svg { width: 24px; height: 24px; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* value-prop card */
.card-value { display: flex; flex-direction: column; gap: var(--space-16); }
.card-value .card-title { margin-top: var(--space-4); }
.card-desc { color: var(--color-text-muted); }

/* service-area card */
.card-service {
  display: flex; flex-direction: column; gap: var(--space-16);
  padding: var(--space-24);
  transition: border-color var(--duration-default) var(--easing-default);
}
.card-service:hover { border-color: var(--color-border-strong); }
.card-service .icon-chip { width: 42px; height: 42px; }
.card-service .icon-chip svg { width: 22px; height: 22px; }

/* testimonial card */
.card-quote { display: flex; flex-direction: column; gap: var(--space-16); }
.quote-mark {
  font-family: var(--font-display);
  font-size: 64px; line-height: 0.6;
  color: var(--color-primary);
  height: 36px; display: block;
}
.quote-text { font-size: var(--type-body-large-size); line-height: 1.55; color: var(--color-text); }
.quote-attr { font-size: var(--type-small-size); color: var(--color-text-muted); margin-top: var(--space-4); }
.quote-attr .city-tag { color: var(--color-primary); font-weight: 600; }

/* ------------------------------------------------------------
   STAT BLOCK
   ------------------------------------------------------------ */
.stat { display: flex; flex-direction: column; gap: var(--space-8); }
.stat-num {
  font-family: var(--font-display);
  font-size: var(--type-stat-size);
  line-height: var(--type-stat-lh);
  font-weight: 600;
  color: var(--color-text);
  font-feature-settings: "tnum" 1;
}
.stat-label { font-size: var(--type-small-size); color: var(--color-text-muted); }

/* ------------------------------------------------------------
   CHIP / BADGE
   ------------------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--type-small-size); font-weight: 500;
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: var(--color-primary-tint); color: var(--color-primary);
}
.chip--success { background: var(--color-success-tint); color: var(--color-success); }

/* ------------------------------------------------------------
   HEADER NAV
   ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--color-text); display: inline-flex; align-items: baseline; gap: 1px;
  white-space: nowrap;
}
.logo:hover { color: var(--color-text); }
.logo .dot { color: var(--color-primary); }
.nav-links { display: flex; align-items: center; gap: var(--space-32); }
.nav-link {
  font-size: var(--type-small-size); font-weight: 500; color: var(--color-text);
  transition: color var(--duration-fast) var(--easing-default);
}
.nav-link:hover { color: var(--color-primary); }
.nav-cta { margin-left: var(--space-8); }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; align-items: center; justify-content: center;
  color: var(--color-text); margin-right: -10px;
}
.nav-toggle svg { width: 26px; height: 26px; stroke-width: 1.8; }

/* mobile slide-over */
.nav-panel {
  position: fixed; inset: 0 0 0 auto; width: min(86vw, 360px);
  background: var(--color-bg); z-index: 100;
  transform: translateX(100%);
  transition: transform var(--duration-default) var(--easing-default);
  border-left: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  padding: var(--space-24);
}
.nav-panel[data-open="true"] { transform: translateX(0); }
.nav-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-32); }
.nav-panel .nav-link { font-size: 18px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.nav-panel .btn { margin-top: var(--space-24); }
.nav-scrim {
  position: fixed; inset: 0; background: rgba(31,26,20,0.32); z-index: 99;
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration-default) var(--easing-default);
}
.nav-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  padding-top: var(--space-64);
  padding-bottom: var(--space-32);
  margin-top: var(--section-pad);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: var(--space-48);
}
.footer-brand .logo { margin-bottom: var(--space-16); }
.footer-brand p { color: var(--color-text-muted); font-size: var(--type-small-size); max-width: 28ch; }
.footer-col h4 {
  font-size: var(--type-caption-size); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-muted); margin-bottom: var(--space-16);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-12); }
.footer-col a, .footer-col span { font-size: var(--type-small-size); color: var(--color-text); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom {
  margin-top: var(--space-48);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border);
  font-size: var(--type-small-size); color: var(--color-text-muted);
}
.footer-acc-toggle { display: none; }

/* ------------------------------------------------------------
   SECTION HEADER PATTERN
   ------------------------------------------------------------ */
.section { padding-block: var(--section-pad); }
.section-head { max-width: 56ch; margin-bottom: var(--space-48); display: flex; flex-direction: column; gap: var(--space-16); }
.section-head .eyebrow { margin-bottom: -4px; }

/* divider rule */
.rule { height: 1px; background: var(--color-border); border: 0; margin: 0; }

/* ------------------------------------------------------------
   LAYOUT PRIMITIVES (used across page frames)
   ------------------------------------------------------------ */
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-24); }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-24); }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-24); }

/* hero — single-column, left-aligned editorial statement */
.hero { padding-block: clamp(56px, 9vw, 104px); }
.hero-single { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-24); }
.hero-single .eyebrow { color: var(--color-text-muted); }
.hero-single .h1 { max-width: 20ch; }
.hero-sub { max-width: 52ch; }
.hero-cta-row { display: flex; flex-direction: column; gap: var(--space-12); align-items: flex-start; margin-top: var(--space-8); }
.hero-micro { font-size: var(--type-small-size); color: var(--color-text-muted); }

/* stat band — white, ruled top & bottom */
.stat-band { background: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.stat-band-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-32); padding-block: var(--space-48); }
.stat-band .stat { gap: var(--space-12); }

/* closing CTA band */
.cta-band { text-align: left; }
.cta-band-inner {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: clamp(40px, 6vw, 72px);
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-24);
}

/* coverage / map */
.coverage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.coverage-copy { display: flex; flex-direction: column; gap: var(--space-24); max-width: 48ch; }
.map-wrap { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-32); }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-dot-label { font-size: var(--type-small-size); font-weight: 600; fill: var(--color-text); font-family: var(--font-body); }

/* reassurance bullet list */
.bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-16); }
.bullets li { display: flex; gap: var(--space-12); align-items: flex-start; }
.bullets .tick {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-success-tint); color: var(--color-success);
  display: grid; place-items: center;
}
.bullets .tick svg { width: 14px; height: 14px; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bullets .bullet-text { font-size: var(--type-body-size); color: var(--color-text); padding-top: 1px; }

@media (max-width: 900px) {
  .coverage-grid { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .stat-band-inner { grid-template-columns: 1fr; gap: var(--space-32); }
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   FORM PAGE LAYOUTS
   ------------------------------------------------------------ */
.lead-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.lead-info { display: flex; flex-direction: column; gap: var(--space-24); position: sticky; top: 104px; }
.form-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: clamp(28px, 4vw, 44px); box-shadow: var(--shadow-card); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-24); }
.form-grid .field--full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-direction: column; gap: var(--space-16); margin-top: var(--space-8); }
.form-micro { font-size: var(--type-small-size); color: var(--color-text-muted); }

/* narrow single-column form (worker page) */
.form-narrow { max-width: 540px; margin-inline: auto; }
.form-narrow .form-grid { grid-template-columns: 1fr; }
.page-head-center { max-width: 540px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--space-16); align-items: flex-start; }

/* success panel */
.success-panel { background: var(--color-success-tint); border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent); border-radius: var(--radius-lg); padding: clamp(28px, 4vw, 44px); display: flex; flex-direction: column; gap: var(--space-16); align-items: flex-start; }
.success-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--color-success); color: #fff; display: grid; place-items: center; }
.success-icon svg { width: 26px; height: 26px; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* mobile sticky CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--color-border);
  transition: transform var(--duration-default) var(--easing-default);
}
.sticky-cta .btn { width: 100%; }
.sticky-cta[data-hide="true"] { transform: translateY(120%); }

@media (max-width: 900px) {
  .lead-grid { grid-template-columns: 1fr; gap: var(--space-32); }
  .lead-info { position: static; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .sticky-cta { display: block; }
  body.has-sticky-cta { padding-bottom: 84px; }
}

/* ------------------------------------------------------------
   PROSE (legal pages)
   ------------------------------------------------------------ */
.prose { max-width: 720px; margin-inline: auto; }
.prose .doc-meta { font-size: var(--type-small-size); color: var(--color-text-muted); margin-bottom: var(--space-16); }
.prose h1 { font-family: var(--font-display); font-size: var(--type-h1-size); line-height: 1.08; font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--space-32); }
.prose h2 { font-size: 24px; line-height: 1.25; font-weight: 600; margin-top: var(--space-48); margin-bottom: var(--space-16); }
.prose p, .prose li { font-size: 18px; line-height: 1.65; color: var(--color-text-muted); }
.prose p { margin-bottom: var(--space-16); }
.prose p strong, .prose li strong { color: var(--color-text); font-weight: 600; }
.prose ul { margin: 0 0 var(--space-16); padding-left: var(--space-24); display: flex; flex-direction: column; gap: var(--space-8); }
.prose li { padding-left: var(--space-4); }
.prose ul li::marker { color: var(--color-primary); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 0; }
  .footer-brand { margin-bottom: var(--space-32); }
  .footer-col { border-top: 1px solid var(--color-border); }
  .footer-col h4 {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; margin: 0; padding: var(--space-16) 0; user-select: none;
  }
  .footer-col h4::after {
    content: ""; width: 9px; height: 9px;
    border-right: 2px solid var(--color-text-muted);
    border-bottom: 2px solid var(--color-text-muted);
    transform: rotate(45deg); transition: transform var(--duration-default) var(--easing-default);
  }
  .footer-col[data-open="true"] h4::after { transform: rotate(-135deg); }
  .footer-col ul {
    max-height: 0; overflow: hidden; padding-bottom: 0;
    transition: max-height var(--duration-default) var(--easing-default), padding-bottom var(--duration-default) var(--easing-default);
  }
  .footer-col[data-open="true"] ul { max-height: 320px; padding-bottom: var(--space-24); }
}
