/*
 * APEX V3 — authentication pages (register / login).
 *
 * Layout only; all colour, type and spacing come from theme.css tokens.
 *
 * Design intent: an authentication screen is the first real contact with
 * the platform, so it is treated as an instrument panel rather than a
 * form. A narrow smoked-glass column sits on the void, with the wordmark
 * above it and the legal footing beneath. No globe here — the globe is a
 * statement, and a sign-in screen should be quiet and fast.
 */

.auth {
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: var(--sp-6) var(--sp-4) var(--sp-7);
  gap: var(--sp-5);
}

/* A single faint pool of light behind the card so the void has a centre. */
.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 52% 44% at 50% 34%, rgba(24, 44, 74, 0.42), transparent 72%);
}

.auth__head { display: grid; gap: var(--sp-2); justify-items: center; text-align: center; }
.auth__wordmark { font-size: clamp(26px, 4vw, 38px); margin: 0; }
.auth__title {
  font-family: var(--font-display);
  font-size: var(--fs-editorial-sm);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-strong);
  margin: 0;
}
.auth__sub { font-size: var(--fs-caption); color: var(--muted); max-width: 42ch; margin: 0; }

.auth__card {
  width: min(440px, 100%);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  display: grid;
  gap: var(--sp-4);
}

.auth__form { display: grid; gap: var(--sp-4); }

/* A single row for the form-level result: kept in the layout at all times
   so an error never pushes the submit button under the fold. */
.auth__result {
  min-height: 34px;
  display: grid;
  align-content: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--fs-caption);
  line-height: var(--lh-normal);
}
.auth__result[data-kind="error"] {
  border-color: rgba(217, 87, 107, 0.42);
  background: var(--red-dim);
  color: var(--red);
}
.auth__result[data-kind="success"] {
  border-color: rgba(79, 185, 138, 0.42);
  background: var(--green-dim);
  color: var(--green);
}
.auth__result[data-kind="info"] {
  border-color: var(--border-strong);
  color: var(--muted);
}
.auth__result[data-kind=""] { border-color: transparent; }

.auth__alt { font-size: var(--fs-caption); color: var(--muted); text-align: center; }

.auth__legal {
  font-size: var(--fs-micro);
  color: var(--dim);
  max-width: 52ch;
  text-align: center;
  line-height: var(--lh-normal);
}

/* Password requirement checklist. Each line reports state independently so
   the user can see exactly which rule is unmet, rather than one generic
   "password too weak". */
.reqs { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.reqs li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--sp-2);
  align-items: center;
  font-size: var(--fs-micro);
  color: var(--dim);
}
.reqs li::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}
.reqs li[data-met="true"] { color: var(--green); }
.reqs li[data-met="true"]::before { background: var(--green); }

/* Forgot-password disclosure. Deliberately NOT a link to a fake flow: the
   backend exposes no reset endpoint, so we say so plainly instead of
   pretending. */
.auth__forgot {
  font-size: var(--fs-micro);
  color: var(--dim);
  text-align: right;
}

.auth__busy {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  animation: apex-breathe 1200ms var(--ease-out) infinite;
}
@media (prefers-reduced-motion: reduce) { .auth__busy { animation: none; } }

@media (max-width: 560px) {
  .auth { padding-inline: var(--sp-3); }
  .auth__card { padding: var(--sp-4); }
}
