.auth-pending .top,
.signed-out .top {
  display:none;
}

.signed-out main {
  --folder:#ceddf3;
  --folder-edge:#acbedb;
  --sheets:#f5f8ff;
  --fold:#c8d7ed;
  --flap:#eff4ff;
  --envelope:#dfe9fa;
  --edge-shadow:rgba(29,53,96,.14);
  position:relative;
  isolation:isolate;
  display:grid;
  align-content:center;
  max-width:none;
  min-height:100svh;
  padding:clamp(20px,4svh,48px) clamp(24px,4vw,56px);
  overflow:clip;
  background:linear-gradient(118deg,#e8effb,#f7f9ff 53%,#e1eaff);
}

.signed-out main::before,
.signed-out main::after {
  content:"";
  position:absolute;
  z-index:-1;
  pointer-events:none;
}

/* Cropped folder at the top left, folded envelope at the bottom right. */
.signed-out main::before {
  width:clamp(310px,37vw,680px);
  aspect-ratio:1.55;
  left:0;
  top:0;
  transform:translate(-25%,-63%) rotate(-16deg);
  border:1px solid var(--folder-edge);
  border-radius:5px;
  background:linear-gradient(0deg,transparent 15px,var(--folder-edge) 16px,transparent 17px),var(--folder);
  box-shadow:0 3px var(--sheets),0 4px var(--folder-edge),0 7px var(--sheets),0 8px var(--folder-edge),0 12px var(--folder),1px 18px 24px var(--edge-shadow);
}

.signed-out main::after {
  --crease:transparent 48.5%,var(--edge-shadow) 49.75%,var(--fold) 50%,var(--flap) 50.65%;
  width:clamp(345px,41vw,730px);
  aspect-ratio:1.85;
  right:0;
  bottom:0;
  transform:translate(24%,30%) rotate(-13deg);
  border:1px solid var(--fold);
  border-radius:4px;
  background:
    linear-gradient(to top right,var(--crease)) left top / 50.04% 66% no-repeat,
    linear-gradient(to top left,var(--crease)) right top / 50.04% 66% no-repeat,
    var(--envelope);
  box-shadow:0 3px 5px var(--edge-shadow),0 12px 32px var(--edge-shadow);
}

.signed-out #alert,
.auth-frame {
  width:min(100%,1188px);
}

.signed-out #alert {
  margin:0 auto 12px;
}

.auth-frame {
  position:relative;
  isolation:isolate;
  margin-inline:auto;
}

.auth-frame::before {
  content:"";
  position:absolute;
  inset:-6px;
  z-index:-1;
  pointer-events:none;
  border-radius:22px;
  background:#89ade9 url("/offeru-felt-edge.webp") repeat;
  background-blend-mode:luminosity;
  background-size:210px 210px;
  box-shadow:0 8px 20px rgba(26,49,92,.17);
  filter:blur(.6px);
}

[data-theme=dark] .auth-frame::before {
  filter:brightness(.48) saturate(.8) blur(.6px);
  box-shadow:0 8px 20px #0a1227;
}

.auth-shell {
  --auth-ink:#14203a;
  --auth-muted:#4a5c7c;
  --auth-border:#b8c8e1;
  --auth-paper:#fff;
  --auth-field:#f8faff;
  --auth-mount:#dce8fb;
  --auth-spine:#233e87;
  --auth-primary:#2a4cc5;
  --auth-primary-hover:#223ba5;
  --auth-primary-ink:#fff;

  /* Six columns per side within the centered desktop frame. */
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  margin-inline:auto;
  overflow:hidden;
  border:1px solid var(--auth-border);
  border-radius:16px;
  color:var(--auth-ink);
  background:var(--auth-paper);
  font:400 16px/1.62 var(--offeru-font);
}

.signed-out .auth-shell {
  box-shadow:0 3px 7px rgba(25,46,83,.045),0 20px 48px -22px rgba(25,46,83,.26);
}

