/* ==========================================================================
   Srbijaautoput - design system ("Magistrala")
   Brand green #009640 / graphite / warm concrete off-white.
   Every colour pair below is WCAG AA verified:
     green-text #00662B on white ............ 7.15:1
     green-bright #3DD68C on graphite ....... 9.51:1
     text #171A1D on bg #F6F4EF ............ 15.90:1
     muted #5B6169 on bg #F6F4EF ............ 5.69:1
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* brand */
  --green:        #009640;   /* logo green - graphics, rules, large marks */
  --green-text:   #00662B;   /* text + button fills on light */
  --green-hover:  #004F21;
  --green-bright: #3DD68C;   /* dark sections only */
  --green-wash:   #EAF5EE;

  /* neutrals */
  --bg:           #F6F4EF;   /* warm concrete, not clinical white */
  --surface:      #FFFFFF;
  --graphite:     #171A1D;
  --graphite-2:   #22272B;
  --text:         #171A1D;
  --muted:        #5B6169;
  --line:         #E5E1D8;

  /* on dark */
  --d-bg:         #14181C;
  --d-surface:    #1D2126;
  --d-text:       #F2F0EA;
  --d-muted:      #9CA3AC;
  --d-line:       rgba(255,255,255,.12);

  /* signal */
  --ok:   #16A34A;
  --warn: #B45309;
  --err:  #DC2626;

  /* spacing - 8pt */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* radius - restrained; engineering brand, not SaaS */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;

  --container: 1280px;
  --wide: 1440px;

  --shadow-hover: 0 8px 24px rgba(23,26,29,.10);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1rem, .95rem + .2vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--green-text); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--green-hover); }

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 2px; }

/* skip link - was missing entirely on the old site */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--graphite); color: #fff; padding: var(--s3) var(--s5);
  border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- 3. Typography ---------- */
h1, h2, h3, .display {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-weight: 600;
  margin: 0 0 var(--s4);
  text-wrap: balance;
}
.display { font-size: clamp(3rem, 2.2rem + 4vw, 5rem); font-weight: 700; line-height: 1; letter-spacing: -.02em; }
h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 4rem); font-weight: 700; line-height: 1.06; letter-spacing: -.02em; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem); line-height: 1.15; letter-spacing: -.01em; }
h3 { font-size: clamp(1.375rem, 1.2rem + .8vw, 1.875rem); line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 var(--s4); max-width: 68ch; }

.lead  { font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); color: var(--muted); line-height: 1.55; }
.small { font-size: .875rem; font-weight: 500; line-height: 1.4; }
.eyebrow {
  font-size: .75rem; font-weight: 600; line-height: 1.4;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--green-text); margin: 0 0 var(--s3);
  display: inline-flex; align-items: center; gap: var(--s2);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--green); flex: none; }
.num { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 4. Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s5); }
@media (min-width: 768px)  { .container { padding-inline: 40px; } }
@media (min-width: 1200px) { .container { padding-inline: var(--s8); } }
.container--wide { max-width: var(--wide); }

.section { padding-block: clamp(64px, 8vw, 160px); }
.section--tight { padding-block: clamp(48px, 5vw, 96px); }

.section--dark { background: var(--d-bg); color: var(--d-text); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--d-text); }
.section--dark .lead, .section--dark .muted { color: var(--d-muted); }
.section--dark .eyebrow { color: var(--green-bright); }
.section--dark .eyebrow::before { background: var(--green-bright); }
.section--dark a { color: var(--green-bright); }

.grid { display: grid; gap: var(--s5); }
@media (min-width: 700px)  { .cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 700px)  { .cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px)  { .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cols-4 { grid-template-columns: repeat(4, 1fr); } }

