:root {
  --site-page-bg: #f8fafc;
  --site-hero-height: 210px;
  --site-hero-bg: linear-gradient(
    135deg,
    #07111f 0%,
    #0a2740 52%,
    #12395a 100%
  );
  --site-accent: #58d4c8;
  --site-eyebrow: #f5a623;
  --site-ink: #212529;
  --task-sidebar-width: 320px;
  --task-panel-border: #dce3e9;
  --task-panel-radius: 16px;
  --task-panel-shadow: 0 10px 28px rgba(20, 36, 56, 0.06);
  --lp-radius: 14px;
  --lp-gap: 12px;
  --lp-muted: #6c757d;
  --lp-border: #e8e8e8;
  --lp-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --lp-card-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
  --lp-hero: #0077ba;
}

/* Jevnere knapper */
.btn-primary {
  border: none;
  box-shadow: 0 6px 18px rgba(13, 110, 253, 0.15);
}
.btn-primary:active {
  transform: translateY(0);
}

/* Kort: mykere hjørner og jevn skygge */
.card {
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-border);
  box-shadow: var(--lp-card-shadow);
}

.concept-card {
  border: 1px solid #e8e8e8 !important;
  border-radius: 8px;
  background: #f8f9fa;
}
.card-placeholder {
  border-style: dashed;
  color: var(--lp-muted);
  background: #f9fafb;
}

.curriculum-heading {
  position: relative;
  display: inline-block;
}

.curriculum-anchor {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  outline: none;
}

.curriculum-heading::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1180;
  background: rgba(248, 250, 252, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
  backdrop-filter: blur(2.5px);
}

.curriculum-anchor::after {
  content: "i";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid rgba(108, 117, 125, 0.35);
  border-radius: 999px;
  color: #6c757d;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: none;
}

.curriculum-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 0.55rem);
  z-index: 1200;
  width: min(34rem, calc(100vw - 2rem));
  padding: 1.05rem 1.1rem;
  border: 1px solid rgba(218, 226, 236, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
  color: #1f2937;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
  backdrop-filter: blur(10px);
}

.curriculum-heading.is-open::before {
  opacity: 1;
}

.curriculum-heading.is-open .curriculum-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.curriculum-popover h5 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.curriculum-intro {
  margin: 0 0 0.85rem;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
}

.curriculum-group {
  display: block;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.curriculum-group:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.curriculum-group strong {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.4rem;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.1);
  color: #0b5ed7;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.curriculum-group ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.curriculum-group li {
  position: relative;
  margin-bottom: 0.38rem;
  padding-left: 0.95rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.42;
}

.curriculum-group li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 999px;
  background: #93c5fd;
}

/* Overskrifter: litt mer luft ned */
h2 {
  font-size: 1.5rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

/* Bedre plassering av toppknapp også på mobil */
@media (max-width: 576px) {
  .auth-topbar {
    right: 4vw;
    top: 12px;
  }
}

/* Penere “Min side”-kortinfo */
.user-info {
  line-height: 1.4;
}
.user-info strong {
  font-weight: 600;
  color: #000;
}
.user-info .text-muted {
  color: var(--lp-muted) !important;
  font-size: 0.9rem;
}
.user-info .text-secondary {
  font-size: 0.85rem;
}

/* Finjuster kort-hover (du har allerede en god base) */
.card-hover {
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.06);
}

/* Skjul navbar og tilbakeknapp ved utskrift (gjelder alle sider unntatt index) */
@media print {
  nav.navbar {
    display: none !important;
  }
  a.btn,
  main a.btn {
    display: none !important;
  }
}

body {
  margin: 0%;
  padding-top: 56px; /* juster etter høyden på navbaren */
  background: var(--site-page-bg);
}

html,
body {
  overscroll-behavior-y: none;
}

.btn {
  border-radius: 10px;
}

