/* ==========================================================================
   Moto Prijevoz Web - design system and page styles
   Concept: European motorway route sign meets a departure board.
   No build step. Mobile-first. Croatian default, English toggle.
   ========================================================================== */

/* ----- Tokens ----------------------------------------------------------- */
:root {
  /* Color: motorway green, sign white, indicator amber, asphalt ink */
  --green-900: #0A2B1C;
  --green-800: #0B3A25;
  --green-700: #0D5236; /* primary */
  --green-600: #146C47;
  --green-500: #1C8659;
  --green-100: #E7EEE9;
  --green-50:  #F2F6F3;
  --paper:     #FBFCFB;
  --ink:       #0A1A12;
  --muted:     #56675E;
  --line:      #D6E0D9;
  --amber:     #F59E0B; /* indicator / urgency */
  --amber-600: #D97706;
  --amber-100: #FDEFD3;
  --white:     #FFFFFF;
  --danger:    #B4321F;

  /* Type */
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'Cascadia Mono', monospace;

  /* Spacing */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(10,26,18,0.06), 0 1px 3px rgba(10,26,18,0.05);
  --shadow-md: 0 6px 20px rgba(10,26,18,0.10);
  --shadow-lg: 0 18px 48px rgba(10,26,18,0.16);
  --maxw: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* ----- Layout ----------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-7); }
.section--green { background: var(--green-700); color: #EAF3ED; }
.section--green h1, .section--green h2, .section--green h3 { color: var(--white); }
.section--pale { background: var(--green-50); }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--green-600); font-weight: 700;
}
.section--green .eyebrow { color: var(--amber); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 58ch; }
.section--green .lead { color: #CFE3D7; }

/* Type scale */
.h-hero { font-size: clamp(2.6rem, 8vw, 5rem); letter-spacing: -0.035em; }
.h-1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.h-2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.h-3 { font-size: 1.25rem; }
.text-mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

/* ----- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 0.85em 1.4em; border-radius: 999px; font-weight: 700;
  font-family: var(--font-body); font-size: 1rem; border: 2px solid transparent;
  text-decoration: none; transition: transform 0.15s var(--ease), background 0.15s, box-shadow 0.15s;
  line-height: 1; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { background: var(--green-800); box-shadow: var(--shadow-md); }
.btn-amber { background: var(--amber); color: var(--green-900); }
.btn-amber:hover { background: var(--amber-600); color: var(--white); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--green-700); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-700); background: var(--green-50); }
.section--green .btn-ghost { color: var(--white); border-color: rgba(255,255,255,0.35); }
.section--green .btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }
.btn-lg { padding: 1em 1.7em; font-size: 1.0625rem; }
.btn-block { width: 100%; justify-content: center; }

/* ----- Header (injected) ------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,252,251,0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: var(--sp-4); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.nav { display: none; align-items: center; gap: var(--sp-5); }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.98rem; position: relative; padding-block: 4px; }
.nav a:hover { color: var(--green-700); }
.nav a.is-active { color: var(--green-700); }
.nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--amber); }
.header__actions { display: flex; align-items: center; gap: var(--sp-3); }
.lang-toggle {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem;
  background: var(--green-100); color: var(--green-700); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.4em 0.8em; letter-spacing: 0.05em;
}
.lang-toggle:hover { background: var(--green-700); color: var(--white); }
.nav-cta { display: none; }
.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.nav-toggle span { display: block; height: 2px; width: 20px; background: var(--ink); margin-inline: auto; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav {
  display: none; flex-direction: column; gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); background: var(--paper);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.1rem; padding: var(--sp-3) 0; border-bottom: 1px solid var(--green-50); }
.mobile-nav .btn { margin-top: var(--sp-4); }

@media (min-width: 1040px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .nav-cta { display: inline-flex; }
}

/* ----- Hero ------------------------------------------------------------- */
.hero { position: relative; padding-block: var(--sp-8) var(--sp-7); overflow: hidden; }
.hero__road {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(20,108,71,0.10), transparent 60%),
    radial-gradient(90% 60% at 0% 110%, rgba(245,158,11,0.08), transparent 55%);
}
.hero__inner { position: relative; z-index: 1; }
.hero h1 { max-width: 15ch; }
.hero__sub { margin-top: var(--sp-5); font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.hero__cta { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero__trust { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); font-size: 0.92rem; color: var(--muted); }
.hero__trust span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.hero__trust .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }

