/* login.css – Login screen (drawn as a book) */

#login {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#login[hidden] {
  display: none;
}
/* Inloggningen är en bok: boken är formuläret, och fälten är titeln på omslaget. */
#lf {
  --cover: #2f5f5b;
  --spine: #274f4c;
  --paper: #eee6d0;
  --gold: #d9a441;
  --sp: 64px;
  position: relative;
  isolation: isolate;
  width: min(420px, 100%);
  min-height: 500px;
  box-sizing: border-box;
  padding: 36px 30px 28px calc(var(--sp) + 26px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--paper);
}
.lcv {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--cover);
  border-radius: 3px 18px 18px 3px;
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
#lf::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 9px -10px -9px 8px;
  border-radius: 3px 20px 20px 3px;
  background: repeating-linear-gradient(90deg, #ece2ce 0 2px, #d8cdb2 2px 3px);
}
.lspine {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--sp);
  background: var(--spine);
  border-radius: 3px 0 0 3px;
  box-shadow: inset -7px 0 9px -7px rgba(0, 0, 0, 0.45);
}
.lrib {
  position: absolute;
  top: 0;
  right: 13%;
  width: 30px;
  height: 84px;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}
#lf h2 {
  margin: 0;
  font: 700 28px/1.1 var(--serif);
  letter-spacing: 0.2px;
  color: var(--paper);
}
.lbl {
  background: var(--paper);
  border-radius: 9px;
  padding: 16px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
#lf .lbl input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 0 7px;
  background: transparent;
  color: #1f4a46;
  border: 0;
  border-bottom: 5px solid var(--cover);
  border-radius: 0;
  font: 700 19px var(--serif);
  outline: none;
  transition: border-color 0.15s;
  -webkit-text-fill-color: #1f4a46;
}
#lf .lbl input[hidden] {
  display: none;
}
#lf .lbl input::placeholder {
  color: rgba(47, 95, 91, 0.5);
  font-weight: 600;
  -webkit-text-fill-color: rgba(47, 95, 91, 0.5);
}
#lf .lbl input:focus {
  border-bottom-color: var(--gold);
}
#lf .lbl input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--paper) inset;
  -webkit-text-fill-color: #1f4a46;
}
#lf .lbl input:nth-of-type(2) ~ input {
  border-bottom-width: 3px;
}
#lf .sub {
  margin: 0;
  color: rgba(238, 230, 208, 0.72);
  font-size: 13px;
  line-height: 1.45;
}
#lf .hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}
#lf .hint[hidden] {
  display: none;
}
#lgo {
  margin-top: auto;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #2a2208;
  font: 700 14px var(--sans, inherit);
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
#lgo:hover {
  filter: brightness(1.07);
}
#lgo:active {
  transform: translateY(1px);
  box-shadow: none;
}
#lgo:disabled {
  opacity: 0.6;
  cursor: default;
}
#lf .lnk {
  align-self: center;
  color: rgba(238, 230, 208, 0.75);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#lf .lnk:hover {
  color: var(--paper);
}
@media (max-width: 460px) {
  #lf {
    --sp: 44px;
    min-height: 460px;
    padding: 32px 20px 22px calc(var(--sp) + 16px);
  }
}

/* ---- iPhone safe areas: keep clear of the status bar, camera cut-out and home bar ---- */
#login {
  padding: max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}
