/* ============================================================
   NorskMedMartin.no — Felles stilark
   Mørk modus standard, lys modus via toggle / prefers-color-scheme
   ============================================================ */

/* ── CSS-VARIABLER ── */
:root {
  --bg-1: #0d1b2a;
  --bg-2: #11263a;
  --surface: #15314a;
  --surface-2: #1b3d5c;
  --border: #234b6d;
  --border-soft: #1c3854;
  --blue: #6aa9d6;
  --blue-soft: #4f8db8;
  --teal: #5fc4b8;
  --green: #8ad29b;
  --amber: #f5c971;
  --rose: #e98ba2;
  --violet: #a48cd9;
  --text: #e7eef5;
  --text-muted: #9bb1c5;
  --text-dim: #6f8aa1;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --radius: 14px;
  --radius-sm: 9px;
  --topbar-bg: rgba(13,27,42,.88);
  --nav-bg: rgba(17,38,58,.6);
}

[data-theme="light"] {
  --bg-1: #f8fafc;
  --bg-2: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #94a3b8;
  --border-soft: #cbd5e1;
  --blue: #2563eb;
  --blue-soft: #3b82f6;
  --teal: #10b981;
  --green: #059669;
  --amber: #d97706;
  --rose: #e11d48;
  --violet: #7c3aed;
  --text: #1e2937;
  --text-muted: #475569;
  --text-dim: #64748b;
  --shadow: 0 8px 24px rgba(0,0,0,.10);
  --topbar-bg: rgba(255,255,255,.92);
  --nav-bg: rgba(241,245,249,.85);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-1: #f8fafc;
    --bg-2: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: #94a3b8;
    --border-soft: #cbd5e1;
    --blue: #2563eb;
    --blue-soft: #3b82f6;
    --teal: #10b981;
    --green: #059669;
    --amber: #d97706;
    --rose: #e11d48;
    --violet: #7c3aed;
    --text: #1e2937;
    --text-muted: #475569;
    --text-dim: #64748b;
    --shadow: 0 8px 24px rgba(0,0,0,.10);
    --topbar-bg: rgba(255,255,255,.92);
    --nav-bg: rgba(241,245,249,.85);
  }
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-1);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  transition: background .25s, color .25s;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 { line-height: 1.25; }

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 1.4rem;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.logo-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6aa9d6, #5fc4b8);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.theme-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: .35rem .65rem;
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.theme-btn:hover { background: var(--surface-2); color: var(--text); }

/* ── NAVIGASJON ── */
.nav-tabs {
  position: relative;
  z-index: 90;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: .5rem 1rem;
  overflow: visible;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  padding: .5rem .9rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s;
}
.nav-tab:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}
.nav-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-soft), var(--teal));
  border-color: rgba(95,196,184,.6);
  box-shadow: 0 2px 12px rgba(95,196,184,.22);
}

.nav-spacer { margin-left: auto; }

/* ── NAV DROPDOWN ── */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger { border: 1px solid transparent; }
.nav-dropdown-trigger:hover { color: var(--text); }
.nav-dropdown-trigger.open {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
}
.nav-dropdown-menu.open { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: .6rem 1rem;
  font-size: .87rem;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--surface-2); color: var(--text); }
.nav-dropdown-menu a.featured { color: var(--blue); font-weight: 600; }

.nav-menu-label {
  color: var(--text-dim);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  padding: .75rem 1rem .3rem;
  text-transform: uppercase;
}

.nav-menu-divider {
  height: 1px;
  background: var(--border-soft);
  margin: .35rem 0;
}

@media (hover: hover) {
  .nav-dropdown:hover .nav-dropdown-trigger {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
  }

  .nav-dropdown:hover .nav-dropdown-menu {
    display: block;
  }
}

.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

/* ── MAIN CONTAINER ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.2rem 4rem;
}

/* ── HERO ── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.hero-text h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: .6rem;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 1.2rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.badge {
  display: inline-block;
  padding: .3rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-blue { background: rgba(106,169,214,.18); color: var(--blue); border: 1px solid rgba(106,169,214,.3); }
.badge-teal { background: rgba(95,196,184,.18); color: var(--teal); border: 1px solid rgba(95,196,184,.3); }
.badge-green { background: rgba(138,210,155,.18); color: var(--green); border: 1px solid rgba(138,210,155,.3); }
.badge-amber { background: rgba(245,201,113,.18); color: var(--amber); border: 1px solid rgba(245,201,113,.3); }
.badge-violet { background: rgba(164,140,217,.18); color: var(--violet); border: 1px solid rgba(164,140,217,.3); }

.hero-img {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 0 0 6px rgba(106,169,214,.15);
}

.hero-classroom-img {
  width: min(360px, 40vw);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
}

/* ── STATS BAR ── */
.mmm-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
}