footer {
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.auth-topbar {
  position: fixed;
  top: 10px;
  right: 7vw; /* tidligere 12px — bruker prosent for responsivitet */
  z-index: 2000;
}

.auth-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 100%;
  max-width: 420px;
  background: #fff;
  color: #111;
  box-shadow: -12px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 3000;
  border-left: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2990;
  background: rgba(7, 17, 31, 0.56);
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}
.auth-backdrop[hidden] {
  display: none;
}
.auth-backdrop.open {
  opacity: 1;
}
body.auth-open {
  overflow: hidden;
}
@media (min-width: 576px) {
  .auth-panel {
    width: 360px;
  }
}
.auth-panel[hidden] {
  display: none;
}
.auth-panel.open {
  transform: translateX(0);
}
.auth-panel header {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.auth-body {
  padding: 14px 16px;
  overflow: auto;
}
#authError {
  font-size: 0.9rem;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.auth-tab {
  border: 1px solid #ddd;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8f9fa;
  cursor: pointer;
}
.auth-tab.active {
  background: #000;
  color: #fff;
  border-color: #000;
}
.auth-muted {
  color: #6c757d;
  font-size: 0.9rem;
}
.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  margin-bottom: 10px;
  font:
    14px/1.2 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
}
.auth-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.auth-btn.secondary {
  background: #fff;
  color: #111;
}
.auth-msg {
  font-size: 0.9rem;
  margin-top: 6px;
}

/* Gjør navbaren fast øverst */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030; /* over innholdet */
}

#tittel {
  display: inline-block; /* Boksen tilpasser seg teksten */
  background-color: rgb(
    255,
    255,
    255,
    0.8
  ); /* Hvit bakgrunn med litt gjennomsiktighet */
  color: black; /* Sort tekst */
  padding: 0.5rem 1.5rem; /* Luft rundt teksten */
  border-radius: 1.5rem; /* Avrundede kanter */
  font-weight: bold;
}
#info-tekst {
  display: inline-block; /* Boksen tilpasser seg teksten */
  background-color: rgb(
    255,
    255,
    255,
    0.8
  ); /* Hvit bakgrunn med litt gjennomsiktighet */
  color: black; /* Sort tekst */
  padding: 0.5rem 1.5rem; /* Luft rundt teksten */
  border-radius: 1.5rem; /* Avrundede kanter */
}

.overskrift {
  color: #f6f9ff;
  font-family: "Sora", "Roboto", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.shadow-sm-sm {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.04);
}

/* Skip-link */
.visually-hidden-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h3.h6 {
  line-height: 1.3;
}

/* Responsiv luft over footer */
main {
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  main {
    margin-bottom: 2rem;
  }
}
@media (min-width: 1200px) {
  main {
    margin-bottom: 2rem;
  }
}
footer {
  margin-top: 2rem;
}

/* Komfortabel luft i kortene */
.card .card-body {
  padding: 1.25rem 1.25rem 1.5rem; /* mer luft */
}

/* Litt større overskrifter og avstand */
.card-body h3 {
  font-size: 1.2rem; /* øk fra 1.1 til 1.2 */
  margin-bottom: 12px; /* litt mer luft under */
}

/* Forsiden: 9,75 % mindre tekst (to reduksjoner på 5 %) under hero, også der størrelsen er satt i rem. */
.home-page #kategorier {
  font-size: 0.9025rem;
}

.home-page #kategorier h2 {
  font-size: calc(1.5rem * 0.9025);
}

.home-page #kategorier .card-body h3 {
  font-size: calc(1.2rem * 0.9025);
}

/* Beskrivelsene i oppgavekortene får 1 px større tekst. */
.home-page #kategorier .card-body p.small {
  font-size: calc(0.875em + 1px);
}

.home-page #kategorier h4.h6 {
  font-size: 0.9025rem;
}

.home-page #kategorier .btn {
  font-size: calc(var(--bs-btn-font-size) * 0.9025);
}

.home-page #kategorier .curriculum-anchor::after {
  font-size: calc(0.68rem * 0.9025);
}

.home-page #kategorier .curriculum-popover h5 {
  font-size: calc(0.95rem * 0.9025);
}

.home-page #kategorier .curriculum-intro {
  font-size: calc(0.84rem * 0.9025);
}

.home-page #kategorier .curriculum-group strong {
  font-size: calc(0.7rem * 0.9025);
}

.home-page #kategorier .curriculum-group li {
  font-size: calc(0.82rem * 0.9025);
}

/* Luft over knappen */
.card-body .mt-auto {
  margin-top: 12px;
}

/* Gjør kolonnene litt mer fleksible på store skjermer */
@media (min-width: 1200px) {
  .row [class*="col-"].col-lg-4 {
    flex: 1 1 320px !important; /* kan bli bredere ved behov */
    max-width: 100% !important;
  }
}

