/*
 * Auth layout: sign-in and password pages of the back office (admin_users/*)
 *   .auth          brand band on top, two columns from 960px (brand panel + form)
 *   .auth-brand    dark "polished wood" panel (--gradient-foreground)
 *   .auth-main     form column; .auth-content caps the measure
 *   .auth-header   .auth-title + .auth-lead
 *   .auth-form     stack of .field, .auth-row, submit .btn
 *   .auth-alert    error banner (failed sign-in, invalid reset link)
 *   .auth-link     inline text link (forgot password, back links)
 * Fields and buttons come from components/field and components/button.
 */

.auth {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--background);
  font-family: var(--font-sans);
}

/* ── Brand panel ── */
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-6) var(--space-6);
  background: var(--gradient-foreground);
  color: var(--foreground);
}
.auth-brand-name {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
}

/* ── Form column ── */
.auth-main {
  display: flex;
  align-items: flex-start;
  padding: var(--space-10) var(--space-6) var(--space-16);
}
.auth-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  width: 100%;
  max-width: 25rem;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  color: var(--foreground);
}
.auth-lead {
  margin-top: var(--space-3);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--muted-foreground);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.auth-form .btn { margin-top: var(--space-2); }

/* Remember me + forgot password on one line, wrapping on narrow screens */
.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
}

.auth-link {
  font-size: var(--text-sm);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--input);
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}
.auth-link:hover {
  color: var(--foreground);
  text-decoration-color: currentColor;
}

.auth-footer { font-size: var(--text-sm); }

/* ── Errors ──
 * --destructive marks the banner edge, the dot and the input; the messages stay in
 * the regular ink so an error reads as calm guidance, not an alarm. */
.auth-alert {
  padding: var(--space-4) var(--space-5);
  background: var(--destructive-tint);
  border-left: 2px solid var(--destructive);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--foreground);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.auth-alert .auth-link {
  display: inline-block;
  margin-top: var(--space-2);
}

.auth .input[aria-invalid="true"] { border-color: var(--destructive); }
.auth .field-message.is-error {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--muted-foreground);
}
.auth .field-message.is-error::before {
  content: "";
  flex-shrink: 0;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-pill);
  background: var(--destructive);
  transform: translateY(-0.1em);
}

/* ── Wide screens: brand panel on the left, form on the right ── */
@media (min-width: 960px) {
  .auth {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
  .auth-brand { padding: var(--space-16) var(--space-12); }
  .auth-brand-name { font-size: var(--text-3xl); }
  .auth-main {
    align-items: center;
    padding: var(--space-16) var(--space-20);
  }
}
