.auth-page {
  --auth-gutter: clamp(1.25rem, 3.35vw, 4rem);
  --error-text: #943826;
  background: var(--paper);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100svh;
}

.account-cover {
  grid-area: 1 / 1 / 3 / 2;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7rem;
  margin: .875rem 0 .875rem .875rem;
  padding: clamp(2rem, 3.45vw, 4.15rem);
  overflow: hidden;
  border-radius: .4rem;
  color: #fffdf8;
  background-color: var(--navy-deep);
  background-image:
    linear-gradient(180deg, rgb(19 28 48 / 45%), transparent 30%, rgb(21 30 49 / 9%) 45%, rgb(18 26 45 / 84%) 82%, #161f35 100%),
    linear-gradient(90deg, rgb(19 29 46 / 36%), transparent 76%),
    url("../assets/architecture.avif");
  background-size: cover;
  background-position: center, center, 54% 50%;
}
.cover-brand { align-self: flex-start; text-shadow: 0 1px 6px #13203552; }
.cover-brand .brand-name { font-size: clamp(2.8rem, 4vw, 3.65rem); }
.cover-brand .brand-descriptor { border-color: #e6c591; font-size: .65rem; }
.cover-copy { position: relative; margin-block: auto 1rem; }
.cover-copy::before {
  display: block;
  content: "";
  width: 3.2rem;
  height: 2px;
  margin-bottom: 1.45rem;
  background: #dfb87b;
}
.cover-title {
  margin: 0;
  font: 400 clamp(2.9rem, 4.75vw, 5.5rem)/1.08 var(--display);
  letter-spacing: -.045em;
}
.cover-title em { display: block; color: #f4dfbb; }
.cover-description { max-width: 40ch; margin: 1.4rem 0 0; color: #f2efe9; font-size: 1rem; line-height: 1.65; text-wrap: pretty; }

.auth-languages {
  grid-area: 1 / 2;
  z-index: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  margin: 1.3rem var(--auth-gutter) .2rem;
  padding: 2px;
  border: 1px solid #dbd8cf;
  border-radius: 2rem;
}
.auth-languages button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: .65rem;
  border-radius: inherit;
  color: var(--muted);
  font-size: .875rem;
}
.auth-languages button:hover { background: var(--soft); }
.auth-languages button[aria-pressed="true"] { background: var(--navy); color: #fff; font-weight: 500; }
.auth-languages button:focus-visible { position: relative; }

.account-entry {
  grid-area: 2 / 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 2.6rem var(--auth-gutter) clamp(4rem, 9vh, 6.6rem);
}
.account-content { width: min(100%, 26rem); }
.account-content h1 { margin: 0; font: 400 clamp(2.45rem, 3.5vw, 3.7rem)/1.12 var(--display); letter-spacing: -.045em; overflow-wrap: break-word; }
.account-content h1:focus { outline: none; }
.form-intro { margin: .8rem 0 2.1rem; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.auth-form { display: grid; gap: 1.2rem; }
.field { display: grid; gap: .44rem; min-width: 0; }
.field label { font-size: .9375rem; font-weight: 500; }
.field input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 3.25rem;
  padding: .65rem .95rem;
  border: 1px solid #868981;
  border-radius: .45rem;
  background: #fff;
  font-size: 1rem;
  line-height: 1.4;
  scroll-margin-block: 1rem;
}
.field input::placeholder { color: #69717e; opacity: 1; }
.field input:hover { border-color: #757b80; }
.field input:focus { border-color: var(--bronze); outline: 2px solid var(--bronze); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--error-text); }
.field input[aria-invalid="true"]:focus { outline-color: var(--error-text); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 3.3rem; }
.password-wrap input::-ms-reveal { display: none; }
.password-toggle {
  position: absolute;
  inset: 0 .25rem 0 auto;
  align-self: center;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .35rem;
  color: #525c6d;
}
.password-toggle:hover { color: var(--navy); background: var(--soft); }
.password-toggle:focus-visible { outline-offset: -2px; }
.password-toggle svg { width: 1.23rem; height: 1.23rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle[aria-pressed="false"] .eye-hide,
.password-toggle[aria-pressed="true"] .eye-show { display: none; }
.field-hint, .caps-hint, .field-error { font-size: .875rem; line-height: 1.42; }
.field-hint { color: var(--muted); }
.field-hint[data-valid="true"] { color: #31644f; }
.caps-hint { color: #785423; }
.field-error { color: var(--error-text); }

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 100%;
  min-height: 3.25rem;
  padding: .68rem 1rem;
  border: 1px solid var(--navy);
  border-radius: .45rem;
  background: var(--navy);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}
.auth-form .primary-action { margin-top: .35rem; }
.primary-action:hover { background: #303c5a; }
.primary-action:active { background: #111a2f; }
.primary-action:disabled { cursor: progress; background: #455169; }
.auth-form .primary-action:disabled::before {
  content: "";
  width: .9rem;
  height: .9rem;
  border: 1.5px solid #ffffff60;
  border-top-color: white;
  border-radius: 50%;
  animation: account-spin .8s linear infinite;
}
@keyframes account-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .auth-form .primary-action:disabled::before { animation: none; } }
.auth-switch {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 .4rem;
  margin-top: 1.55rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  font-size: .94rem;
}
.auth-switch span { color: var(--muted); }
.auth-switch a, .secondary-action { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--navy); text-decoration: underline; text-underline-offset: .22em; text-decoration-color: #9a7951; font-weight: 500; }
.auth-switch a:hover, .secondary-action:hover { color: var(--bronze); }
#form-error, #request-status { margin: 0 0 1.15rem; padding: .75rem .9rem; border-inline-start: 3px solid var(--gold); border-radius: .2rem; background: var(--soft); font-size: .94rem; }
#form-error { color: var(--error-text); background: #fbf0eb; border-color: #af6046; }
#request-status:empty, .form-intro:empty { display: none; }
.account-content:has(.auth-form[aria-busy="true"]) #request-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
#profile-actions { display: grid; gap: .5rem; }
.secondary-action { justify-self: center; padding-inline: .5rem; }
#identity { display: grid; gap: 1rem; margin: 0 0 1.6rem; }
#identity > div { border-bottom: 1px solid var(--line); padding: 0 0 .75rem; }
#identity dt { color: var(--muted); font-size: .88rem; }
#identity dd { margin: .18rem 0 0; overflow-wrap: anywhere; }

@media (min-width: 48.01rem) and (max-width: 65rem) {
  .auth-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .account-cover { padding: 2rem 1.7rem; }
  .cover-title { font-size: clamp(2.4rem, 4.5vw, 3rem); }
}
@media (max-width: 48rem) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .account-cover {
    grid-area: 1 / 1;
    justify-content: center;
    gap: 0;
    min-height: 6rem;
    margin: 0;
    padding: 1.2rem var(--auth-gutter);
    border-radius: 0;
    background-image: linear-gradient(90deg, #182239 4%, rgb(24 34 57 / 93%) 27%, rgb(22 32 53 / 30%) 78%, rgb(20 29 49 / 68%)), url("../assets/architecture.avif");
    background-position: center, center 45%;
  }
  .cover-brand .brand-name { font-size: 2.75rem; }
  .cover-brand .brand-descriptor { font-size: .56rem; }
  .cover-copy { display: none; }
  .auth-languages { grid-area: 1 / 1; align-self: center; margin: 0 var(--auth-gutter) 0 0; border-color: #ffffff67; background: #1b253e; }
  .auth-languages button { color: #f7f4ed; }
  .auth-languages button:hover { background: #39445d; }
  .auth-languages button[aria-pressed="true"] { color: var(--navy); background: var(--cream); }
  .account-entry { grid-area: 2 / 1; align-items: flex-start; padding: clamp(2.5rem, 7vh, 4.5rem) var(--auth-gutter) 2rem; }
  .account-content { width: min(100%, 27rem); }
  .account-content h1 { font-size: clamp(2.35rem, 7vw, 3.05rem); }
  .form-intro { margin-block: .65rem 1.75rem; }
}
@media (max-width: 24rem) {
  .auth-page { --auth-gutter: 1.1rem; }
  .account-cover { min-height: 5.3rem; }
  .cover-brand { gap: .5rem; }
  .cover-brand .brand-name { font-size: 2.4rem; }
  .cover-brand .brand-descriptor { padding-inline-start: .5rem; }
}
@media (max-height: 42rem) and (max-width: 48rem) {
  .account-entry { padding-top: 1.7rem; }
  .account-cover { min-height: 4.7rem; }
}