.stat-chip .stat-icon { font-size: 1.1rem; }
.stat-chip .stat-label { color: var(--text-muted); font-size: .78rem; }
.stat-chip .stat-value { font-weight: 700; color: var(--text); }

/* ── DAGLIG UTFORDRING ── */
.daily-challenge {
  background: linear-gradient(135deg, rgba(95,196,184,.12), rgba(106,169,214,.12));
  border: 1px solid rgba(95,196,184,.3);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.daily-icon { font-size: 2rem; flex-shrink: 0; }

.daily-text h3 { font-size: .95rem; color: var(--teal); margin-bottom: .2rem; }
.daily-text p { font-size: .9rem; color: var(--text-muted); margin: 0; }

.daily-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .5rem 1.1rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  font-family: inherit;
}
.daily-btn:hover { opacity: .85; }

/* ── SEKSJONSKORT-NETT ── */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.topic-filter {
  margin: -0.25rem 0 1rem;
}

.topic-filter input {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .7rem .9rem;
  font: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.topic-filter input:focus {
  outline: 2px solid rgba(106,169,214,.35);
  border-color: var(--blue);
}

.topic-filter input::placeholder {
  color: var(--text-dim);
}

.empty-state {
  color: var(--text-muted);
  font-size: .9rem;
  margin: .5rem 0 1rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--blue);
  text-decoration: none;
}

.topic-emoji { font-size: 2rem; }
.topic-card h3 { font-size: 1rem; font-weight: 700; }
.topic-card p { font-size: .83rem; color: var(--text-muted); margin: 0; }

/* ── SØSTERSIDE-PROMO ── */
.sister-promo {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  margin-top: 2rem;
  text-align: center;
}

.sister-promo h2 { margin-bottom: 1rem; font-size: 1.15rem; }

.sister-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}

.sister-btn {
  display: inline-block;
  padding: .6rem 1.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  transition: background .2s, border-color .2s;
  text-decoration: none;
}
.sister-btn:hover { background: var(--bg-2); border-color: var(--blue); text-decoration: none; }

/* ── TEMSIDE — INNHOLD ── */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  margin-bottom: .5rem;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header .ingress {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 700px;
}

/* ── SEKSJON MED ACCENT ── */
.section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  margin-bottom: 1.5rem;
}

.section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section.accent-blue { border-left: 4px solid var(--blue); }
.section.accent-blue h2 { color: var(--blue); }

.section.accent-green { border-left: 4px solid var(--green); }
.section.accent-green h2 { color: var(--green); }

.section.accent-teal { border-left: 4px solid var(--teal); }
.section.accent-teal h2 { color: var(--teal); }

.section.accent-amber { border-left: 4px solid var(--amber); }
.section.accent-amber h2 { color: var(--amber); }

.section.accent-violet { border-left: 4px solid var(--violet); }
.section.accent-violet h2 { color: var(--violet); }

.section.accent-rose { border-left: 4px solid var(--rose); }
.section.accent-rose h2 { color: var(--rose); }

/* ── EKSEMPEL-BLOKK ── */
.example {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: .75rem 0;
  font-size: .92rem;
}

.example strong { color: var(--blue); }

.example-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: .3rem;
}

/* ── DEFINISJONS-LISTE ── */
.def-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }

.def-list li {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  font-size: .92rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.def-list li:last-child { border-bottom: none; }

.def-term {
  font-weight: 700;
  color: var(--blue);
  min-width: 130px;
  flex-shrink: 0;
}

/* ── STEG-FOR-STEG ── */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: .75rem; }

.step {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}

.step-num {
  counter-increment: step;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content { flex: 1; padding-top: .3rem; font-size: .92rem; }
.step-content strong { color: var(--text); }

.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  padding: .5rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, color .2s;
}
.reveal-btn:hover { background: var(--bg-2); color: var(--text); }

