/* Public auth pages use the studio palette before either workspace bundle mounts. */
.portal-auth {
  --auth-page: #f7f7f3;
  --auth-ink: #242333;
  --auth-muted: #5c596b;
  --auth-action: #5942b9;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  color: var(--auth-ink);
  color-scheme: light;
  background: var(--auth-page);
}
body:has(#portal-register),
body:has(#console-view:not([hidden]) #login-panel:not([hidden])) {
  height: auto;
  overflow: auto;
  background: #f7f7f3;
}
#console-view:has(#login-panel:not([hidden])) {
  display: block;
  height: auto;
  overflow: visible;
}
#console-view:has(#login-panel:not([hidden])) :is(.topbar, .preview-column, .relay-rail, .relay-welcome) {
  display: none;
}
#console-view:has(#login-panel:not([hidden])) :is(.workspace, .control-column, .relay-signin, .relay-login-wrap):not([hidden]) {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}
#console-view #login-panel {
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  background: var(--auth-page);
}
#console-view:has(#login-panel:not([hidden])) #console-notice:not([hidden]) {
  position: relative;
  max-width: 66rem;
  margin: .75rem auto 0;
}
.portal-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(18rem, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 5.5vw, 6rem);
  width: min(90rem, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(1.25rem, 3.5vw, 4rem);
}
.portal-art {
  display: flex;
  align-self: center;
  flex-direction: column;
  justify-content: space-between;
  height: clamp(32rem, 78vh, 52rem);
  padding: clamp(1.5rem, 3vw, 3rem);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(180deg, #14132380, transparent 38%, #151125bb), #302841 url("./auth-studio.webp") 52% center / cover;
  border-radius: 1.5rem;
}
.portal-wordmark {
  display: inline-flex;
  align-items: center;
  gap: .52em;
  font: 750 1.25rem/1.3 "Inter", "Segoe UI", sans-serif;
  letter-spacing: .09em;
}
.portal-wordmark::before {
  width: 1.65em;
  height: 1.65em;
  content: "";
  border-radius: .42em;
  background: #eeeafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Cpath d='M3 17h4l3-7 3 13 4-18 3 21 4-13 2 5h3' stroke='%235942b9' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 86% no-repeat;
}
.portal-art-name {
  font-size: clamp(2.4rem, 4.4vw, 4.4rem);
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: -.055em;
}
.portal-fields {
  width: min(100%, 25rem);
  min-width: 0;
  margin-inline: auto;
}
#console-view #login-panel .portal-heading,
.portal-auth .portal-heading {
  margin: 0 0 1.6rem;
  color: var(--auth-ink);
  font-size: clamp(1.85rem, 2.8vw, 2.6rem);
  font-weight: 680;
  line-height: 1.22;
  letter-spacing: -.045em;
}
#console-view #login-form,
.portal-auth form {
  display: grid;
  gap: 1.05rem;
}
.portal-auth .portal-fields label {
  display: grid;
  min-width: 0;
  gap: .45rem;
  color: #454351;
  font-size: .9rem;
  font-weight: 550;
}
.portal-auth .portal-fields input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: .62rem .8rem;
  border: 1px solid #c7c5d0;
  border-radius: .65rem;
  background: #fff;
  color: var(--auth-ink);
  font-size: 1rem;
}
.portal-auth :is(input, button, a):focus-visible {outline: 3px solid #947bd9; outline-offset: 3px}
.portal-auth form button[type=submit], #console-view #login-submit {
  min-height: 46px;
  padding: .6rem 1rem;
  border: 1px solid var(--auth-action);
  border-radius: .65rem;
  background: var(--auth-action);
  color: white;
  font-weight: 650;
}
.portal-auth form button[type=submit]:hover:not(:disabled) {background: #48329e}
.portal-auth .portal-switch {
  display: block;
  width: fit-content;
  margin-inline: auto;
  color: #50379d;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: .2em;
}
#portal-register .portal-switch {margin-top: 1rem}
.portal-auth .code-entry {display: flex; gap: .55rem; align-items: end}
.portal-auth .code-entry label {flex: 1}
.portal-auth .code-entry button {
  min-height: 46px;
  flex: none;
  padding: .55rem .85rem;
  border: 1px solid #c8bedf;
  border-radius: .65rem;
  background: #f1edf8;
  color: #50379d;
}
.portal-auth .quiet, #console-view #login-form .quiet {
  margin: 0;
  color: var(--auth-muted);
  font-size: .85rem;
  line-height: 1.55;
}
#portal-register :is(#admission, #status):not(:empty) {margin-top: .8rem}
#portal-register #status {padding: .7rem .9rem; border: 0; background: #ece7f5; color: #42325c; border-radius: .55rem}
#portal-register #status[data-error] {background: #ffede8; color: #872d21}
#portal-register :is(#status, #admission):empty {display: none}
@media (max-width: 730px) {
  .portal-auth-layout {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 1.5rem;
    max-width: 30rem;
    padding: 1rem 1rem 2rem;
  }
  .portal-art {
    height: clamp(8rem, 24vh, 11rem);
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background-position: center 56%;
  }
  .portal-wordmark {font-size: .95rem}
  .portal-art-name {font-size: 1.8rem}
  #console-view #login-panel .portal-heading, .portal-auth .portal-heading {margin-bottom: 1.15rem}
}
