#dialog.auth-framed {
  --frame-width: min(472px, calc(100vw - 20px));
  --form-inset: clamp(22px, 7vw, 42px);
  width: var(--frame-width);
  max-width: none;
  max-height: min(880px, calc(100dvh - 24px));
  padding: calc(var(--frame-width) * .155) 0 calc(var(--frame-width) * .062);
  overflow: visible;
  isolation: isolate;
  color: #f6eee0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#dialog.auth-framed[open] {
  display: flex;
  flex-direction: column;
}

#dialog.auth-framed::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(var(--frame-width) * .114) 2% calc(var(--frame-width) * .016);
  background: radial-gradient(ellipse at 50% 0, #342b1e, transparent 62%), #171614;
  border-radius: 5px;
  box-shadow: 0 18px 54px #0009;
  pointer-events: none;
}

.auth-frame-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  pointer-events: none;
  user-select: none;
}

.auth-frame-art img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-frame-art img:first-child { aspect-ratio: 1212 / 250; }
.auth-frame-art img:last-child { aspect-ratio: 1212 / 136; }
.auth-frame-art span { background: url("/media/auth-frame/middle.webp") center / 100% 100% no-repeat; }

.auth-framed .dialog-head {
  position: relative;
  flex: none;
  justify-content: center;
  margin: 0 var(--form-inset);
  min-height: 44px;
  padding: 4px 40px;
  text-align: center;
  border: 0;
}

.auth-framed .dialog-head h2 {
  color: #f6e6c6;
  font: 600 clamp(23px, 5.8vw, 29px)/1.15 "Playfair Display", Georgia, serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.auth-framed .dialog-head .icon-btn {
  position: absolute;
  right: -5px;
  width: 40px;
  height: 40px;
  color: #dcbe88;
  border-radius: 50%;
}

.auth-framed .dialog-head .icon-btn:hover { background: #d9ae631a; }

.auth-framed .dialog-body {
  min-height: 0;
  margin: 6px 4% 0;
  padding: 6px calc(var(--form-inset) - var(--frame-width) * .04) 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #8b724d transparent;
  scroll-padding-block: 6px;
}

.auth-framed .field {
  width: 100%;
  margin-top: 4px;
  min-height: 44px;
  background: #100f0e;
  border-color: #514536;
}

.auth-framed .field:focus-visible { outline: 2px solid #e5c17a; outline-offset: 1px; }
.auth-framed .dialog-body .form-group { margin-bottom: 12px; }
.auth-framed .dialog-body .form-error:empty { margin: 0; }
.auth-framed form > button.full { margin-top: 9px; }
.auth-framed .btn.full { min-height: 44px; }

@media (max-width: 600px) {
  .auth-framed .field { font-size: 16px; }
}

@media (max-height: 500px) and (min-width: 520px) {
  #dialog.auth-framed { --frame-width: min(380px, calc(100vw - 24px)); }
  .auth-framed .dialog-head h2 { font-size: 23px; }
}