[data-theme=dark] .signed-out main {
  --folder:#273d61;
  --folder-edge:#40577a;
  --sheets:#354764;
  --fold:#2f4263;
  --flap:#374c6e;
  --envelope:#2b3d5c;
  --edge-shadow:rgba(7,16,33,.37);
  background:linear-gradient(118deg,#131d33,#1d2a46 51%,#151f37);
}

[data-theme=dark] .auth-shell {
  --auth-ink:#ecf0fa;
  --auth-muted:#b6c2d8;
  --auth-border:#526078;
  --auth-paper:#1b2331;
  --auth-field:#222e41;
  --auth-mount:#344a6f;
  --auth-spine:#172c57;
  --auth-primary:#c1d0ff;
  --auth-primary-hover:#d8e1ff;
  --auth-primary-ink:#1b2745;
}

.auth-identity {
  position:relative;
  display:grid;
  place-items:center;
  margin:0;
  padding:clamp(29px,min(5vw,8svh),73px) clamp(27px,4.2vw,62px);
  border-inline-end:1px solid var(--auth-border);
  background:var(--auth-mount);
}

.auth-identity::before {
  position:absolute;
  inset-block:0;
  inset-inline-start:0;
  width:34%;
  background:var(--auth-spine);
  content:"";
}

.auth-plate {
  position:relative;
  isolation:isolate;
  width:min(100%,428px);
  aspect-ratio:4 / 5;
  overflow:hidden;
  border-radius:4px;
  background:#98b8ed;
}

.auth-plate img {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  mix-blend-mode:luminosity;
  opacity:0;
  transition:opacity 950ms cubic-bezier(.35,0,.25,1);
}

.auth-plate .is-current {
  z-index:2;
  opacity:1;
}

.auth-plate .is-previous {
  z-index:1;
  opacity:0;
  transition:opacity 0s linear 950ms;
}

.auth-panel {
  display:grid;
  place-items:center;
  padding:clamp(37px,5vw,68px) clamp(32px,5vw,76px);
}

.auth-content {
  width:min(100%,404px);
}

.auth-brand {
  gap:10px;
  min-height:44px;
  margin-bottom:20px;
}

.auth-brand .brand-type {
  width:114px;
}

.auth-panel h1 {
  font-size:clamp(32px,3.15vw,46px);
  font-weight:625;
  line-height:1.2;
  letter-spacing:.015em;
  text-wrap:balance;
}

.auth-panel .quiet {
  color:var(--auth-muted);
}

#auth-hint:not(:empty) {
  margin-top:8px;
}

#auth-form {
  margin-top:25px;
}

.auth-panel label {
  display:block;
  margin-top:16px;
  font-size:14px;
  font-weight:600;
}

.auth-panel input:not([type=checkbox]) {
  display:block;
  width:100%;
  min-height:49px;
  margin-top:8px;
  padding:10px 13px;
  border:1px solid var(--auth-border);
  border-radius:8px;
  background:var(--auth-field);
  color:var(--auth-ink);
  font-size:16px;
}

.auth-panel input:hover:enabled {
  border-color:var(--auth-muted);
}

.password-line {
  position:relative;
  display:flex;
}

.password-line input {
  padding-right:66px!important;
}

.password-line button {
  position:absolute;
  inset-inline-end:3px;
  top:9px;
  min-width:53px;
  min-height:47px;
  border-radius:6px;
  font-size:13px;
  font-weight:500;
}

#password-hint {
  margin-top:7px;
  font-size:13px;
}

.auth-options,
.auth-switch {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}

.auth-options {
  justify-content:space-between;
  margin-top:9px;
}

.auth-options label {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  margin:0;
  font-weight:400;
}

.auth-options input {
  width:16px;
  height:16px;
  margin:0;
  accent-color:var(--auth-primary);
}

.auth-panel .textbtn {
  color:var(--auth-ink);
  font-size:14px;
  text-decoration:underline;
  text-underline-offset:4px;
}

#auth-msg:not(:empty) {
  margin-top:10px;
}

.auth-human {
  margin-top:12px;
  --altcha-color-base:var(--auth-field);
  --altcha-color-base-content:var(--auth-ink);
  --altcha-color-neutral:var(--auth-border);
  --altcha-color-primary:var(--auth-primary);
}

.auth-human altcha-widget {
  display:block;
}

.human-status {
  font-size:14px;
}

#admin-nav {
  padding:5px;
  font-size:14px;
}

.auth-panel #auth-submit {
  width:100%;
  min-height:51px;
  margin-top:11px;
  border:1px solid transparent;
  border-radius:8px;
  background:var(--auth-primary);
  color:var(--auth-primary-ink);
  font-size:16px;
  font-weight:700;
}

.auth-panel #auth-submit:hover:enabled {
  background:var(--auth-primary-hover);
}

.auth-switch {
  margin-top:17px;
  padding-top:6px;
  border-top:1px solid var(--auth-border);
}

@media(min-width:761px) and (max-height:780px) {
  .auth-panel {
    padding-block:36px;
  }
}

@media(max-width:760px) {
  .signed-out main {
    padding:16px;
  }

  .signed-out main::before {
    width:215px;
    transform:translate(-32%,-56%) rotate(-16deg);
  }

  .signed-out main::after {
    width:220px;
    transform:translate(34%,47%) rotate(-13deg);
  }

  .auth-frame {
    max-width:480px;
  }

  .auth-frame::before {
    inset:-4px;
    border-radius:20px;
  }

  .auth-shell {
    grid-template-columns:minmax(0,1fr);
  }

  .auth-identity {
    padding:17px 20px;
    border:0;
    border-bottom:1px solid var(--auth-border);
  }

  .auth-plate {
    width:clamp(115px,35vw,165px);
  }

  .auth-panel {
    padding:24px 24px 27px;
  }

  .auth-brand {
    margin-bottom:14px;
  }

  #auth-form {
    margin-top:18px;
  }
}

@media(prefers-reduced-motion:reduce) {
  .auth-plate img {
    transition:none;
  }
}
