/* styles/pages/auth.css */
/* One compact brand lockup and a focused form, grouped in the viewport. */

.auth-page {
  position: relative;
  z-index: var(--z-content);
  min-height: 100dvh;
  color: var(--ink);
}

.auth-gateway {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 32rem);
  margin-inline: auto;
  min-height: 100dvh;
  padding-inline: max(var(--padding), env(safe-area-inset-left), env(safe-area-inset-right));
  padding-block: var(--space-6);
}

/* ---------------------------------------------------------------- masthead */

/* The logo and the form share a center line and one outer gutter. */
.auth-masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  inline-size: 100%;
  padding-block-end: var(--space-5);
}

/* -------------------------------------------------------------------- body */

.auth-body {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 100%;
}

.auth-form-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  inline-size: min(100%, 34rem);
}

.auth-card {
  width: 100%;
  max-width: 34rem;
  padding: clamp(var(--space-4), 4vw, var(--space-6));
}

/* -------------------------------------------------------------------- form */

.auth-head {
  margin-bottom: var(--space-5);
}

.auth-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  text-wrap: balance;
}

.auth-subtitle {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.auth-errors {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-control);
  background: var(--danger-tint);
  color: var(--ink);
}

.auth-errors .ui-icon {
  color: var(--danger);
}

.auth-errors p {
  flex: 1 1 12rem;
  margin: 0;
  font-size: var(--text-label);
  font-weight: var(--weight-body);
  line-height: 1.4;
}

.auth-field {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--ink);
  font-size: var(--text-label);
  font-weight: var(--weight-body);
}

.auth-field .field-label {
  font-family: var(--font-ui);
  font-size: var(--text-control);
  font-weight: var(--weight-strong);
  color: var(--ink);
}

/* Match the comfortable, rounded controls used in Settings. */
.auth-field input {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 var(--space-4);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-control);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  transition:
    border-color var(--duration-ui) var(--ease-out),
    background-color var(--duration-ui) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .auth-field input:hover {
    border-color: var(--ink-muted);
  }
}

.auth-field input:focus {
  background: var(--paper-raised);
  border-color: var(--ink);
}

.auth-field input::placeholder {
  color: var(--ink-muted);
}

.auth-actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* Layout and typographic treatment only. The surface, every interaction state
   and the target size belong to `.ui-button--accent` in the button component,
   which this composes rather than overrides. */
.auth-submit {
  justify-content: center;
  width: 100%;
  min-height: 56px;
  font-size: var(--text-body);
}

/* Keep the alternative action centered beneath the primary. */
.auth-secondary {
  justify-self: center;
  padding-inline: var(--space-3);
}

/* Language and scheme sit under the form, where a signed-out reader who cannot
   read the form's language will look for them. */
.auth-preferences {
  margin-top: var(--space-5);
}

/* ------------------------------------------------------- reader preferences */

@media (prefers-contrast: more) {
  .auth-field input {
    border-color: var(--ink);
  }
}