/* Compact authentication layout shared by sign-in and registration. */
body:is([data-screen=login], [data-screen=register]) {
  min-height: 100dvh;
  padding-block-end: env(safe-area-inset-bottom, 0px);
}
#mobile[hidden] { display: none; }
body[data-screen=login] #top, body[data-screen=register] #top { border: 0; }
body .access-bar {
  width: min(100%, var(--content));
  min-height: 58px;
  height: auto;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 52px);
  background: transparent;
  border: 0;
  justify-content: flex-start;
}
.access-home {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  color: #d1d1d1;
  font-size: 13px;
}
.access-home .icon { width: 17px; height: 17px; }
.access-home:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

body:is([data-screen=login], [data-screen=register]) #main {
  display: grid;
  align-items: start;
  width: 100%;
  min-height: calc(100dvh - 58px - env(safe-area-inset-bottom, 0px));
  padding: clamp(24px, 6vh, 72px) 18px 30px;
}
.access-layout {
  --access-ink: var(--brand-white);
  --access-muted: #bcbcbc;
  --access-border: #575757;
  --access-card: #191919;
  --access-input: #101010;
  --access-edge: #383838;
  width: min(100%, 368px);
  margin-inline: auto;
}
body[data-screen=register] .access-layout { width: min(100%, 412px); }
.access-heading { text-align: center; margin-block-end: 21px; }
.access-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border: 1px solid #622831;
  border-radius: 13px;
  background: var(--brand-red-tint);
  color: var(--brand-red-ink);
}
.access-mark .icon { width: 25px; height: 25px; }
.access-wordmark {
  display: block;
  font: 800 22px/1.1 Arial, sans-serif;
  letter-spacing: -.045em;
  color: var(--brand-white);
}
.access-heading h1 {
  margin: 15px 0 0;
  font-size: clamp(24px, 5.8vw, 28px);
  font-weight: 790;
  line-height: 1.35;
}
.access-panel {
  color-scheme: dark;
  padding: clamp(16px, 4vw, 23px);
  border: 1px solid var(--access-edge);
  border-radius: 12px;
  background: var(--access-card);
  color: var(--access-ink);
}
.access-panel > .note { margin: 0 0 14px; color: #e9e9e9; background: #262626; font-size: 12px; }
.access-form { display: grid; gap: 14px; }
.access-field { display: grid; gap: 5px; min-width: 0; }
.access-field label, .access-roles legend { font-size: 14px; font-weight: 680; }
.access-field small { color: var(--access-muted); font-size: 12px; }
.access-entry { position: relative; }
.access-entry > .icon {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--access-muted);
  pointer-events: none;
}
.access-entry:focus-within > .icon { color: var(--brand-red-ink); }
.access-field input {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 7px 12px;
  padding-inline-start: 38px;
  border: 1px solid var(--access-border);
  border-radius: 7px;
  background: var(--access-input);
  color: var(--access-ink);
  font-size: 16px;
}
.access-field input[dir=ltr] { padding-inline: 12px 38px; }
.access-entry.has-reveal input[dir=ltr] { padding-inline-start: 48px; }
.access-field input:is(:focus, [aria-invalid=true]) { border-color: var(--brand-red-ink); }
.access-panel :is(input, button, a):focus-visible { outline: 2px solid var(--brand-red-ink); outline-offset: 2px; }
.access-field input:autofill {
  -webkit-text-fill-color: var(--access-ink);
  box-shadow: inset 0 0 0 100px var(--access-input);
}
.access-reveal {
  position: absolute;
  inset-inline-end: 1px;
  inset-block: 1px;
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--access-muted);
}
.access-reveal .icon { display: block; width: 18px; height: 18px; }
.access-reveal:hover { color: var(--access-ink); background: #242424; }
.access-reveal[aria-pressed=false] .access-eye-off,
.access-reveal[aria-pressed=true] .access-eye { display: none; }

.access-roles { min-width: 0; margin: 0; padding: 0; border: 0; }
.access-roles legend { margin-block-end: 7px; }
.access-roles > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.access-role { position: relative; min-width: 0; cursor: pointer; }
.access-role input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.access-role > span {
  display: grid;
  min-height: 55px;
  justify-items: center;
  align-content: center;
  padding: 5px 2px;
  gap: 3px;
  border: 1px solid var(--access-border);
  border-radius: 8px;
  color: var(--access-muted);
  font-size: 12px;
  text-align: center;
}
.access-role .icon { width: 17px; height: 17px; }
.access-role input:checked + span { border-color: var(--brand-red-ink); background: var(--brand-red-tint); color: var(--access-ink); font-weight: 730; }
.access-role input:checked + span .icon { color: var(--brand-red-ink); }
.access-role input:focus-visible + span { outline: 2px solid var(--brand-red-ink); outline-offset: 2px; }
.access-submit {
  display: grid;
  min-height: 48px;
  margin-block-start: 1px;
  place-items: center;
  padding: 8px 12px;
  border: 1px solid var(--brand-red);
  border-radius: 8px;
  background: var(--brand-red);
  color: var(--brand-on-red);
  font-size: 15px;
  font-weight: 730;
}
.access-submit:hover:enabled { background: var(--brand-red-hover); }
.access-submit:disabled { opacity: .74; cursor: progress; }
.access-error {
  margin: 0;
  padding: 8px 10px;
  border-inline-start: 3px solid var(--brand-red-ink);
  border-radius: 5px;
  background: var(--brand-red-tint);
  color: #ffd3dc;
  font-size: 13px;
}
.access-error:focus { outline: 2px solid var(--brand-red-ink); outline-offset: 2px; }
.access-switch {
  margin: 14px 0 0;
  padding-inline: 10px;
  border: 1px solid var(--access-edge);
  border-radius: 9px;
  text-align: center;
  color: var(--access-muted);
  font-size: 14px;
}
.access-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-inline-start: 5px;
  color: var(--brand-red-ink);
  font-weight: 730;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.access-link:hover { color: #fff; }
@media (max-height: 630px) {
  body:is([data-screen=login], [data-screen=register]) #main { padding-block: 13px 21px; }
}
