/*!
 * RETTIGHETSMERKNAD / COPYRIGHT NOTICE – FELTPORTAL
 * © 2026 Nicolay Aass Saga – Feltportal. Rettigheter forbeholdes / Rights reserved.
 *
 * Kopiering, bearbeiding og videreformidling krever tillatelse når ikke annet
 * følger av lov, lisens eller avtale. Rettighetsinngrep kan følges opp med
 * rettslige krav og politianmeldelse der vilkårene er oppfylt.
 * Copying, modification and redistribution require permission unless allowed
 * by law, licence or agreement. Infringements may be subject to civil claims
 * and reported to the police where the legal conditions are met.
 *
 * Merknaden gjelder bare rettigheter som tilkommer den angitte rettighetshaveren.
 * Tredjepartsrettigheter og lisensvilkår beholdes, herunder for logoer og ikoner.
 * This notice covers only rights held by the named rights holder. Third-party
 * rights and licences, including those for logos and icons, remain unaffected.
 * Se / See RETTIGHETER.txt.
 */
/* Felles stil for innlogging, aktivering og passordbytte. */
.auth-page {
  background: #f1f3f6;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
.auth-shell {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: clamp(16px, 5vw, 64px);
}
.auth-card {
  width: min(100%, 440px);
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px #182a580a;
  animation: auth-enter 200ms ease-out both;
}
.auth-card .feltportal-logo {
  width: 174px;
  max-width: 70%;
  margin: 0 0 26px;
}
.auth-card h1 {
  margin: 6px 0 7px;
  font-size: clamp(27px, 6vw, 38px);
  line-height: 1.13;
  letter-spacing: -0.04em;
}
.auth-intro,
.auth-footer {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.auth-footer {
  margin: 17px 0 0;
}
.auth-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  text-underline-offset: 3px;
}
.login-links {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 20px;
}
.auth-footer .unofficial-link {
  justify-self: end;
  gap: 5px;
  max-width: 178px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: right;
  text-decoration: none;
}
.auth-footer .unofficial-link:hover,
.auth-footer .unofficial-link:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}
.login-links > a:not(.unofficial-link) {
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: auto;
}
@media (max-width: 380px) {
  .login-links {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .auth-footer .unofficial-link {
    justify-self: start;
    text-align: left;
    max-width: none;
  }
}
.auth-confirmation {
  margin-top: 16px;
  color: var(--green);
  font-size: 14px;
}
.login-form label[for="login-password"] {
  margin-bottom: -12px;
}
.auth-card input {
  min-height: 48px;
  font-size: 16px;
}
.auth-card .login-submit {
  min-height: 48px;
}
@keyframes auth-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 560px) {
  .auth-card .feltportal-logo {
    width: 151px;
    margin-bottom: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
}

.password-tools {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
}
.password-tools button {
  min-height: 44px;
  padding-inline: 0;
}

#manual-code-fields {
  display: grid;
  gap: 16px;
}

/* Bakgrunnen er dekorativ. Den skal aldri dekke til eller fange klikk fra skjemaet. */
.login-page {
  position: relative;
  isolation: isolate;
  background: #edf1f3;
}
.login-page .auth-shell {
  position: relative;
  padding: clamp(16px, 4vw, 56px);
}
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 440px);
}
.login-photo {
  position: fixed;
  inset: 0;
  z-index: -1;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 48%;
  opacity: 0.42;
  filter: saturate(0.6) contrast(0.9) blur(1.5px);
  transform: scale(1.015);
  animation: login-photo-drift 30s ease-in-out infinite alternate;
}
.login-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, #edf1f314 0%, #edf1f366 42%, #edf1f3ed 74%, #edf1f3 100%),
    linear-gradient(180deg, #edf1f34d, #edf1f300 40%, #edf1f399);
}
.login-layout .auth-card {
  grid-column: 1;
  align-self: center;
  width: 100%;
  padding: 42px;
  border: 1px solid #ffffffd9;
  border-radius: 12px;
  background: #fffffff0;
  box-shadow: 0 18px 60px #14254e12;
}
@media (max-width: 960px) {
  .login-layout .auth-card {
    padding: 32px;
  }
}
@media (max-width: 760px) {
  .login-photo {
    position: absolute;
  }
  .login-photo img {
    object-position: 30% 50%;
    opacity: 0.3;
  }
  .login-photo::after {
    background: linear-gradient(180deg, #edf1f326, #edf1f366 48%, #edf1f3d9);
  }
  .login-layout .auth-card {
    padding: 26px;
    background: #fffffff2;
  }
}

/* Innloggingssiden vises først etter at serveren har bekreftet økten. */
.login-loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  padding: 24px;
  background: var(--background);
  text-align: center;
}
.login-loading p {
  max-width: 32rem;
  margin: 0;
}

.login-layout .feltportal-logo {
  display: block;
  width: 100%;
  max-width: none;
  aspect-ratio: 1300 / 254;
  margin: 0 0 22px;
}
.login-description {
  margin: 0;
}
.login-description span {
  display: block;
  margin-top: 3px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* En lagret mørk visning følger også øktsjekken når appen åpnes fra hjemskjermen. */
:root[data-loading-theme="dark"] .login-loading {
  background: #0f1722;
  color: #b0bfd1;
}
:root[data-loading-theme="dark"] .login-loading .loading-track {
  background: #1e2b3c;
}

@keyframes login-photo-drift {
  from {
    transform: scale(1.015);
  }
  to {
    transform: scale(1.035);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-photo img {
    animation: none;
  }
}
