.auth-page {
  min-height: 100vh;
}

.auth-main {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 1rem;
  place-items: center;
}

.auth-brand {
  position: absolute;
  top: clamp(1rem, 3vh, 1.75rem);
  left: 50%;
  margin: 0;
  min-height: auto;
  padding: 0.35rem 0.6rem;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  transform: translateX(-50%);
}

.auth-shell {
  width: min(940px, calc(100vw - 2rem));
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 18px 52px var(--shadow);
}

.auth-shell-sign-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(1200px, calc(100vw - 2rem));
}

.auth-intro,
.auth-form-panel {
  padding: clamp(1.8rem, 4vw, 3rem);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}

.auth-form-panel {
  background: var(--surface-deep);
}

.auth-shell-sign-up .auth-form-panel {
  padding-bottom: 1.5rem;
}

.auth-shell-sign-up .auth-account-meta {
  margin-top: 0.2rem;
}

.auth-shell-sign-in {
  width: min(450px, calc(100vw - 2rem));
  overflow: visible;
  background: var(--transparent);
  box-shadow: none;
}

.auth-shell-sign-in .auth-form-panel {
  padding: 1rem clamp(0rem, 2vw, 1.25rem) 0;
  background: var(--transparent);
}

.auth-shell-sign-in .auth-account-meta {
  margin-top: 0.5rem;
}

.auth-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.08;
}

.auth-caption {
  margin: 1rem 0 0;
  color: var(--muted);
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.08rem;
  line-height: 1.55;
}

.auth-shell-sign-in .auth-heading {
  margin-bottom: 2rem;
  text-align: center;
}

.auth-shell-sign-in .auth-caption {
  margin-top: 0.55rem;
}

.auth-form {
  display: grid;
  gap: 0.82rem;
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.auth-field {
  display: grid;
  gap: 0.42rem;
}

.auth-field label {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.auth-input {
  width: 100%;
  min-height: 46px;
  padding: 0.68rem 0.78rem;
  border: 0;
  border-radius: 7px;
  outline: none;
  color: var(--ink);
  background: var(--surface-active);
  box-shadow: inset 0 0 0 1px var(--transparent);
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.auth-input::placeholder {
  color: var(--subtle);
  opacity: 0.72;
}

.auth-input:hover {
  background: var(--surface-hover);
}

.auth-input:focus {
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.auth-input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 1.5px var(--error);
}

.auth-feedback {
  display: grid;
  gap: 0.2rem;
}

.auth-feedback:empty,
.auth-feedback [hidden] {
  display: none;
}

.auth-message {
  margin: 0;
  color: var(--error);
  font-size: 0.9rem;
  line-height: 1.35;
}

.auth-message.is-muted {
  color: var(--subtle);
}

.auth-message.is-success {
  color: var(--success);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin: 0.25rem 0;
  color: var(--subtle);
  font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  content: "";
  background: var(--subtle);
  opacity: 0.45;
}

.auth-socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.auth-social-button,
.auth-submit {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease,
    opacity 150ms ease;
}

.auth-social-button {
  color: var(--muted);
  background: var(--transparent);
  box-shadow: inset 0 0 0 1px var(--subtle);
}

.auth-social-button:hover,
.auth-social-button:focus-visible {
  color: var(--ink);
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.auth-submit {
  margin-top: 0.15rem;
  color: var(--text-on-accent);
  background: var(--accent);
}

.auth-submit:hover,
.auth-submit:focus-visible {
  background: var(--accent-bright);
}

.auth-submit:active,
.auth-social-button:active {
  transform: translateY(1px);
}

.auth-submit:disabled,
.auth-social-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.auth-switch,
.auth-legal {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

.auth-switch a,
.auth-legal a {
  color: var(--accent-bright);
  text-underline-offset: 0.18em;
}

.auth-legal {
  color: var(--subtle);
  font-size: 0.7rem;
  white-space: nowrap;
}

.auth-switch + .auth-legal {
  margin-top: 0.28rem;
}

.auth-form-status {
  margin: 0;
  color: var(--error);
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: center;
}

.auth-form-status:empty {
  display: none;
}

.auth-account-meta {
  display: grid;
  gap: 0.28rem;
  margin-top: 0;
}

.auth-form-status.is-success {
  color: var(--success);
}

@media (max-width: 760px) {
  .auth-main {
    padding-top: 4.5rem;
    place-items: start center;
  }

  .auth-shell-sign-up {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-intro,
  .auth-form-panel {
    padding: clamp(1.55rem, 7vw, 2.5rem);
  }

  .auth-intro {
    min-height: 220px;
  }
}

@media (max-width: 1040px) {
  .auth-legal {
    white-space: normal;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .auth-main {
    padding-top: 4.25rem;
    place-items: start center;
  }

  .auth-brand {
    top: 0.65rem;
  }
}

@media (max-width: 430px) {
  .auth-main {
    padding-inline: 0.65rem;
  }

  .auth-shell,
  .auth-shell-sign-in {
    width: calc(100vw - 1.3rem);
  }

  .auth-shell-sign-up {
    border-radius: 12px;
  }

  .auth-socials {
    grid-template-columns: 1fr;
  }
}