.reveal-content { display: none; margin-top: .75rem; }
.reveal-content.open { display: block; }

/* ── FLIP-KORT ── */
.flipcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.flipcard {
  height: 140px;
  perspective: 800px;
  cursor: pointer;
}

.flipcard-inner {
  position: relative;
  width: 100%; height: 100%;
  transition: transform .45s;
  transform-style: preserve-3d;
}

.flipcard.flipped .flipcard-inner { transform: rotateY(180deg); }

.flipcard-front, .flipcard-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-size: .9rem;
}

.flipcard-front {
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

.flipcard-back {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--blue);
  transform: rotateY(180deg);
  color: var(--text-muted);
  font-size: .85rem;
}

.flipcard-hint {
  position: absolute;
  bottom: .4rem;
  right: .5rem;
  font-size: .65rem;
  color: var(--text-dim);
}

/* ── QUIZ ── */
.quiz-block {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  margin-bottom: 1.5rem;
}

.quiz-block h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.quiz-level-select {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.level-btn {
  padding: .4rem .9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, color .2s, border-color .2s;
}
.level-btn:hover { background: var(--bg-2); color: var(--text); }
.level-btn.active-lett { background: rgba(138,210,155,.2); color: var(--green); border-color: var(--green); }
.level-btn.active-middels { background: rgba(245,201,113,.2); color: var(--amber); border-color: var(--amber); }
.level-btn.active-vanskelig { background: rgba(233,139,162,.2); color: var(--rose); border-color: var(--rose); }

.quiz-progress {
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: .75rem;
}

.quiz-question-text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
  min-height: 2.5rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}

.quiz-option {
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: .92rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .18s, border-color .18s, color .18s;
}
.quiz-option:hover:not(:disabled) { background: var(--bg-2); border-color: var(--blue); }
.quiz-option.correct { background: rgba(138,210,155,.2); border-color: var(--green); color: var(--green); }
.quiz-option.wrong { background: rgba(233,139,162,.15); border-color: var(--rose); color: var(--rose); }
.quiz-option:disabled { cursor: not-allowed; opacity: .8; }

.quiz-feedback {
  font-size: .88rem;
  min-height: 1.5rem;
  margin-bottom: .75rem;
  color: var(--text-muted);
}

.quiz-hint {
  font-size: .83rem;
  color: var(--text-dim);
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: .5rem .8rem;
  margin-bottom: .75rem;
  display: none;
}
.quiz-hint.show { display: block; }

.quiz-nav {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.btn-secondary:hover { background: var(--bg-2); color: var(--text); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { opacity: .88; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { opacity: .88; }

.quiz-result {
  display: none;
  text-align: center;
  padding: 1rem 0;
}
.quiz-result.show { display: block; }

.result-score {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: .3rem;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-label {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 1rem;
}

.quiz-context {
  color: var(--text-muted);
  font-size: .9rem;
  margin: -.45rem 0 1rem;
}

.result-bonus,
.perfect-run {
  color: var(--green);
  font-weight: 700;
  margin-bottom: .75rem;
}

.missed-review {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1rem 0;
}

.missed-review h3 {
  font-size: .95rem;
  margin-bottom: .75rem;
  color: var(--text);
}

.missed-item {
  border-top: 1px solid var(--border-soft);
  padding: .75rem 0 0;
  margin-top: .75rem;
}

.missed-item:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.missed-item strong {
  display: block;
  color: var(--blue);
  font-size: .78rem;
  margin-bottom: .25rem;
}

.missed-item p {
  color: var(--text);
  font-size: .88rem;
  margin-bottom: .2rem;
}

.missed-item span {
  color: var(--text-muted);
  font-size: .82rem;
}

/* ─── EKSAMENSSEKSJON ─── */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.exam-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.15rem;
  color: var(--text);
  text-decoration: none;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.exam-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.exam-card .exam-icon {
  font-size: 1.6rem;
  margin-bottom: .5rem;
}

.exam-card h3 {
  font-size: 1rem;
  margin-bottom: .35rem;
}

.exam-card p {
  color: var(--text-muted);
  font-size: .84rem;
  margin: 0;
}

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: .5rem; }

.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: var(--surface);
  border: none;
  padding: .9rem 1.1rem;
  text-align: left;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  transition: background .2s;
}
.faq-question:hover { background: var(--surface-2); }
.faq-question .faq-icon { font-size: .8rem; color: var(--text-dim); transition: transform .25s; }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: .75rem 1.1rem 1rem;
  font-size: .9rem;
  color: var(--text-muted);
  background: var(--bg-2);
  border-top: 1px solid var(--border-soft);
  line-height: 1.6;
}
.faq-answer.open { display: block; }

/* ── SHARE BAR ── */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 1.5rem 0 1.1rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.share-label {
  font-size: .82rem;
  color: var(--text-dim);
  margin-right: .15rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.share-btn:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--bg-1);
  text-decoration: none;
}

