.session-loading {
  display: grid;
  min-height: 100svh;
  place-items: center;
  color: #52665e;
  font-size: .95rem;
}

.session-loading[hidden], .auth-view[hidden], .auth-name-fields[hidden], .auth-error[hidden] {
  display: none;
}

.auth-view {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(20px, 5vw, 72px);
  padding-block: clamp(22px, 4vh, 52px);
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", sans-serif;
}

.auth-layout {
  width: min(100%, 464px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 48px #273c2814;
  overflow: hidden;
}

.auth-panel {
  padding: clamp(24px, 6vw, 39px);
}

.auth-content {
  width: min(100%, 420px);
  margin-inline: auto;
}

.auth-panel .auth-brand {
  width: auto;
  justify-content: center;
  margin-bottom: 25px;
}

.auth-panel .auth-brand img {
  width: clamp(211px, 57vw, 253px);
  max-width: 100%;
}

.auth-heading {
  margin-bottom: 21px;
}

.auth-heading h1 {
  font-size: clamp(1.33rem, 3.7vw, 1.6rem);
  font-weight: 710;
  line-height: 1.22;
  letter-spacing: -.025em;
}

.auth-heading p {
  max-width: 40ch;
  margin-top: 6px;
  color: #536459;
  font-size: .92rem;
  line-height: 1.55;
}

#auth-form {
  display: grid;
  gap: 15px;
}

#auth-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: .9rem;
  font-weight: 680;
}

#auth-form input {
  width: 100%;
  min-height: 49px;
  padding: 11px 14px;
  border: 1px solid var(--control-line);
  border-radius: 12px;
  background: #fff;
  color: #1d3025;
  font-size: 1rem;
  font-weight: 450;
}

#auth-form input::placeholder {
  color: #69786d;
}

.auth-name-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.auth-password-field {
  position: relative;
  margin-top: 6px;
}

#auth-form #auth-password {
  padding-right: 88px;
}

#auth-password-toggle {
  position: absolute;
  inset: 5px 6px 5px auto;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #315742;
  font-size: .85rem;
  font-weight: 700;
}

#auth-password-toggle:hover {
  background: #edf2e8;
}

.auth-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 3px;
  padding: 11px 16px;
  border: 1px solid #204d3d;
  border-radius: 12px;
  background: #204d3d;
  color: white;
  font-size: 1rem;
  font-weight: 740;
}

.auth-submit:hover:not(:disabled) {
  background: #163c2f;
}

.auth-submit:disabled {
  opacity: .8;
}

.auth-switch {
  margin-top: 21px;
  padding-top: 14px;
  border-top: 1px solid #e6e9df;
  color: #536459;
  font-size: .93rem;
  text-align: center;
}

.auth-switch button {
  padding: 4px 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #204d3d;
  font-weight: 780;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-error {
  padding: 9px 12px;
  border: 1px solid #f0c9bd;
  border-radius: 9px;
  background: #fff0eb;
  color: #87392d;
  font-size: .88rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .auth-view { align-items: start; padding: 19px 15px; }
  .auth-layout { border-radius: 22px; }
  .auth-panel .auth-brand { margin-bottom: 22px; }
}

@media (max-width: 370px) {
  .auth-name-fields { grid-template-columns: 1fr; }
}
