/*
 * The identity shell's own paint.
 *
 * One centred card on the brand, no nav and no sidebar: a reader with no
 * session has no navigation to use, so the four identity pages take the
 * whole screen. This file owns every class the shell and its pages write;
 * a page names a class and never carries a <style> block of its own. All
 * colour and radius comes from tokens.css, so the sign-in card cannot
 * drift from the rest of the brand.
 *
 * One column at every width: the card is centred with room to breathe, and
 * nothing on the page is wider than its column.
 */

.auth {
  min-height: 100vh;
  background: var(--color-surface);
}

.auth__main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 1rem;
}

.auth__card {
  width: 100%;
  max-width: 28rem;
  margin: auto;
  padding: 1.5rem;
  background: var(--color-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.auth__card h1 {
  font-size: 1.5rem;
}

.auth__brand {
  margin: 0 0 1.25rem;
}

.auth__foot-note {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

/* The shared state shape sits above the two doors on a failed sign-in. It
 * keeps its alert role and its support press; only the card's spacing and
 * alignment change, so the message reads as part of the form. */
.auth__card .empty {
  margin-bottom: 1.25rem;
  padding: 1rem;
  text-align: left;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.auth__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.auth__field input {
  min-height: 2.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-weight: 400;
  background: var(--color-raised);
  color: var(--color-ink);
}

/* The focus ring comes from tokens.css; this is the matching border so the
 * field the reader is in is clear even at a glance. */
.auth__field input:focus-visible {
  border-color: var(--color-primary);
}

.auth__field input:read-only {
  background: var(--color-surface);
  color: var(--color-ink);
}

.auth__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

/* The one link in a row sits at the field's right edge, above the label. */
.auth__form .auth__row {
  justify-content: flex-end;
}

.auth__submit {
  min-height: 2.75rem;
  width: 100%;
}

.auth__notice {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-control);
  font-size: 0.875rem;
}

.auth__notice--error {
  border: 1px solid var(--color-error);
  color: var(--color-error);
  background: var(--color-raised);
}

.auth__notice--note {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-ink);
}

.auth__google {
  margin-top: 1.25rem;
}

/* One line on each side of the word keeps the two doors apart without a
 * second colour or a competing accent. The text stays in the markup for a
 * screen reader; the rules are painted by CSS. */
.auth__or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-ink);
  opacity: 0.7;
}

.auth__or::before,
.auth__or::after {
  content: "";
  flex: 1;
  height: 0.0625rem;
  background: var(--color-border);
}

.auth__foot {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9375rem;
}

.auth .small {
  font-size: 0.8125rem;
}

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

/* The native <details> is the disclosure: no script reads or writes the
 * password. The chevron only tells the reader which way it will open. */
.auth__username {
  margin-top: 1.25rem;
}

.auth__username-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  cursor: pointer;
  color: var(--color-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  list-style: none;
}

.auth__username-toggle::-webkit-details-marker {
  display: none;
}

.auth__username-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.auth__username-toggle::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 0.4rem;
  border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(45deg) translateY(-0.1rem);
}

.auth__username[open] .auth__username-toggle {
  margin-bottom: 1rem;
}

.auth__username[open] .auth__username-toggle::after {
  transform: rotate(225deg) translateY(-0.1rem);
}

@media (min-width: 640px) {
  .auth__main {
    padding: 4rem 1.25rem;
  }

  .auth__card {
    padding: 2rem;
  }
}