/* ----- Route sign / trip card (the signature) -------------------------- */
.board-list { display: grid; gap: var(--sp-4); }
.trip {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: transform 0.18s var(--ease), box-shadow 0.18s;
  display: flex; flex-direction: column;
}
.trip:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.trip__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-4); }
.route { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.plate {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em;
  background: var(--green-700); color: var(--white); border-radius: 6px; padding: 0.28em 0.5em;
  display: inline-flex; align-items: center; gap: 0.4em; line-height: 1;
}
.plate .city { font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }
.route__arrow { color: var(--amber-600); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.trip__price { text-align: right; flex: none; }
.trip__price .amount { font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; color: var(--ink); }
.trip__price .per { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.trip__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); padding: 0 var(--sp-5) var(--sp-4); font-size: 0.9rem; color: var(--muted); }
.trip__meta .k { font-family: var(--font-mono); color: var(--ink); font-weight: 700; }
.trip__date { font-family: var(--font-mono); font-weight: 700; color: var(--ink); }

.trip__spots { padding: var(--sp-4) var(--sp-5); background: var(--green-50); border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.pips { display: inline-flex; gap: 5px; }
.pip { width: 16px; height: 16px; border-radius: 4px; background: var(--white); border: 2px solid var(--green-500); }
.pip.is-taken { background: var(--green-500); border-color: var(--green-500); }
.spots-label { font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; color: var(--green-700); }
.trip.is-almostfull .trip__spots { background: var(--amber-100); border-top-color: var(--amber); }
.trip.is-almostfull .pip { border-color: var(--amber-600); }
.trip.is-almostfull .pip.is-taken { background: var(--amber); border-color: var(--amber); }
.trip.is-almostfull .spots-label { color: var(--amber-600); }
.almost-tag {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--green-900); background: var(--amber); padding: 0.25em 0.55em; border-radius: 5px;
}
@media (prefers-reduced-motion: no-preference) {
  .trip.is-almostfull .almost-tag { animation: pulse 1.8s var(--ease) infinite; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
}

.trip__transporter { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green-100); color: var(--green-700); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; flex: none; }
.trip__transporter .name { font-weight: 700; font-size: 0.95rem; }
.trip__transporter .sub { font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); }
.badge-verified {
  display: inline-flex; align-items: center; gap: 0.3em; font-size: 0.72rem; font-weight: 700;
  color: var(--green-700); background: var(--green-100); padding: 0.2em 0.5em; border-radius: 999px;
}
.stars { color: var(--amber-600); font-size: 0.85rem; letter-spacing: 0.05em; }
.trip__foot { padding: var(--sp-4) var(--sp-5) var(--sp-5); margin-top: auto; }
.trip__includes { font-size: 0.85rem; color: var(--muted); margin-bottom: var(--sp-3); }

/* ----- Request (wanted) card variant ------------------------------------ */
.trip.is-request { border-left: 4px solid var(--amber); }
.want-tag { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber-600); background: var(--amber-100); padding: 0.25em 0.55em; border-radius: 5px; }
.req-bike { padding: 0 var(--sp-5) var(--sp-4); }
.req-bike .k { font-family: var(--font-mono); font-weight: 700; color: var(--ink); }
.req-budget { font-family: var(--font-mono); font-weight: 700; color: var(--green-700); }
.req-poster { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.free-pill { display: inline-flex; align-items: center; gap: 0.3em; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: var(--green-700); background: var(--green-100); padding: 0.25em 0.6em; border-radius: 999px; }

/* ----- Filter bar ------------------------------------------------------- */
.filterbar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); box-shadow: var(--shadow-sm); display: grid; gap: var(--sp-3); grid-template-columns: 1fr; margin-bottom: var(--sp-5); }
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-family: var(--font-mono); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 1rem; padding: 0.7em 0.8em; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white); color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-600); outline: none; box-shadow: 0 0 0 3px rgba(20,108,71,0.15); }
.filterbar__row { display: contents; }
.result-count { font-family: var(--font-mono); font-size: 0.9rem; color: var(--muted); margin-bottom: var(--sp-4); }
@media (min-width: 720px) {
  .filterbar { grid-template-columns: 1fr 1fr 1fr 1fr auto; align-items: end; }
}

/* ----- Feature grids ---------------------------------------------------- */
.grid { display: grid; gap: var(--sp-5); }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-5); box-shadow: var(--shadow-sm); }
.card h3 { margin-bottom: var(--sp-2); }
.step-num { font-family: var(--font-mono); font-weight: 700; color: var(--amber-600); font-size: 0.9rem; letter-spacing: 0.1em; }
.icon-chip { width: 46px; height: 46px; border-radius: 12px; background: var(--green-100); color: var(--green-700); display: grid; place-items: center; margin-bottom: var(--sp-4); }
.icon-chip svg { width: 24px; height: 24px; }

/* ----- Trust strip ------------------------------------------------------ */
.trust-strip { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 760px) { .trust-strip { grid-template-columns: repeat(3, 1fr); } }
.trust-item { display: flex; gap: var(--sp-3); align-items: flex-start; }
.trust-item .k { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--white); }

