/* ============================================================
   HUMANORAMA FORESATT — foresatt.humanorama.no
   Bevisst rolig og enkel: foresatte bruker appen sjelden og på mobil.
   ============================================================ */

* { box-sizing: border-box; font-family: 'Noto Sans', sans-serif; }
html, body { margin: 0; padding: 0; }

body {
  background: #fff;
  color: #222;
  min-height: 100vh;
}

/* ---- Topplinje (oransje banner, som elev-/lærerappen — bilde fra lokal fil) ---- */
.topplinje {
  height: 40px;
  background: url('/banner.png') no-repeat center / 100% 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-family: 'Indie Flower', cursive;
  font-size: 28px;
  color: #fff;
  text-shadow: 1px 0.2px 3px #4a85e9;
}
.topp-hoyre {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #fff;
}
.lenke-knapp {
  background: none;
  border: none;
  color: #7c4dff;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
}
.lenke-knapp:hover { background: #f3eeff; }
/* Logg-ut-knappen ligger på banneren → hvit; «Prøv igjen» på hvitt kort beholder lilla */
.topplinje .lenke-knapp { color: #fff; }
.topplinje .lenke-knapp:hover { background: rgba(255, 255, 255, 0.22); }

/* ---- Layout ---- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.midtstilt { text-align: center; }

h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 10px;
}
.ingress {
  font-size: 15px;
  line-height: 1.55;
  color: #555;
  margin: 0 0 18px;
}
.smaatekst {
  font-size: 12.5px;
  line-height: 1.5;
  color: #888;
  margin: 14px 0 0;
}

.kort {
  background: #fff;
  border: 1px solid #e4e4e8;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.stor-ikon { font-size: 40px; margin-bottom: 10px; }

/* ---- Vipps-knapp ----
   Vipps-oransje (#FF5B24). Grafikken hostes lokalt hvis den legges til —
   CSP tillater ingen eksterne bilder. */
.vipps-knapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FF5B24;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  min-width: 240px;
  transition: filter 0.15s;
}
.vipps-knapp strong { font-weight: 700; }
.vipps-knapp:hover:not(:disabled) { filter: brightness(1.08); }
.vipps-knapp:disabled { opacity: 0.6; cursor: default; }

/* ---- Barn ---- */
.barn-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.barn-kort {
  background: #fff;
  border: 1px solid #e4e4e8;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  min-width: 130px;
  flex: 1 1 130px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.barn-bilde {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 25%;
  margin-bottom: 8px;
}
.barn-bilde-tom {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  background: #ede7f6;
  color: #7c4dff;
  font-size: 28px;
  font-weight: 600;
}
.barn-navn { font-size: 14px; font-weight: 600; }

/* Velger (2+ barn) — barn-kort som klikkbar knapp */
.barn-velg {
  cursor: pointer;
  font: inherit;
  transition: box-shadow 0.12s;
}
.barn-velg:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); }

