/* Password gate for the weekly dashboard. Tokens/fonts come from dashboard.css. */

.login-body {
  min-height: 100vh;
  background: var(--background);
  overflow-x: hidden;
}

.auth {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 100vh;
  width: 100%;
}

.auth__brand,
.auth__panel {
  min-width: 0;
}

/* ---- Left: brand pattern ---- */
.auth__brand {
  position: relative;
  overflow: hidden;
  background: var(--clay-900) url("/static/images/primary-pattern.svg") center / cover
    no-repeat;
}

.auth__brand-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--clay-900) 0%, transparent) 38%,
    color-mix(in oklab, var(--clay-900) 34%, transparent) 68%,
    color-mix(in oklab, var(--clay-900) 74%, transparent) 100%
  );
}

.auth__brand-caption {
  position: absolute;
  left: clamp(1.75rem, 3.4vw, 3rem);
  right: 2rem;
  bottom: clamp(1.75rem, 3.4vw, 3rem);
  color: var(--background);
}

.auth__rule {
  display: block;
  width: 38px;
  height: 2px;
  margin-bottom: 1.1rem;
  background: var(--background);
  opacity: 0.85;
}

.auth__tagline {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 2.5vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 1px 24px color-mix(in oklab, var(--clay-900) 40%, transparent);
}

.auth__brand-sub {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  opacity: 0.86;
}

/* ---- Right: form ---- */
.auth__panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.75rem, 4vw, 3.25rem) clamp(1.5rem, 4vw, 3.5rem);
  background: var(--background);
}

.auth__lockup {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.auth__lockup img {
  display: block;
  height: 19px;
  width: auto;
}

.auth__form-wrap {
  width: 100%;
  max-width: min(23rem, 100%);
  margin: auto 0;
  padding-block: 2rem 0;
}

.auth__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--foreground-strong);
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.auth__sub {
  margin: 0 0 2rem;
  max-width: 26ch;
  color: var(--foreground-muted);
  font-size: 1rem;
}

.auth__field-label {
  display: block;
  margin: 0 0 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--foreground-strong);
}

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

.auth__lock {
  position: absolute;
  left: 0.9rem;
  display: flex;
  color: var(--foreground-muted);
  pointer-events: none;
}

.auth__input {
  width: 100%;
  height: 3.25rem;
  padding: 0 3rem 0 2.7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground-strong);
  font: inherit;
  letter-spacing: 0.02em;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.auth__input::placeholder {
  color: var(--foreground-muted);
  letter-spacing: normal;
}

.auth__input:hover {
  border-color: var(--surface-strong);
}

.auth__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 45%, transparent);
}

.auth__toggle {
  position: absolute;
  right: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground-muted);
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}

.auth__toggle:hover {
  color: var(--foreground-strong);
  background: var(--surface-muted);
}

.auth__toggle:focus-visible {
  outline: none;
  color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 45%, transparent);
}

.auth__field.is-error .auth__input {
  border-color: var(--danger);
}

.auth__field.is-error .auth__input:focus {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 40%, transparent);
}

.auth__error {
  margin: 0.6rem 0 0;
  color: var(--danger);
  font-size: 0.875rem;
}

.auth__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 3.25rem;
  margin-top: 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--background);
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.05s ease;
}

.auth__btn:hover {
  background: var(--accent-hover);
}

.auth__btn:active {
  transform: translateY(1px);
}

.auth__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 45%, transparent);
}

.auth__loader {
  display: none;
  align-items: center;
  gap: 0.6rem;
}

.auth__btn.is-loading .auth__btn-label {
  display: none;
}

.auth__btn.is-loading .auth__loader {
  display: inline-flex;
}

.auth__dots {
  position: relative;
  width: 16px;
  height: 16px;
}

.auth__dots i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--background);
  opacity: 0.55;
  animation: auth-pulse 1.05s ease-in-out infinite;
}

.auth__dots i:nth-child(1) {
  top: 0;
  left: 6px;
  animation-delay: 0s;
}
.auth__dots i:nth-child(2) {
  top: 6px;
  right: 0;
  animation-delay: 0.13s;
}
.auth__dots i:nth-child(3) {
  bottom: 0;
  left: 6px;
  animation-delay: 0.26s;
}
.auth__dots i:nth-child(4) {
  top: 6px;
  left: 0;
  animation-delay: 0.39s;
}

@keyframes auth-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.auth__foot {
  margin: 0;
  padding-top: 2rem;
  color: var(--foreground-muted);
  font-size: 0.8125rem;
}

/* ---- Responsive: stack ---- */
@media (max-width: 820px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 34vh auto;
  }
  .auth__brand {
    min-height: 220px;
  }
  .auth__panel {
    padding: 1.5rem 1.5rem 2rem;
  }
  .auth__form-wrap {
    max-width: 100%;
    margin: 0;
    padding-block: 1.5rem 0;
  }
  .auth__tagline {
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth__dots i {
    animation: none;
    opacity: 0.9;
  }
  .auth__input,
  .auth__toggle,
  .auth__btn {
    transition-duration: 0.01ms;
  }
}
