/* Globale standarder */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #dbe3ed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Flytende logo over boksen */
.logo-floating {
  max-width: 320px;
  height: auto;
  display: block;
  margin-left: 80px;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  opacity: 0.99;
  z-index: 1;
  position: relative;
}

/* Login-boksen */
.login-container {
  background-color: white;
  width: 360px;
  padding: 1.75rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
}

/* Overskrift og beskrivelse */
.login-container h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: bold;
  color: #111;
}

.login-container p {
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
  color: #444;
}

form {
  text-align: left;
}

/* Input-felt */
input[type="text"],
.password-wrapper input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: #eef3ff;
  box-sizing: border-box;
}

/* Passord med ikon */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.2rem;
}

.password-toggle {
  position: absolute;
  top: 9px;
  right: 10px;
  cursor: pointer;
  font-size: 1rem;
  color: #555;
  user-select: none;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: #000;
}

/* Husk meg */
label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
}

input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Innloggingsknapp */
button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;

  width: 100%;
  background-color: #2d63ad;
  color: white;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #234f8c;
}

/* Feilmeldingsboks */
.error-message {
  background-color: #ffe5e5;
  border: 1px solid #ff9999;
  color: #cc0000;
  padding: 10px 14px;
  margin-top: 10px;
  margin-bottom: 16px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* RESPONSIV MOBILVISNING */
@media (max-width: 480px) {
  body {
    padding: 1rem;
  }

  .login-container {
    width: 100%;
    max-width: 360px;
    padding: 1.5rem 1.25rem;
    margin-top: 1.5rem;
  }

  .logo-floating {
    max-width: 180px;
    margin: 1rem auto 1rem auto;
    margin-left: 0;
  }

  .login-container h2 {
    font-size: 1.3rem;
  }

  .login-container p {
    font-size: 0.9rem;
  }

  input[type="text"],
  .password-wrapper input {
    font-size: 1rem;
  }

  .password-toggle {
    top: 11px;
  }

  button {
    font-size: 1rem;
  }

  .error-message {
    font-size: 13px;
  }
}
