/* ==========================================================================
   SBRI — design system
   ========================================================================== */

:root {
  --color-primary: #1c3626;
  --color-primary-dark: #122318;
  --color-primary-light: #3e7753;
  --color-accent: #5aa977;
  --color-mint: #e8f3ec;
  --color-mint-border: #cfe6da;
  --color-ink: #16201a;
  --color-muted: #5b6b63;
  --color-border: #e2e9e4;
  --color-surface: #f6faf7;
  --color-bg: #ffffff;
  --color-danger: #9b2c2c;
  --color-danger-bg: #fbeaea;
  --color-success: #1c3626;
  --color-success-bg: #e8f3ec;

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container-width: 1140px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 32, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(22, 32, 26, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
  color: var(--color-ink);
  overflow-wrap: break-word;
}

h1 { font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.75rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1.0625rem; }

p { margin: 0 0 1em; overflow-wrap: break-word; }

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

ul { margin: 0; padding: 0; }
li { list-style: none; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--color-muted); }

/* ------------------------------ Buttons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-base);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { text-decoration: none; }

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

.btn-primary:hover { background: var(--color-primary-dark); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: transparent;
  color: var(--color-primary);
}

.btn-sm { padding: 7px 16px; font-size: 0.875rem; }
.btn-block { width: 100%; justify-content: center; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-arrow svg { flex-shrink: 0; }

/* ------------------------------- Header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--color-border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
}

.brand { display: flex; align-items: center; }
.brand-logo { height: 32px; width: auto; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 0 7px;
  background: var(--color-ink);
  border-radius: 2px;
}

.nav-collapse {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-ink);
}

.nav-links a:hover { color: var(--color-primary); text-decoration: none; }
.nav-links a.active { color: var(--color-primary); font-weight: 700; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav-collapse {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 220px;
    flex-direction: column;
    align-items: flex-end;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 16px 20px 20px;
    display: none;
  }

  .nav-collapse.is-open { display: flex; }

  .nav-links { flex-direction: column; align-items: flex-end; gap: 14px; }
}

/* -------------------------------- Hero ---------------------------------- */

.hero {
  background: var(--color-mint);
  border-bottom: 1px solid var(--color-mint-border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 420px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 48px 56px 0;
}

.hero-content p { font-size: 1.0625rem; color: var(--color-muted); max-width: 46ch; }

.hero-media {
  background-size: cover;
  background-position: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-content { padding: 40px 0; }
  .hero-media { height: 220px; order: -1; }
}

/* ------------------------------ Sections -------------------------------- */

.section { padding: 48px 0; }
.section-tight { padding: 24px 0; }

.section-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 20px;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.feature-row > * { min-width: 0; }

.feature-row + .feature-row { margin-top: 56px; }
.feature-row--wide { grid-template-columns: 2fr 1fr; }

@media (max-width: 860px) {
  .feature-row { grid-template-columns: 1fr; gap: 24px; }
}

/* -------------------------------- Cards ---------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--color-mint);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  text-align: center;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.link-list h6 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.link-list .sub-links { font-size: 0.9375rem; color: var(--color-muted); margin: 0 0 20px; }
.link-list .sub-links a { color: var(--color-muted); }
.link-list .sub-links a:hover { color: var(--color-primary); }

/* -------------------------------- Graphs --------------------------------- */

.graph {
  background: var(--color-mint);
  border-radius: var(--radius-md);
  padding: 20px;
}

.graph .line { fill: none; stroke: var(--color-primary); stroke-width: 1.5; }
.graph .dot { fill: var(--color-primary); }
.graph .x-axis, .graph .y-axis { font-size: 12px; fill: var(--color-muted); font-family: var(--font-base); }
.graph .x-label { text-anchor: middle; }
.graph .y-label { text-anchor: end; }

/* ------------------------------- Timeline -------------------------------- */

.timeline {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 48px;
  border-left: 3px solid var(--color-mint-border);
}

.timeline-item {
  position: relative;
  background: var(--color-mint);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 18px;
}

.timeline-item::before {
  content: attr(data-step);
  position: absolute;
  left: -66px;
  top: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.timeline-item h4 { margin-bottom: 4px; font-size: 1rem; }
.timeline-item p { margin: 0; font-size: 0.9375rem; color: var(--color-muted); }

@media (max-width: 560px) {
  .timeline { padding-left: 32px; }
  .timeline-item::before { left: -50px; width: 30px; height: 30px; font-size: 0.875rem; }
}

/* --------------------------------- CTA ------------------------------------ */

.cta {
  text-align: center;
  padding: 40px 24px;
}

.cta p { font-size: 1.0625rem; margin-bottom: 0; }

/* -------------------------------- Forms ------------------------------------ */

.form-panel {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 460px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-ink);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 11px 12px;
  font-family: var(--font-base);
  font-size: 0.9375rem;
  color: var(--color-ink);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(28, 54, 38, 0.12);
}

textarea { resize: vertical; min-height: 110px; }

.split-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
}

.split-form-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}

.split-form-aside {
  background-size: cover;
  background-position: center;
}

.split-form-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: var(--color-mint);
}

.split-form-note h5 { margin-bottom: 10px; }

@media (max-width: 860px) {
  .split-form, .hero-grid { grid-template-columns: 1fr; }
  .split-form-aside { height: 200px; order: -1; }
  .split-form-content, .split-form-note { padding: 32px 0; }
}

/* -------------------------------- Alerts ----------------------------------- */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-top: 14px;
}

.alert-success, .alert-message { background: var(--color-success-bg); color: var(--color-success); }
.alert-error, .alert-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.alert-info, .alert-warning { background: var(--color-mint); color: var(--color-ink); }

/* -------------------------------- Footer ------------------------------------ */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.footer-links a { color: var(--color-muted); }
.footer-links a:hover { color: var(--color-primary); }
.footer-links span { margin: 0 8px; }

/* ----------------------------- Utility layout -------------------------------- */

.lead { font-size: 1.0625rem; color: var(--color-muted); max-width: 70ch; }

.bullets { padding-left: 20px; margin-bottom: 1em; }
.bullets li { list-style: disc; }

.center-col {
  max-width: 760px;
  margin: 0 auto;
}

.text-center { text-align: center; }

/* ------------------------------ Mobile-compat hooks for the design-canvas pages -----
   main.html / laneupphandling.html / kontakta_oss.html / statistik.html are ported
   near-verbatim (inline styles) from fixed-width 1440px mockups. These utility classes
   are added alongside the inline styles, purely to make those literal layouts stack on
   small screens; they don't carry any of the mockups' own visual styling. */

.mp-grid > *, .mp-grid-2 > * { min-width: 0; }

/* These ported pages come from mockups whose body never set a line-height, so most
   of their text relies on the browser default. The site's body sets 1.6 and headings
   1.25; inherit "normal" here instead so unset text matches the mockup - any element
   that DOES set its own inline line-height still wins (inline beats inherited). */
.literal-port { line-height: normal; }

@media (max-width: 860px) {
  .mp-grid { grid-template-columns: 1fr !important; }
  .mp-grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
  .mp-cols1 { columns: 1 !important; }
  .mp-skyline { aspect-ratio: 16 / 9 !important; min-height: 0 !important; }
  .mp-panorama { height: 120px !important; }
}


@media (max-width: 480px) {
  .literal-port > section,
  .literal-port > div,
  .mp-panorama {
    padding-left: 11px !important;
    padding-right: 11px !important;
    margin-left: 11px !important;
    margin-right: 11px !important;
  }
}