/* Lys bakgrunn. Mørk er standard og ligger i sidens egne stiler. */

html[data-theme="light"] {
  color-scheme: light;
  --bg-deep: #eef3f8;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-hover: #e7eef5;
  --border: rgba(15, 61, 90, 0.16);
  --text: #1c2833;
  --text-muted: #4d6172;
  --accent: #0c6484;
  --accent-soft: rgba(12, 100, 132, 0.12);
  --gold: #9a6700;
  --gold-soft: rgba(154, 103, 0, 0.12);
  --success-soft: rgba(6, 95, 70, 0.12);
  --error-soft: rgba(153, 27, 27, 0.1);
  --qualitative: #6d28d9;
  --quantitative: #b45309;
  --ot: #0369a1;
  --law: #047857;
  --nis2: #b45309;
  --cra: #7e22ce;
}

html[data-theme="light"] body {
  background: linear-gradient(165deg, #f7fafc 0%, #eef3f8 48%, #f4f7fb 100%);
  background-attachment: fixed;
  color: var(--text);
}

html[data-theme="light"] .backdrop {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(12, 100, 132, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(126, 34, 206, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 60%, rgba(4, 120, 87, 0.07), transparent 45%),
    linear-gradient(180deg, #f7fafc 0%, #eef3f8 40%, #e8eef5 100%);
}

html[data-theme="light"] .grid-overlay {
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(15, 61, 90, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 61, 90, 0.07) 1px, transparent 1px);
}

html[data-theme="light"] .pulse-line {
  background: linear-gradient(180deg, transparent, rgba(12, 100, 132, 0.28) 30%, rgba(12, 100, 132, 0.28) 70%, transparent);
}

html[data-theme="light"] .welcome-overlay {
  background: rgba(238, 243, 248, 0.82);
}

html[data-theme="light"] .welcome-dialog {
  background: linear-gradient(160deg, #ffffff 0%, #f4f7fb 100%);
  box-shadow: 0 24px 64px rgba(15, 40, 60, 0.16);
}

html[data-theme="light"] .welcome-title {
  color: #1c2833;
}

html[data-theme="light"] .welcome-close {
  color: #4d6172;
  background: rgba(15, 61, 90, 0.06);
  border-color: rgba(15, 61, 90, 0.14);
}

html[data-theme="light"] .tag {
  background: rgba(15, 61, 90, 0.05);
  border-color: rgba(15, 61, 90, 0.12);
  color: #4d6172;
}

html[data-theme="light"] .footer-hint {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .school {
  color: #5c7080;
}

html[data-theme="light"] .module-card:active {
  background: #ffffff;
}

html[data-theme="light"] .ot-nav {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(15, 61, 90, 0.12);
}

html[data-theme="light"] .ot-nav-portal {
  color: #9a6700;
  border-color: rgba(154, 103, 0, 0.4);
}

html[data-theme="light"] .ot-nav-portal:hover,
html[data-theme="light"] .ot-nav-portal:focus-visible {
  background: rgba(154, 103, 0, 0.1);
}

html[data-theme="light"] .ot-nav-home {
  color: #0c6484;
  border-color: rgba(12, 100, 132, 0.35);
}

html[data-theme="light"] .ot-nav-link {
  color: #4d6172;
  border-color: rgba(15, 61, 90, 0.16);
}

html[data-theme="light"] .ot-nav-link:hover,
html[data-theme="light"] .ot-nav-link:focus-visible {
  color: #1c2833;
  background: rgba(15, 61, 90, 0.05);
}

html[data-theme="light"] .ot-nav-link[aria-current="page"] {
  color: #9a6700;
  background: rgba(154, 103, 0, 0.1);
}

html[data-theme="light"] .option-btn {
  background: #f7fafc;
}

html[data-theme="light"] .option-btn.correct,
html[data-theme="light"] .feedback.success {
  color: #065f46;
}

html[data-theme="light"] .option-btn.wrong,
html[data-theme="light"] .feedback.error {
  color: #991b1b;
}

html[data-theme="light"] .reinforcement-hint {
  color: #047857;
}

@media (max-width: 640px) {
  html[data-theme="light"] .nav-buttons {
    background: linear-gradient(to top, rgba(244, 247, 251, 0.98) 70%, rgba(244, 247, 251, 0));
  }
}

html[data-theme="light"] .flip-app {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(220, 232, 240, 0.95), transparent 60%),
    #e7eef5;
}

html[data-theme="light"] .flip-toolbar {
  background: #f7fafc;
  color: #1c2833;
  box-shadow: 0 1px 0 rgba(15, 61, 90, 0.12);
}

html[data-theme="light"] .flip-toolbar-link,
html[data-theme="light"] .flip-toolbar-page,
html[data-theme="light"] .flip-btn {
  color: #1c2833;
  border-color: rgba(15, 61, 90, 0.22);
}

html[data-theme="light"] .flip-toolbar-link:hover,
html[data-theme="light"] .flip-btn:hover {
  background: rgba(15, 61, 90, 0.08);
}

html[data-theme="light"] .flip-mobile-hint {
  background: rgba(154, 103, 0, 0.12);
  color: #1c2833;
}

html[data-theme="light"] .flip-mobile-hint a {
  color: #0c6484;
}

.theme-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.theme-bar .logo {
  display: block;
  height: 36px;
  width: auto;
}

.theme-bar a {
  color: #fbbf24;
  font-weight: 700;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.theme-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.theme-bar a:hover,
.theme-bar a:focus-visible {
  text-decoration: underline;
}

html[data-theme="light"] .theme-bar a {
  color: #9a6700;
}

.hero p.ansvar {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.theme-toggle {
  margin-left: auto;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(77, 184, 232, 0.45);
  background: rgba(77, 184, 232, 0.12);
  color: #7dd3f5;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: rgba(77, 184, 232, 0.22);
  outline: none;
}

html[data-theme="light"] .theme-toggle {
  border-color: rgba(12, 100, 132, 0.35);
  background: #ffffff;
  color: #0c6484;
}

html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .theme-toggle:focus-visible {
  background: rgba(12, 100, 132, 0.08);
}

.flip-toolbar .theme-toggle {
  margin-left: 0;
  min-height: 2.25rem;
  color: #7dd3f5;
}

html[data-theme="light"] .flip-toolbar .theme-toggle {
  color: #0c6484;
}
