/*=============== AUTH PAGES ===============*/
body.auth-page {
  min-height: 100vh;
}

.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 2rem) 1.25rem 2.5rem;
}

.auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.75rem;
  animation: auth-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth__brand-mark {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: var(--font-semibold);
  color: var(--title-color);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}

.auth__brand-mark span {
  color: var(--first-color);
}

.auth__brand-line {
  margin-top: 0.55rem;
  max-width: 22rem;
  color: var(--text-color);
  font-size: var(--small-font-size);
  line-height: 1.55;
}

.auth__panel {
  width: min(26rem, 100%);
  padding: 1.65rem 1.4rem 1.5rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(
      165deg,
      hsla(var(--first-hue), var(--sat), var(--lig), 0.14),
      transparent 44%
    ),
    hsla(240, 8%, 8%, 0.88);
  border: 1px solid hsla(0, 0%, 100%, 0.08);
  box-shadow: 0 28px 64px hsla(240, 10%, 2%, 0.45);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  animation: auth-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.auth__eyebrow {
  margin: 0 0 0.3rem;
  font-size: var(--tiny-font-size);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--first-color);
  font-weight: var(--font-semibold);
}

.auth__title {
  margin: 0 0 0.35rem;
  font-size: var(--h2-font-size);
  color: var(--title-color);
  font-weight: var(--font-semibold);
}

.auth__subtitle {
  margin: 0 0 1.35rem;
  color: var(--text-color);
  font-size: var(--small-font-size);
  line-height: 1.5;
}

.auth__form {
  display: grid;
  gap: 1rem;
}

.auth__field {
  display: grid;
  gap: 0.4rem;
}

.auth__label {
  font-size: var(--smaller-font-size);
  color: var(--text-color);
  font-weight: var(--font-medium);
}

.auth__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth__input-wrap i {
  position: absolute;
  left: 0.9rem;
  color: var(--text-color-light);
  font-size: 1.15rem;
  pointer-events: none;
}

.auth__input {
  width: 100%;
  height: 3rem;
  padding: 0 2.75rem 0 2.55rem;
  border-radius: 0.75rem;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  background: hsla(0, 0%, 100%, 0.04);
  color: var(--title-color);
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.auth__input::placeholder {
  color: var(--text-color-light);
}

.auth__input:hover {
  border-color: hsla(var(--first-hue), var(--sat), var(--lig), 0.35);
}

.auth__input:focus {
  border-color: var(--first-color);
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.08);
  box-shadow: 0 0 0 3px hsla(var(--first-hue), var(--sat), var(--lig), 0.18);
}

.auth__toggle-pass {
  position: absolute;
  right: 0.45rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-color-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}

.auth__toggle-pass:hover {
  color: var(--first-color);
}

.auth__hint {
  margin: 0;
  font-size: var(--tiny-font-size);
  color: var(--text-color-light);
}

.auth__actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.auth__submit {
  width: 100%;
  height: 3rem;
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
  font-weight: var(--font-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.2s ease, background-color 0.25s ease;
}

.auth__submit:active {
  transform: scale(0.98);
}

.auth__submit[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.auth__status {
  min-height: 1.25rem;
  margin: 0.15rem 0 0;
  font-size: var(--smaller-font-size);
  line-height: 1.4;
}

.auth__status.is-error {
  color: hsl(0, 72%, 68%);
}

.auth__status.is-ok {
  color: hsl(152, 55%, 58%);
}

.auth__switch {
  margin-top: 1.15rem;
  text-align: center;
  font-size: var(--small-font-size);
  color: var(--text-color);
}

.auth__switch a {
  color: var(--first-color);
  font-weight: var(--font-medium);
}

.auth__switch a:hover {
  color: var(--first-color-alt);
}

.auth__back {
  margin-top: 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-color);
  font-size: var(--small-font-size);
  animation: auth-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.auth__back:hover {
  color: var(--first-color);
}

.auth__provider-note {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid hsla(0, 0%, 100%, 0.08);
  font-size: var(--tiny-font-size);
  color: var(--text-color-light);
  line-height: 1.45;
  text-align: center;
}

/* Header session chip (shared) */
.auth-chip {
  display: none;
  align-items: center;
  gap: 0.45rem;
  max-width: 11rem;
  padding: 0.35rem 0.65rem 0.35rem 0.4rem;
  border-radius: 999px;
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  background: hsla(0, 0%, 100%, 0.05);
  color: var(--title-color);
  text-decoration: none;
  font-size: var(--smaller-font-size);
}

.auth-chip.is-visible {
  display: inline-flex;
}

.auth-chip__avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.28);
  color: var(--first-color);
  font-weight: var(--font-semibold);
  font-size: var(--tiny-font-size);
  flex-shrink: 0;
}

.auth-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: var(--title-color);
  font-size: 1.35rem;
  border: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.auth-login-link:hover {
  color: var(--first-color);
  border-color: hsla(var(--first-hue), var(--sat), var(--lig), 0.35);
  background: hsla(var(--first-hue), var(--sat), var(--lig), 0.1);
}

.auth-login-link.is-hidden {
  display: none;
}

.nav-waterfall__item[data-auth-chip] {
  display: none;
}

.nav-waterfall__item[data-auth-chip].is-visible {
  display: list-item;
}

.nav-waterfall__item[data-auth-login].is-hidden {
  display: none;
}

.light-theme .auth__panel {
  background:
    linear-gradient(
      165deg,
      hsla(var(--first-hue), var(--sat), 70%, 0.16),
      transparent 44%
    ),
    hsla(0, 0%, 100%, 0.92);
  border-color: hsla(219, 32%, 40%, 0.12);
  box-shadow: 0 24px 48px hsla(219, 32%, 20%, 0.12);
}

.light-theme .auth__input {
  background: hsla(219, 32%, 40%, 0.04);
  border-color: hsla(219, 32%, 40%, 0.14);
  color: hsl(219, 20%, 16%);
}

.light-theme .auth-chip {
  background: hsla(219, 32%, 40%, 0.06);
  border-color: hsla(219, 32%, 40%, 0.14);
  color: hsl(219, 20%, 16%);
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth__brand,
  .auth__panel,
  .auth__back {
    animation: none;
  }
}