/* Per-barn topp */
.barn-tilbake { display: inline-block; margin-bottom: 8px; padding-left: 0; }
.barn-topp {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.barn-bilde-liten {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 25%;
  font-size: 22px;
}
.barn-navn-stor { font-size: 18px; font-weight: 600; }
.barn-fotnote { text-align: center; margin-top: 16px; }

/* ---- Innsatsgraf ---- */
.innsats-kort { padding: 16px 16px 18px; }
.innsats-laster { min-height: 130px; display: flex; align-items: center; justify-content: center; }
.innsats-laster .spinner { margin: 0 auto; }

.innsats-topp {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.innsats-tittel {
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.innsats-info {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: #666;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.innsats-info:hover { filter: brightness(0.95); }
.innsats-vindu {
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #333;
  max-width: 190px;
}

.innsats-svg { width: 100%; height: auto; display: block; margin: 4px 0 2px; overflow: visible; }
.g-akse { font-size: 8px; fill: #999; }
.g-mal { font-size: 7px; fill: #aaa; }

.innsats-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
  font-size: 12px;
  color: #555;
}
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg-strek { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.lg-total { background: #7209B7; height: 4px; }
.lg-lv { background: #FF218C; }
.lg-opp { background: #21B1FF; }

.innsats-caption { font-size: 11.5px; color: #999; text-align: center; margin-top: 8px; }
.innsats-tom { text-align: center; color: #666; padding: 20px 8px; }
.innsats-tom p { margin: 6px 0; font-size: 14px; }
.innsats-tom-liten { text-align: center; color: #999; font-size: 13px; padding: 44px 8px; }

.innsats-info-boks { text-align: left; max-width: 460px; }
.innsats-info-tekst {
  font-size: 13.5px;
  line-height: 1.6;
  color: #444;
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-bottom: 16px;
}

/* ---- Meldingssenter ---- */
.meldinger-kort { padding: 16px 18px; margin-bottom: 12px; }
.meldinger-topp { display: flex; align-items: center; margin-bottom: 6px; }
.meldinger-tittel {
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.meldinger-teller {
  background: #7c4dff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.meldinger-tom { font-size: 13px; color: #999; padding: 6px 0; }
.meldinger-liste { list-style: none; margin: 0; padding: 0; }
.melding {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid #f0f0f2;
}
.melding:first-child { border-top: none; }
.melding-ulest { cursor: pointer; }
.melding-prikk {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c4dff;
  margin-top: 5px;
  flex: 0 0 auto;
}
.melding-innhold { flex: 1 1 auto; min-width: 0; }
.melding-tekst { font-size: 14px; line-height: 1.45; color: #333; }
.melding-ulest .melding-tekst { font-weight: 600; }
.melding-tid { font-size: 11.5px; color: #999; margin-top: 2px; }

/* ---- Søknad om permisjon ---- */
.soknad-knapp {
  display: block;
  width: 100%;
  background: #f3eeff;
  color: #5b34d1;
  border: 1px solid #d9ccff;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: filter 0.12s;
}
.soknad-knapp:hover { filter: brightness(0.97); }
.soknad-boks { text-align: left; max-width: 420px; width: 92vw; }
.soknad-boks .update-overlay-title { text-align: left; }
.soknad-under { font-size: 13px; color: #888; margin: 0 0 14px; }
.soknad-modus { display: flex; gap: 18px; margin-bottom: 14px; }
.soknad-radio { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.soknad-felt { display: block; font-size: 13px; color: #555; margin-bottom: 12px; }
.soknad-valgfri { color: #999; font-weight: 400; }
.soknad-hint { font-size: 12px; color: #888; margin: 2px 0 8px; line-height: 1.4; }
.soknad-datorad { display: flex; gap: 12px; }
.soknad-datorad .soknad-felt { flex: 1 1 0; }
.soknad-felt input, .soknad-felt select, .soknad-felt textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #222;
  box-sizing: border-box;
}
.soknad-felt textarea { resize: vertical; }
.soknad-feil {
  padding: 9px 12px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  color: #a01818;
  font-size: 13px;
  margin-bottom: 12px;
}
.soknad-knapper { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 4px; }

/* ---- Feil ---- */
.feil {
  margin-top: 16px;
  padding: 10px 14px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  color: #a01818;
  font-size: 13px;
}

/* ---- Spinner ---- */
.spinner {
  width: 32px;
  height: 32px;
  margin: 60px auto;
  border: 3px solid #ede7f6;
  border-top-color: #7c4dff;
  border-radius: 50%;
  animation: snurr 0.8s linear infinite;
}
@keyframes snurr { to { transform: rotate(360deg); } }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10001;
  max-width: 90vw;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ---- Overlays (mønster fra style-lv.css; z-index over alt annet) ---- */
.update-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10003;
}
.update-overlay-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.update-overlay-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.update-overlay-text { font-size: 14px; color: #555; margin-bottom: 18px; line-height: 1.5; }
.update-overlay-button {
  background: #7c4dff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  cursor: pointer;
}
.update-overlay-button:hover { filter: brightness(1.1); }
.melding-utfall-ja { color: #2e7d32; }
.melding-utfall-nei { color: #c62828; }

/* ---- Footer (firmainfo — påkrevd av Vipps) ---- */
.app-footer {
  max-width: 640px;
  margin: 40px auto 0;
  padding: 18px 20px 28px;
  border-top: 1px solid #e4e4e8;
  font-size: 12px;
  line-height: 1.6;
  color: #888;
  text-align: center;
}
.app-footer a { color: #7c4dff; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
