.auth-page {
  --auth-gutter: clamp(16px, 2.7vw, 38px);
  --auth-content-width: 100%;
  --auth-columns: minmax(295px, .88fr) minmax(0, 1.12fr);
  --auth-column-gap: clamp(22px, 4vw, 60px);
  --auth-ink: #262a27;
  --auth-muted: #5d645f;
  --auth-action: #303d35;
  --auth-line: #e5e3dc;
  --auth-control-height: 46px;
  color: var(--auth-ink);
  background: #fff;
}

.auth-page .public-content {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  place-content: normal;
  min-block-size: 100vh;
  min-block-size: 100svh;
  padding: 0 0 var(--auth-gutter);
  background: #fff;
}

.auth-page .public-content:has(> .messages) {
  grid-template-rows: auto auto minmax(min-content, 1fr);
}

.login-with-footer .public-content {
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  padding-block-end: 0;
}

.login-with-footer .public-content:has(> .messages) {
  grid-template-rows: auto auto minmax(min-content, 1fr) auto;
}

.login-with-footer .auth-stage { margin-block-end: var(--auth-gutter); }

.auth-footer { border-block-start: 1px solid var(--auth-line); }

.auth-footer-inner {
  display: flex;
  width: min(calc(100% - 2 * var(--auth-gutter)), var(--auth-content-width));
  min-block-size: 58px;
  margin-inline: auto;
  padding-block: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 24px;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.auth-footer a { display: inline-flex; align-items: center; min-block-size: 36px; color: var(--auth-ink); text-underline-offset: 3px; }
.auth-footer a:hover { text-decoration: underline; }

.auth-page .public-content > .messages,
.auth-columns {
  width: min(calc(100% - var(--auth-gutter) - var(--auth-gutter)), var(--auth-content-width));
  margin-inline: auto;
}

.auth-columns {
  display: grid;
  grid-template-columns: var(--auth-columns);
  column-gap: var(--auth-column-gap);
}

.auth-stage {
  margin-block-start: var(--auth-gutter);
}

.auth-header {
  border-bottom: 1px solid var(--auth-line);
}

.auth-header .auth-columns {
  align-items: center;
  min-block-size: 72px;
}

.auth-entry {
  justify-self: center;
  width: min(100%, 400px);
  min-width: 0;
  min-height: 0;
}

.auth-header .auth-brand {
  flex: none;
  gap: 10px;
  padding: 0;
  font-size: 22px;
  color: var(--auth-ink);
}

.auth-brand .brand-mark {
  width: 39px;
  height: 39px;
}

.auth-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  justify-self: end;
  gap: 8px;
}
.auth-header-actions .button { border-color: #e5cfc8; background: #fff9f7; color: #8b3927; }
.auth-header-actions .button:hover { border-color: #cea89b; background: #f9eae5; }
.auth-header-actions .auth-platform-link { border-color: #d6d9d2; background: #fff; color: var(--auth-action); }
.auth-header-actions .auth-platform-link:hover { border-color: #aeb9ae; background: #f5f7f3; }

.auth-form-pane {
  align-self: start;
  margin-block-start: clamp(84px, 14.5svh, 138px);
}

.auth-form-pane h1 {
  font: 720 clamp(29px, 3.5vw, 42px)/1.08 var(--font-display);
  letter-spacing: -.05em;
  text-wrap: pretty;
}

.auth-form {
  display: grid;
  gap: 19px;
  margin-top: clamp(23px, 3vw, 34px);
}

.auth-intro { margin-block-start: 8px; color: var(--auth-muted); font-size: 14px; line-height: 1.5; }
.login-page .auth-form { gap: 12px; margin-block-start: 11px; }
.auth-form .field-grid { grid-template-columns: minmax(0, 1fr); }
.auth-form .field { gap: 7px; }
.auth-form .field label { color: var(--auth-ink); font-weight: 620; }
.auth-reset-link, .auth-return a { color: #7c432e; font-size: 13px; text-decoration: none; }
.auth-reset-link { justify-self: end; display: inline-flex; align-items: center; min-block-size: 28px; }
.auth-reset-link:hover, .auth-return a:hover { text-decoration: underline; }

.auth-form .field input:not([type="hidden"]) {
  min-height: var(--auth-control-height);
  border-color: #d6d9d2;
  border-radius: 10px;
  padding: 8px 13px;
  background: #fff;
  color: var(--auth-ink);
  font-size: 16px;
}

.auth-form input::placeholder { color: #6c726b; opacity: 1; font-size: 14px; }
.auth-input { position: relative; }
.auth-form .auth-input input:not([type="hidden"]) { padding-inline-start: 41px; }
.auth-input-icon {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 13px;
  width: 17px;
  height: 17px;
  translate: 0 -50%;
  fill: none;
  stroke: #687069;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.auth-form .field input:focus-visible {
  border-color: #a54e38;
  outline: 2px solid #a54e38;
  outline-offset: 1px;
}

.auth-form .field input[aria-invalid="true"] { border-color: #ae5149; }
.auth-secret { position: relative; }
.auth-secret:has(.auth-toggle:not([hidden])) input:not([type="hidden"]) { padding-inline-end: 87px; }
.auth-toggle {
  position: absolute;
  inset: 0 4px 0 auto;
  min-width: 78px;
  min-height: var(--touch-control-height);
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 630;
}
.auth-toggle:hover { color: var(--auth-ink); background: #f3f4f0; }

.button.auth-submit {
  position: relative;
  width: 100%;
  min-height: var(--auth-control-height);
  margin-top: 3px;
  border-color: #9e3f2a;
  border-radius: 10px;
  background: linear-gradient(150deg, #b74c35, #9f3b27);
  color: white;
  font-size: 14px;
  font-weight: 630;
}
.button.auth-submit:hover { background: #8e3725; border-color: #8e3725; color: white; }
.auth-submit .icon { position: absolute; inset-inline-end: 16px; }
.auth-errors { padding: 11px 13px; border: 1px solid #efdad7; border-radius: 10px; background: #fff4f1; }
.auth-errors .errorlist { margin: 0; padding: 0; list-style: none; }
.auth-note { margin-top: 17px; color: var(--auth-muted); }
.auth-return { margin-top: 19px; }
.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-block: 27px 20px;
  color: var(--auth-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ""; border-block-start: 1px solid var(--auth-line); }
.auth-signup {
  color: var(--auth-muted);
  font-size: 13px;
  text-align: center;
}
.auth-signup a { color: #7c432e; font-weight: 630; }

.auth-visual {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #e8c7b1;
  container-type: size;
}

.auth-photo {
  position: absolute;
  inset: 58% auto auto 50%;
  width: max(100cqw, 80.03cqh);
  aspect-ratio: 1122 / 1402;
  transform: translate(-50%, -58%);
}

.auth-photo-image {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-platform-qr {
  position: absolute;
  top: 63%;
  left: 62%;
  display: grid;
  justify-items: center;
  width: clamp(65px, 17.2%, 121px);
  container-type: inline-size;
  filter: drop-shadow(0 2px 2px rgb(74 30 20 / 30%));
  transform: translate(-50%, -50%) rotate(-2deg) skewY(-1deg) scale(.85);
  color: var(--auth-ink);
  font-family: var(--font-display);
  text-decoration: none;
}

.auth-platform-qr::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 5px;
  background: linear-gradient(95deg, #eae9df, #f9f8f3 25%, #fffefa 53%, #f3f2eb 79%, #dfded2);
  clip-path: polygon(
    0 0, 15% .9%, 30% 1.6%, 50% 2%, 70% 1.6%, 85% .9%, 100% 0,
    100% 98%, 85% 98.9%, 70% 99.6%, 50% 100%, 30% 99.6%, 15% 98.9%, 0 98%
  );
  content: "";
}

.auth-sticker-brand, .auth-sticker-domain {
  display: block;
  width: 100%;
  height: auto;
}

.auth-sticker-brand {
  fill: #303d35;
  font-size: 12px;
  font-weight: 790;
}

.auth-sticker-divider {
  fill: none;
  stroke: #68766a26;
  stroke-width: .8;
}

.auth-sticker-code {
  display: block;
  width: 82%;
  height: auto;
  margin-block: 4cqw 3cqw;
  image-rendering: pixelated;
  mix-blend-mode: multiply;
}

.auth-sticker-domain {
  fill: #72422e;
  font: 400 11px var(--font-ui);
}

.auth-platform-qr:hover .auth-sticker-domain text { text-decoration: underline; }
.auth-platform-qr:focus-visible { outline: 3px solid white; }

.auth-notices {
  display: contents;
  list-style: none;
}

.auth-notice {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: calc(100% - 32px);
  padding: 9px 12px;
  background: #fffdf9ed;
  border: 1px solid #fff;
  border-radius: 10px;
  color: #352a25;
  box-shadow: 0 3px 13px rgb(55 38 31 / 8%);
}

.auth-notice small, .auth-notice strong, .auth-notice strong + span { display: block; }
.auth-notice small { color: #6c5f58; font-size: 10px; line-height: 1.35; }
.auth-notice strong { font-size: 13px; line-height: 1.35; }
.auth-notice strong + span { margin-top: 2px; color: #534842; font-size: 11px; line-height: 1.35; }
.auth-notice .icon { margin-top: 4px; }
.auth-notice-due { inset: 40% auto auto clamp(16px, 5%, 33px); }
.auth-notice-due .icon { color: #a65327; }
.auth-notice-act { inset: auto clamp(16px, 5%, 33px) clamp(17px, 6%, 42px) auto; }
.auth-notice-act .icon { color: #36715a; }

.auth-visual::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(155deg, rgb(255 251 245 / 68%) 0%, rgb(255 246 240 / 27%) 23%, transparent 42%);
  pointer-events: none;
  content: "";
}

.auth-visual figcaption {
  position: relative;
  z-index: 2;
  max-width: 15ch;
  margin: clamp(27px, 4.5vw, 65px);
  color: #332b27;
  font: 650 clamp(25px, 3.15vw, 46px)/1.08 var(--font-display);
  letter-spacing: -.045em;
  text-wrap: balance;
}

@media (max-width: 740px) {
  .auth-page {
    --auth-content-width: 515px;
    --auth-columns: minmax(0, 1fr);
  }
  .auth-stage {
    grid-template-rows: auto clamp(240px, min(max(275px, 82vw), calc(100svh - 500px)), 400px);
    row-gap: var(--auth-gutter);
  }
  .auth-entry { width: 100%; }
  .auth-footer-inner { padding-block: 13px; }
  .auth-footer a { min-block-size: 44px; }
  .auth-header .auth-columns { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; min-block-size: 56px; }
  .auth-header-actions .button { padding-inline: 9px; font-size: 12px; }
  .auth-header .auth-brand { gap: 7px; font-size: 18px; }
  .auth-brand .brand-mark { width: 32px; height: 32px; }
  .auth-form { gap: 16px; margin-top: 20px; }
  .auth-divider { margin-block: 21px 15px; }
  .auth-visual figcaption { max-width: 61%; margin: 23px 21px; font-size: 21px; }
  .auth-notice { max-width: 43%; padding: 7px 8px; gap: 5px; }
  .auth-notice-due { inset: 31% auto auto 12px; }
  .auth-notice-act { inset: auto auto 13px 12px; }
  .auth-notice .icon { width: 14px; height: 14px; flex-basis: 14px; }
  .auth-notice strong { font-size: 12px; }
  .auth-notice strong + span { font-size: 10.5px; }
}

@container (max-height: 260px) {
  .auth-notice strong + span { display: none; }
}

@media (max-width: 420px) {
  .auth-header-actions:has(.button + .button) {
    grid-column: 1 / -1;
    justify-self: start;
    justify-content: start;
  }
  .auth-header .auth-columns:has(.button + .button) { padding-block: 10px; }
}

@media (max-width: 740px), (max-height: 590px) {
  .auth-page { --auth-control-height: var(--touch-control-height); }
  .auth-form-pane { margin-block-start: clamp(17px, 4.1svh, 29px); }
}

@media (max-width: 740px) and (max-height: 740px) {
  .auth-stage { grid-template-rows: auto; }
  .auth-stage .auth-visual { display: none; }
}