.stack > * + * { margin-top: var(--s4); }
.muted { color: var(--muted); }
.center { text-align: center; margin-inline: auto; }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font: 600 1rem/1 Inter, system-ui, sans-serif;
  padding: var(--s4) var(--s6);
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--green-text); color: #fff; }
.btn--primary:hover { background: var(--green-hover); color: #fff; }

.btn--outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn--outline:hover { border-color: var(--green); color: var(--green-text); background: var(--green-wash); }

.section--dark .btn--primary { background: var(--green-bright); color: var(--d-bg); }
.section--dark .btn--primary:hover { background: #57E39B; color: var(--d-bg); }
.section--dark .btn--outline { color: var(--d-text); border-color: var(--d-line); }
.section--dark .btn--outline:hover { border-color: var(--green-bright); color: var(--green-bright); background: rgba(61,214,140,.08); }

.btn--lg { font-size: 1.0625rem; padding: var(--s5) var(--s7); }
.btn--block { width: 100%; }

/* ---------- 6. Header / nav ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,244,239,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s5); min-height: 76px;
}
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--text); }
.brand img { height: 44px; width: auto; }
.brand__name {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: 1.0625rem; letter-spacing: .01em; line-height: 1.1;
}
.brand__tag { font-size: .6875rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.nav { display: none; align-items: center; gap: var(--s5); }
@media (min-width: 900px)  { .nav { display: flex; } }
@media (min-width: 1180px) { .nav { gap: var(--s6); } }
/* CTA: a plain link on narrow desktops, a filled button once there is room.
   Never hidden - between 900 and 1080px the mobile menu is not available. */
.nav .btn {
  background: none; color: var(--green-text); border-color: transparent;
  padding: var(--s2) 0; font-weight: 600;
}
.nav .btn:hover { background: none; color: var(--green-hover); transform: none; }
@media (min-width: 1080px) {
  .nav .btn { background: var(--green-text); color: #fff; padding: var(--s3) var(--s5); }
  .nav .btn:hover { background: var(--green-hover); color: #fff; transform: translateY(-2px); }
}
.nav a {
  font-size: .9375rem; font-weight: 500; color: var(--text);
  text-decoration: none; padding: var(--s2) 0; position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--green); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--green-text); }

.nav-toggle {
  display: inline-flex; align-items: center; gap: var(--s2);
  background: none; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: var(--s3) var(--s4); font: 600 .8125rem Inter, sans-serif;
  text-transform: uppercase; letter-spacing: .06em; cursor: pointer; color: var(--text);
}
@media (min-width: 900px) { .nav-toggle { display: none; } }

.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--surface); }
.mobile-nav[data-open="true"] { display: block; }
.mobile-nav a {
  display: block; padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text); font-weight: 500;
}
.mobile-nav a:last-child { border-bottom: 0; }

/* ---------- 7. Hero ---------- */
.hero { position: relative; min-height: clamp(520px, 78vh, 760px); display: flex; align-items: flex-end; overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,24,28,.30) 0%, rgba(20,24,28,.55) 45%, rgba(20,24,28,.88) 100%);
}
.hero__body { position: relative; padding-block: var(--s9) var(--s8); color: #fff; }
.hero__body h1 { color: #fff; max-width: 18ch; }
.hero__body .lead { color: rgba(255,255,255,.86); max-width: 56ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s6); }
.hero__body .eyebrow { color: var(--green-bright); }
.hero__body .eyebrow::before { background: var(--green-bright); }
.hero .btn--outline { color: #fff; border-color: rgba(255,255,255,.45); }
.hero .btn--outline:hover { border-color: #fff; background: rgba(255,255,255,.12); color: #fff; }

/* ---------- 8. Stats band ---------- */
.stats { display: grid; gap: var(--s6); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border-top: 2px solid var(--d-line); padding-top: var(--s5); }
.stat__num {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); line-height: 1;
  color: var(--green-bright); letter-spacing: -.02em;
}
.stat__label { margin-top: var(--s3); color: var(--d-muted); font-size: .9375rem; }

/* ---------- 9. Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card:hover { border-color: var(--green); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card__media { aspect-ratio: 16/10; overflow: hidden; background: var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); flex: 1; }
.card__body h3 { margin: 0; }
.card__meta { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--line); display: grid; gap: var(--s2); }
.card__meta div { display: flex; justify-content: space-between; gap: var(--s4); font-size: .875rem; }
.card__meta .k { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; font-weight: 600; }
.card__meta .v { margin: 0; font-weight: 500; text-align: right; }

/* service / feature card */
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s6); }
.feature__icon { width: 40px; height: 40px; margin-bottom: var(--s4); }
.feature h3 { font-size: 1.25rem; }
.feature p { margin: 0; color: var(--muted); font-size: .9375rem; }

