/** @version 2.0.2 */
/* main.css - global styles */

:root {
  /* Brand / lys app-stil */
  --brand: #1d84d6;
  --primary: #1d84d6;
  --brand-dark: #1565c0;

  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b667a;
  --line: rgba(15, 23, 42, .10);

  --err: #d32f2f;
  --muted-red: #c40000;
  /* Dæmpet rød */
  --muted-green: #00c400;
  /* Dæmpet grøn */
  --shadow: 0 10px 24px rgba(2, 8, 23, .10);

  --radius: 18px;

  /* Global scale (mobil = 2x) */
  --ui-scale: 1;

  /* Bundmenuhøjde (skaleres) */
  --navh: calc(88px * var(--ui-scale));
}

@media (max-width: 900px) {
  :root {
    --ui-scale: 0.8;
  }

  /* ca. 2× på mobil */
}

@media (min-width: 901px) {
  :root {
    --ui-scale: 1.05;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  font-size: calc(20px * var(--ui-scale));
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--navh) + env(safe-area-inset-bottom));
}

/* =========================
   TOPBAR
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12px * var(--ui-scale));

  padding: calc(16px * var(--ui-scale));
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 calc(6px * var(--ui-scale)) calc(18px * var(--ui-scale)) rgba(2, 8, 23, .18);
}

.title {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: .2px;
}

.last-scan {
  font-size: .85rem;
  opacity: .92;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================
   BARS (error/info)
   ========================= */

.errorbar {
  display: none;
  padding: calc(14px * var(--ui-scale)) calc(16px * var(--ui-scale));
  background: var(--err);
  color: #fff;
  font-weight: 900;
  font-size: .95rem;
  box-shadow: 0 calc(8px * var(--ui-scale)) calc(18px * var(--ui-scale)) rgba(211, 47, 47, .25);
}

.errorbar.is-show {
  display: block;
}

.infobar {
  display: none;
  padding: calc(14px * var(--ui-scale)) calc(16px * var(--ui-scale));
  background: #16a34a;
  color: #fff;
  font-weight: 900;
  font-size: .95rem;
  box-shadow: 0 calc(8px * var(--ui-scale)) calc(18px * var(--ui-scale)) rgba(22, 163, 74, .25);
}

.infobar.is-show {
  display: block;
}

/* =========================
   APP + CARD
   ========================= */

.app {
  padding: calc(14px * var(--ui-scale));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * var(--ui-scale));
  padding: calc(14px * var(--ui-scale));
  box-shadow: var(--shadow);
}

/* Hint tekst (baseline) */
.hint {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  margin: 0;
}

.hint.small {
  margin-top: calc(8px * var(--ui-scale));
  font-size: .82rem;
  font-weight: 800;
  opacity: .9;
}

/* Hint button style */
.hintbtn {
  display: block;
  padding: calc(12px * var(--ui-scale));
  border-radius: calc(12px * var(--ui-scale));
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: opacity .2s;
}

.hintbtn:active {
  opacity: 0.8;
}

/* =========================
   BOTTOM NAV
   ========================= */

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--navh);
  padding-bottom: env(safe-area-inset-bottom);

  background: rgba(255, 255, 255, .98);
  border-top: 1px solid var(--line);
  box-shadow: 0 calc(-10px * var(--ui-scale)) calc(26px * var(--ui-scale)) rgba(2, 8, 23, .10);

  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 20;
}

.navitem {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(7px * var(--ui-scale));

  text-decoration: none;
  color: rgba(15, 23, 42, .65);

  font-size: .72rem;
  font-weight: 900;
  padding-top: calc(6px * var(--ui-scale));
}

.navitem .icon {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
}

.navitem.is-active {
  color: var(--brand);
}

.navitem.is-active .icon {
  filter: drop-shadow(0 calc(6px * var(--ui-scale)) calc(14px * var(--ui-scale)) rgba(29, 132, 214, .20));
}