/* ── ALLE QUIZER ── */
.quiz-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.3rem;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.quiz-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--blue); }

.quiz-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.quiz-card p { font-size: .83rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ── RANDOM QUIZ BLOKK ── */
.random-quiz-wrap {
  margin-bottom: 2.5rem;
}

/* ── OM MARTIN ── */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
}

.about-img {
  width: 180px; height: 180px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid var(--border);
}

.about-text h1 { font-size: 1.8rem; margin-bottom: .6rem; }
.about-text p { color: var(--text-muted); margin-bottom: .75rem; }

.about-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.about-gallery figure {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.about-gallery img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.about-gallery figcaption {
  color: var(--text-muted);
  font-size: .86rem;
  padding: .8rem 1rem 1rem;
}

.contact-form {
  display: grid;
  gap: .75rem;
  margin-top: .9rem;
}

.contact-form label {
  display: grid;
  gap: .4rem;
  color: var(--text);
  font-size: .92rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  padding: .7rem .8rem;
  font: inherit;
}

.contact-form textarea {
  min-height: 130px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(95, 196, 184, .16);
}

.contact-form button {
  justify-self: start;
  border: none;
  border-radius: 999px;
  background: var(--teal);
  color: var(--bg-1);
  padding: .7rem 1.4rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}

.contact-form button:hover {
  background: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(95, 196, 184, .35);
}

.form-honeypot {
  display: none;
}

/* ── PERSONVERN ── */
.legal-content h2 { margin: 1.5rem 0 .5rem; color: var(--blue); }
.legal-content p { color: var(--text-muted); margin-bottom: .75rem; font-size: .93rem; }

/* ── PROGRESS BAR ── */
.progress-bar-wrap {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .75rem;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  border-radius: 3px;
  transition: width .3s;
}

/* ── TOAST NOTIFIKASJON ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem 1.2rem;
  font-size: .88rem;
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  max-width: 300px;
  color: var(--text);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── STREAK-BANNER ── */
.streak-banner {
  background: linear-gradient(135deg, rgba(245,201,113,.15), rgba(233,139,162,.1));
  border: 1px solid rgba(245,201,113,.3);
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

/* ── LEVEL BADGE ── */
.level-badge-display {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 700;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 3rem;
  padding: 1.5rem 1.4rem;
  text-align: center;
  color: var(--text-dim);
  font-size: .83rem;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: .5rem;
}

.footer-credit {
  margin-top: .35rem;
}

.footer-credit a {
  color: var(--teal);
}

/* ── RESPONSIVT ── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-img {
    width: 100px; height: 100px;
    margin: 0 auto;
  }
  .hero-classroom-img {
    width: min(100%, 420px);
    margin: 0 auto;
  }
  .hero-badges { justify-content: center; }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-img { margin: 0 auto; }

  .daily-challenge { flex-direction: column; text-align: center; }
  .daily-btn { margin: 0 auto; }

  .quiz-level-select { justify-content: center; }

  .flipcards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .topbar { padding: .5rem 1rem; }
  .topbar-logo span:last-child { display: none; }
}

@media (max-width: 480px) {
  main { padding: 1.2rem .8rem 3rem; }
  .topics-grid { grid-template-columns: 1fr 1fr; }
  .quiz-overview-grid { grid-template-columns: 1fr; }
}

/* ── HJELPEKLASSER ── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.hidden { display: none !important; }

/* ── ANIMASJONER ── */
@keyframes pop-in {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}

.pop-in { animation: pop-in .3s ease; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-up { animation: slide-up .3s ease; }
