/* Norsk Kalkulator — moderne stil (2026)
 * Farger: dyp marine + teal aksent, norsk rød som diskret detalj.
 * Ren CSS, ingen rammeverk. Mobil-først, responsivt. */
:root {
  --navy: #0e2a47;
  --navy-2: #12395b;
  --navy-3: #1b4a73;
  --accent: #0d9488;
  --accent-bright: #14b8a6;
  --accent-soft: #e6f5f2;
  --accent-ink: #0b6e63;
  --red: #ba0c2f;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --text: #16283a;
  --muted: #5a6d80;
  --border: #dde6ee;
  --border-strong: #b9c9d6;
  --shadow-sm: 0 1px 2px rgba(14, 42, 71, 0.06), 0 2px 8px rgba(14, 42, 71, 0.05);
  --shadow-md: 0 2px 6px rgba(14, 42, 71, 0.07), 0 12px 32px rgba(14, 42, 71, 0.10);
  --shadow-lg: 0 4px 10px rgba(14, 42, 71, 0.08), 0 20px 48px rgba(14, 42, 71, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(20, 184, 166, 0.28); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- animasjoner ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes resultFlash {
  0% { background: rgba(20, 184, 166, 0.28); }
  100% { background: transparent; }
}
main { animation: fadeUp 0.45s ease both; }
.cat-card { animation: fadeUp 0.5s ease both; }
.cat-card:nth-child(2) { animation-delay: 0.05s; }
.cat-card:nth-child(3) { animation-delay: 0.10s; }
.cat-card:nth-child(4) { animation-delay: 0.15s; }
.cat-card:nth-child(5) { animation-delay: 0.20s; }
.cat-card:nth-child(6) { animation-delay: 0.25s; }
.cat-card:nth-child(7) { animation-delay: 0.30s; }
.cat-card:nth-child(8) { animation-delay: 0.35s; }

/* ---------- header ---------- */
header.site {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 70%, var(--navy-3) 100%);
  color: #fff;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(14, 42, 71, 0.28);
  border-bottom: 3px solid var(--accent-bright);
}
header.site .wrap {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
}
header.site .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
header.site .logo:hover { text-decoration: none; opacity: 0.94; }
.logo-mark { flex: none; display: block; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); transition: transform 0.25s ease; }
a.logo:hover .logo-mark { transform: translateY(-2px) rotate(-2deg); }
.logo-text { white-space: nowrap; }
.logo-text em { font-style: normal; color: var(--accent-bright); }
header.site nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
header.site nav a {
  color: #d7e5f0;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
header.site nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.14); text-decoration: none; }

/* ---------- layout ---------- */
main { max-width: 1024px; margin: 0 auto; padding: 28px 20px 56px; }
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--navy); }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin: 36px 0 14px; color: var(--navy); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 68ch; }
.lead.hero { font-size: 1.25rem; color: #33475c; }
.lead.hero strong { color: var(--navy); }

/* ---------- kategorikort ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin: 28px 0; }
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  display: block;
  color: inherit;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.cat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-bright), #2563eb 70%, var(--navy-2));
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-bright);
  text-decoration: none;
}
.cat-card h3 { margin: 0 0 6px; font-size: 1.2rem; color: var(--navy); letter-spacing: -0.01em; }
.cat-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.cat-card p:last-child { margin-top: 10px; font-weight: 700; font-size: 0.88rem; color: var(--accent-ink); }

/* ---------- kalkulatorliste + søk ---------- */
.calc-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 40px; }
.calc-list li { break-inside: avoid; margin-bottom: 8px; }
.calc-list a { transition: color 0.15s ease; }
.calc-list a:hover { color: var(--accent); }
@media (max-width: 720px) { .calc-list { columns: 1; } }
#sok {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  margin: 18px 0 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#sok:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.22);
}
#sok-teller { color: var(--muted); font-size: 0.92rem; margin: 0 0 4px; }

/* ---------- kalkulatorboks ---------- */
.calc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.calc-box label { display: block; font-weight: 600; margin: 16px 0 6px; color: var(--navy); }
.calc-box label:first-child { margin-top: 0; }
.calc-box input[type="number"],
.calc-box select {
  width: 100%;
  max-width: 360px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.calc-box input[type="number"]:hover,
.calc-box select:hover { border-color: #8fa9bd; }
.calc-box input[type="number"]:focus,
.calc-box select:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.22);
  background: #fff;
}
.calc-box .enhet { color: var(--muted); font-weight: 400; font-size: 0.9rem; }

/* ---------- resultater ---------- */
.resultater {
  background: var(--accent-soft);
  border: 1px solid #bfe3dd;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.resultater h2 { margin-top: 0; color: var(--accent-ink); }
.resultat-rad {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #cde8e2;
  font-size: 1.05rem;
}
.resultat-rad:last-child { border-bottom: none; }
.resultat-rad strong {
  font-size: 1.2rem;
  color: var(--accent-ink);
  white-space: nowrap;
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: -6px;
}
.resultat-rad strong.flash { animation: resultFlash 0.8s ease; }

/* ---------- diverse ---------- */
.ansvar {
  background: #fff8e1;
  border: 1px solid #f0d48a;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: #5d4a00;
}
.brodsmuler { font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; }
.brodsmuler a { font-weight: 600; }
.relaterte { columns: 2; column-gap: 40px; list-style: none; padding: 0; }
.relaterte li { break-inside: avoid; margin-bottom: 8px; }
@media (max-width: 720px) { .relaterte { columns: 1; } }
footer.site {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cfe3f2;
  padding: 32px 0;
  font-size: 0.92rem;
  border-top: 3px solid var(--accent-bright);
}
footer.site .wrap { max-width: 1024px; margin: 0 auto; padding: 0 20px; }
footer.site .foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
footer.site .foot-brand em { font-style: normal; color: var(--accent-bright); }
footer.site a { color: #fff; }
footer.site p { margin: 0 0 6px; max-width: 72ch; }

/* ---------- mobil ---------- */
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  main { padding: 20px 16px 44px; }
  header.site .wrap { padding: 0 16px; }
  header.site .logo { font-size: 1.2rem; }
  .calc-box, .resultater { padding: 18px; }
  .cat-grid { gap: 14px; }
}

/* ---------- redusert bevegelse ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