/* ----- Prose (blog / legal) -------------------------------------------- */
.prose { max-width: 68ch; margin-inline: auto; }
.prose h2 { font-size: 1.6rem; margin-top: var(--sp-7); margin-bottom: var(--sp-3); }
.prose h3 { font-size: 1.2rem; margin-top: var(--sp-5); margin-bottom: var(--sp-2); }
.prose p { margin-bottom: var(--sp-4); }
.prose ul, .prose ol { margin: 0 0 var(--sp-4) 1.2em; }
.prose li { margin-bottom: var(--sp-2); }
.prose a { font-weight: 600; }
.article-meta { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin-bottom: var(--sp-5); }
.callout { background: var(--green-50); border-left: 4px solid var(--green-600); border-radius: var(--radius-sm); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); }
.callout--warn { background: var(--amber-100); border-left-color: var(--amber-600); }

/* ----- Blog index cards ------------------------------------------------- */
.post-list { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 760px) { .post-list { grid-template-columns: 1fr 1fr; } }
.post-card { display: flex; flex-direction: column; height: 100%; }
.post-card .tag { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--green-600); font-weight: 700; margin-bottom: var(--sp-2); }
.post-card h3 { margin-bottom: var(--sp-2); }
.post-card p { color: var(--muted); font-size: 0.95rem; margin-bottom: var(--sp-4); }
.post-card .read { margin-top: auto; font-weight: 700; color: var(--green-700); text-decoration: none; }
.post-card .read:hover { text-decoration: underline; }

/* ----- Forms (reserve / list / contact) -------------------------------- */
.form-wrap { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 900px) { .form-wrap { grid-template-columns: 1.2fr 0.8fr; align-items: start; } }
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-6); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.form-note { font-size: 0.9rem; color: var(--muted); }
.summary-card { background: var(--green-700); color: #EAF3ED; border-radius: var(--radius); padding: var(--sp-5); position: sticky; top: 82px; }
.summary-card h3 { color: var(--white); }
.summary-card .row { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid rgba(255,255,255,0.14); font-size: 0.95rem; }
.summary-card .row .v { font-family: var(--font-mono); font-weight: 700; color: var(--white); text-align: right; }
.fee-line { margin-top: var(--sp-4); font-size: 0.88rem; color: #CFE3D7; }
.form-success { display: none; background: var(--green-50); border: 1px solid var(--green-500); border-radius: var(--radius); padding: var(--sp-6); }
.form-success.is-visible { display: block; }
.form-success h3 { color: var(--green-700); margin-bottom: var(--sp-3); }
.req { color: var(--danger); }

/* ----- Footer ----------------------------------------------------------- */
.site-footer { background: var(--green-900); color: #B9CcC2; padding-block: var(--sp-7) var(--sp-6); margin-top: var(--sp-8); }
.footer__grid { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer .brand { color: var(--white); }
.footer__trust { margin-top: var(--sp-3); max-width: 34ch; font-size: 0.92rem; color: #9FB6AB; }
.footer h4 { color: var(--white); font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--sp-3); }
.footer ul { list-style: none; padding: 0; display: grid; gap: var(--sp-2); }
.footer a { color: #B9CCC2; text-decoration: none; font-size: 0.95rem; }
.footer a:hover { color: var(--white); }
.footer__bottom { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid rgba(255,255,255,0.12); display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between; font-size: 0.85rem; color: #8AA398; }
.footer__bottom .text-mono { color: #9FB6AB; }

/* ----- Page header band ------------------------------------------------- */
.page-head { padding-block: var(--sp-7) var(--sp-6); border-bottom: 1px solid var(--line); background: var(--green-50); }
.page-head h1 { max-width: 20ch; }
.page-head p { margin-top: var(--sp-3); max-width: 60ch; color: var(--muted); font-size: 1.1rem; }

/* ----- Misc utilities --------------------------------------------------- */
.stack > * + * { margin-top: var(--sp-4); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.mt-6 { margin-top: var(--sp-6); }
.hidden { display: none !important; }
.split { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; align-items: center; } }
.empty-state { text-align: center; padding: var(--sp-8) var(--sp-5); background: var(--green-50); border: 1px dashed var(--line); border-radius: var(--radius); }
.two-track { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 820px) { .two-track { grid-template-columns: 1fr 1fr; } }
.track { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.track__head { padding: var(--sp-4) var(--sp-5); font-family: var(--font-display); font-weight: 800; color: var(--white); }
.track__head.buyer { background: var(--green-700); }
.track__head.transporter { background: var(--green-900); }
.track__body { padding: var(--sp-5); }
.track__body ol { margin-left: 1.1em; }
.track__body li { margin-bottom: var(--sp-3); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--amber); color: var(--green-900); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); z-index: 100; font-weight: 700; }
.skip-link:focus { left: var(--sp-3); top: var(--sp-3); }