.navbar .btn.btn-outline-light {
  border-width: 1px;
}

.user-info-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px 14px;
}
.user-info .badge {
  font-size: 0.75rem;
}

/* Hero */
.hero {
  position: static;
  background: var(--site-hero-bg);
  height: var(--site-hero-height);
  min-height: var(--site-hero-height);
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-title {
  color: #f5f8fd;
  font:
    700 clamp(1.85rem, 2.8vw, 3rem) / 1.08 "Sora",
    "Roboto",
    system-ui,
    sans-serif;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  color: rgba(227, 236, 247, 0.92);
  max-width: 62ch;
  font-size: clamp(1rem, 1.2vw, 1.08rem);
}

@media (max-width: 576px) {
  .hero-title {
    font-size: clamp(1.3rem, 5.6vw, 1.7rem);
    line-height: 1.14;
  }

  .hero .container {
    padding-top: 1.8rem !important;
    padding-bottom: 1.8rem !important;
  }
}

#adminLink[hidden],
#learnERLink[hidden] {
  display: none !important;
}

/* Gi adminlenkene plass til å bryte linje på små skjermer. */
@media (max-width: 767px) {
  .home-page {
    padding-top: 0;
  }
  .home-page .navbar {
    position: relative;
  }
  .home-page .navbar .container {
    flex-wrap: wrap;
    gap: 8px;
  }
  .home-page .auth-topbar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .home-page .auth-topbar .ms-2 {
    margin-left: 0 !important;
  }
  :is(.home-page, .er-page, .oop-page)
    #authOpenBtn:not([data-logged-in="true"]) {
    display: none;
  }
}

/* Felles sidebredde for forside, oppgaver, learn-ER og learn-OOP. */
:root {
  --site-gutter: clamp(16px, 4vw, 72px);
  --site-max-width: 1800px;
}
.site-shell,
.container.site-shell {
  width: calc(100% - 2 * var(--site-gutter));
  max-width: var(--site-max-width);
  margin-inline: auto;
  padding-inline: 0;
}
.site-nav .site-shell {
  flex-wrap: wrap;
  gap: 8px;
}
.site-nav .auth-topbar {
  position: static;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.site-nav .auth-topbar .ms-2 {
  margin-left: 0 !important;
}
.tool-eyebrow {
  color: var(--site-eyebrow);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}
@media (max-width: 767px) {
  .home-page,
  .admin-page,
  .er-page {
    padding-top: 0;
  }
  .site-nav {
    position: relative;
  }
}
.site-brands {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  flex-shrink: 0;
}
.site-brands .navbar-brand {
  margin-right: 0;
}
.site-brands .navbar-brand[aria-current="page"] { color: var(--site-accent) !important; }
.site-brand-divider {
  width: 1px;
  height: 23px;
  background: #ffffff45;
}
.site-brands a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Navigation added to standalone resource pages. */

/* Felles innloggingsvisning på verktøysidene. */
.access-gate {
  display: grid;
  min-height: 40vh;
  margin-block: 2rem;
  place-items: center;
}
.access-gate[hidden] {
  display: none !important;
}
.access-gate-card {
  width: min(100%, 720px);
  padding: 28px;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Ubuntu,
    Cantarell,
    "Noto Sans",
    sans-serif;
  text-align: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.access-gate-icon {
  font-size: 48px;
  line-height: 1;
}
.access-gate-card h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.15rem, 4.6vw, 1.35rem);
  color: #212529 !important;
}
.access-gate-card p {
  margin: 0 0 16px;
  color: #475569;
}
.access-gate-card .btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
}
.access-gate-school {
  color: #000;
  text-decoration: none;
}
.access-gate-school:hover {
  text-decoration: underline;
}

/* Felles struktur i venstre oppgavekolonne for learn-ER og learn-OOP. */
.task-sidebar-kicker {
  color: #087a72;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
}
.task-search-wrap {
  position: relative;
}
.task-search-wrap i {
  color: #75808d;
  left: 13px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.task-search-wrap .form-control {
  border-color: #d8dfe5;
  border-radius: 10px;
  padding: 0.7rem 0.8rem 0.7rem 2.35rem;
}
