/* Företagsverktyg – one shared stylesheet. Mobile first, system fonts. */
:root {
  --bg: #ffffff;
  --surface: #f4f7fb;
  --text: #17202a;
  --muted: #55606c;
  --primary: #0b5cab;
  --primary-text: #ffffff;
  --border: #d5dde6;
  --ok: #17703a;
  --bad: #b3261e;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --surface: #1a222b;
    --text: #e8edf2;
    --muted: #a3afbb;
    --primary: #5aa5f0;
    --primary-text: #07121d;
    --border: #2f3b47;
    --ok: #5fd08a;
    --bad: #ff8a80;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--font);
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-underline-offset: 2px; }

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

.container { width: min(100% - 2rem, 72rem); margin-inline: auto; }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.75rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-header nav a { color: var(--text); text-decoration: none; padding: 0.25rem 0.1rem; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--primary); }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 0.25rem; }

/* Prose */
main { padding-block: 0.5rem 3rem; }
.page h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 1rem 0; }
.page h2 { font-size: 1.4rem; line-height: 1.3; margin: 2rem 0 0.5rem; }
.page h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.page p, .page ul, .page ol, .page dl, .page details { max-width: 72ch; }
.small, .checked { font-size: 0.9rem; color: var(--muted); }

/* Calculator cards */
.card, form.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}

.fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

label { display: block; font-weight: 600; font-size: 0.95rem; }
label.inline { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.hint { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); }

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-size: 1rem; /* 16px minimum avoids zoom on iOS */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

input[type="checkbox"], input[type="radio"] { display: inline-block; width: 1.1rem; height: 1.1rem; margin: 0; }

/* Result panel */
.result {
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}
.result .big { font-size: 1.6rem; font-weight: 700; }
.error { color: var(--bad); font-weight: 600; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

/* Buttons */
.btn, button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--primary-text);
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.btn.secondary, button.secondary { color: var(--primary); background: transparent; border: 2px solid var(--primary); }
.btn[disabled], button[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-variant-numeric: tabular-nums; }
th, td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
thead th { background: var(--surface); }
.table-wrap { overflow-x: auto; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.9rem; margin: 0.5rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: 0.4rem; }

/* Lists of tools / guides */
.tool-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); list-style: none; padding: 0; max-width: none; }

/* Partner box and checklists */
.partner-box { border: 1px dashed var(--border); border-radius: var(--radius); padding: 0.5rem 1rem; margin: 2rem 0; }
.badge { display: inline-block; padding: 0 0.4rem; font-size: 0.75rem; font-weight: 700; border: 1px solid var(--muted); border-radius: 4px; color: var(--muted); }
.checklist { list-style: none; padding: 0; }
.checklist li::before { content: "✗ "; color: var(--bad); font-weight: 700; }
.checklist li.ok::before { content: "✓ "; color: var(--ok); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.site-footer a { color: var(--muted); }

@media (min-width: 48em) {
  .card, form.calc { padding: 1.5rem; }
}

/* Print: only .print-area when the page has one; otherwise just drop chrome. */
@media print {
  .site-header, .site-footer, .breadcrumbs, form, .no-print, .faq, .partner-box { display: none !important; }
  body { background: #fff; color: #000; }
  body:has(.print-area) * { visibility: hidden; }
  body:has(.print-area) .print-area, body:has(.print-area) .print-area * { visibility: visible; }
  body:has(.print-area) .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  a { color: inherit; text-decoration: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.checklist li.group::before { content: ""; }
.checklist li.warn::before { content: "• "; color: var(--muted); font-weight: 700; }
