html, body {
  background: var(--bg);
  color: var(--text);
}
/* THEME OVERRIDES MUST BE LAST FOR PROPER CASCADE */
:root.theme-light {
  --bg: #ffffff;
  --text: #111111;
  --surface: #ffffff;
  --muted: #666666;
  --overlay: rgba(0,0,0,0.45);
  --primary: #44637d;
  --info-bg: #f7f7f7;
}

:root.theme-dark {
  --bg: #0b0b0c;
  --text: #e6edf0;
  --surface: #0f1416;
  --muted: #9aa6ad;
  --overlay: rgba(0,0,0,0.6);
  --primary: #44637d;
  --info-bg: #181c1f;
}
.backdrop, .dialog {
  font-family: Montserrat, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
/* Light theme override for toggling */

/* moved to bottom for correct override */
/* fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap');

/* CSS variables — one per line */
:root{
  --bg: #ffffff;
  --text: #111111;
  --surface: #ffffff;
  --muted: #666666;
  --overlay: rgba(0,0,0,0.45);
  --primary: #44637d;
  /* info box background (adapts to theme) */
  --info-bg: #f7f7f7;
  /* sizes */
  --dialog-padding: 20px;
  --dialog-radius: 10px;
  --dialog-maxwidth: 720px;
  --dialog-width: 88%;
  --dialog-shadow: 0 12px 40px rgba(0,0,0,0.25);
  --input-border: 1px solid #ddd;
  --vipps-color: #FF5A00;
  --accent-dark: #443a4f;
  /* svg font sizes */
  --fs-xxl: 260px;
  --fs-xl: 145px;
  --fs-md: 65px;
  --fs-sm: 20px;
  /* toggle */
  --toggle-width: 52px;
  --toggle-height: 30px;
  --toggle-padding: 3px;
  --knob-size: 24px;
  --knob-translate: 22px;
  --toggle-bg: #ddd;
  --knob-bg: #fff;
}


/* moved to bottom for correct override */
/* THEME OVERRIDES MUST BE LAST FOR PROPER CASCADE */
:root.theme-light {
  --bg: #ffffff;
  --text: #111111;
  --surface: #ffffff;
  --muted: #666666;
  --overlay: rgba(0,0,0,0.45);
  --primary: #44637d;
  --info-bg: #f7f7f7;
}

:root.theme-dark {
  --bg: #0b0b0c;
  --text: #e6edf0;
  --surface: #0f1416;
  --muted: #9aa6ad;
  --overlay: rgba(0,0,0,0.6);
  --primary: #44637d;
}

/* overlays & dialogs */
.sr-only{
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.backdrop {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  z-index: 10010;
}

.backdrop.hidden{ display: none; }

.dialog{
  background: var(--surface);
  color: var(--text);
  padding: var(--dialog-padding);
  border-radius: var(--dialog-radius);
  max-width: var(--dialog-maxwidth);
  width: var(--dialog-width);
  box-shadow: var(--dialog-shadow);
  position: relative;
  z-index: 10020;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dialog h2, .dialog h3{
  margin: 0 0 12px 0; 
  font-weight: 700;
  color: var(--primary);
}

.dialog p{
  margin: 0 0 12px 0; line-height: 1.5;
  font-weight: 400;
}

.dialog .close{
  position: absolute; right: 12px; top: 12px;
  background: #eee; border: 0; padding: 6px 10px;
  border-radius: 6px; cursor: pointer;
}

/* login */
/* login box: use relative width rather than fixed px */
#login-box{
  width: min(88%, 42rem);
  padding: var(--dialog-padding);
}

#login-box label{
  display: block; font-size: 13px;
  margin-bottom: 6px; font-weight: 600;
}

#login-box input{
  width: 60%; padding: 8px 10px;
  margin-bottom: 12px; border: var(--input-border);
  border-radius: 6px; font-size: 14px;
}

.info-toggle{
  background: transparent; border: 0;
  color: var(--primary);
  text-decoration: underline; cursor: pointer;
  padding: 0; font-weight: 600;
}

#login-info{
  background: var(--info-bg); padding: 10px;
  border-radius: 6px; font-size: 14px;
}

#login-info.hidden{ display: none; }

.vipps-btn{
  background: var(--vipps-color); color: #fff;
  border: 0; padding: 8px 12px;
  border-radius: 8px; cursor: pointer;
  font-weight: 700;
}

.primary{
  background: var(--primary); color: #fff;
  border: 0; padding: 8px 12px;
  border-radius: 8px; cursor: pointer;
  font-weight: 700;
}

.row{ display: flex; gap: 12px; align-items: center; }

.muted{ color: var(--muted); }

/* theme toggle */
.theme-toggle{
  position: fixed; right: 16px; bottom: 16px;
  z-index: 10001; display: flex;
  align-items: center; gap: 8px;
}

.theme-toggle .switch{
  width: var(--toggle-width);
  height: var(--toggle-height);
  border-radius: calc(var(--toggle-height) / 2);
  background: var(--toggle-bg);
  display: inline-block; position: relative;
  cursor: pointer; border: 0; padding: 0;
}

.theme-toggle .switch .knob{
  position: absolute; top: var(--toggle-padding);
  left: var(--toggle-padding);
  width: var(--knob-size); height: var(--knob-size);
  border-radius: 50%; background: var(--knob-bg);
  transition: transform .18s;
}

.theme-toggle .switch[aria-checked="true"],
.theme-toggle .switch.on{
  background: var(--primary);
}

.theme-toggle .switch[aria-checked="true"] .knob,
.theme-toggle .switch.on .knob{
  transform: translateX(var(--knob-translate));
}

.theme-toggle .label{
  font-size: 12px; color: var(--muted);
  user-select: none;
}