/* ---------- 10. Partner logos - fixes the worst section of the old site ---------- */
.partners {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
}
@media (min-width: 640px)  { .partners { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .partners { grid-template-columns: repeat(5, 1fr); } }
.partners__item {
  background: var(--surface); display: grid; place-items: center;
  padding: var(--s6) var(--s4); min-height: 120px;
}
/* These logos arrive at wildly different aspect ratios (1:1 up to 9.4:1).
   Capping height alone leaves wide marks looking tiny, and several of these
   files are pale to begin with - hence the higher resting opacity. */
.partners__item img {
  max-height: 46px; max-width: 100%; width: auto; object-fit: contain;
  filter: grayscale(1); opacity: .78;
  transition: filter .3s var(--ease), opacity .3s var(--ease);
}
.partners__item:hover img { filter: grayscale(0); opacity: 1; }

/* ---------- 11. CTA band + notices ---------- */
.cta { background: var(--graphite); color: var(--d-text); border-radius: var(--r-lg); padding: clamp(40px, 5vw, 72px); }
.cta h2 { color: var(--d-text); margin-bottom: var(--s3); }
.cta p { color: var(--d-muted); }
.cta .btn--primary { background: var(--green-bright); color: var(--d-bg); }
.cta .btn--primary:hover { background: #57E39B; }

.notice {
  border-left: 3px solid var(--green); background: var(--green-wash);
  padding: var(--s5); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.notice--warn { border-left-color: var(--warn); background: #FEF6EC; }
.notice p:last-child { margin-bottom: 0; }

/* ---------- 12. Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s5); }
.field > label { font-size: .875rem; font-weight: 600; }
.field .hint { font-size: .8125rem; color: var(--muted); }
.req { color: var(--err); font-weight: 700; }

.input, .select, .textarea {
  font: 400 1rem Inter, system-ui, sans-serif;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: var(--s4); width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,150,64,.18);
}
.input:disabled { background: var(--bg); color: var(--muted); }
.textarea { min-height: 140px; resize: vertical; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--err); }
.error-text { color: var(--err); font-size: .8125rem; font-weight: 500; }

.fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s6); margin: 0 0 var(--s6); background: var(--surface); }
.fieldset > legend {
  font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.125rem;
  padding-inline: var(--s3); margin-left: calc(var(--s3) * -1);
}
.field-row { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .field-row--3 { grid-template-columns: repeat(3, 1fr); } }

.check { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); }
.check input { margin-top: .25em; width: 18px; height: 18px; accent-color: var(--green-text); flex: none; }
.check label { font-size: .9375rem; line-height: 1.5; }

.radio-group { display: flex; flex-wrap: wrap; gap: var(--s3); }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-pill span {
  display: inline-block; padding: var(--s3) var(--s5);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; font-size: .9375rem; font-weight: 500;
  transition: all .2s var(--ease);
}
.radio-pill input:checked + span { border-color: var(--green); background: var(--green-wash); color: var(--green-text); font-weight: 600; }
.radio-pill input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }

/* honeypot - never visible, never announced */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 13. Footer ---------- */
.footer { background: var(--d-bg); color: var(--d-muted); padding-block: var(--s9) var(--s6); }
.footer h4 {
  font: 600 .75rem Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em;
  color: var(--d-text); margin: 0 0 var(--s4);
}
.footer a { color: var(--d-muted); text-decoration: none; }
.footer a:hover { color: var(--green-bright); }
.footer__grid { display: grid; gap: var(--s7); grid-template-columns: 1fr; }
@media (min-width: 700px)  { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 1000px) { .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; } }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); font-size: .9375rem; }
.footer__bottom {
  margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--d-line);
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
  font-size: .8125rem;
}
.footer__logo { height: 56px; width: auto; margin-bottom: var(--s4); }

/* ---------- 14. FAQ (native <details>, no JS) ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.faq summary {
  cursor: pointer; list-style: none;
  padding: var(--s5) var(--s6) var(--s5) var(--s5);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 600; font-size: 1.0625rem; line-height: 1.4;
  position: relative; display: block;
  transition: color .2s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: var(--s5); top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--green-text);
  transition: transform .25s var(--ease);
}
.faq details[open] > summary { color: var(--green-text); }
.faq details[open] > summary::after { content: "−"; }
.faq summary:hover { color: var(--green-text); }
.faq summary:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.faq .faq__body { padding: 0 var(--s6) var(--s5) var(--s5); }
.faq .faq__body p:last-child { margin-bottom: 0; }
.faq .faq__body ul { margin: 0 0 var(--s4); padding-left: 1.2em; }
.faq .faq__body li { margin-bottom: var(--s2); }

/* ---------- 15. Utilities ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
