/* The customer sign-in and sign-up pages: a wordmark panel beside a plain form,
 * after the internal tracker's sign-in page, except that this one may name the
 * product. Flat token fills only: no gradient, glow or shadow, which is the
 * look of a generated landing page rather than of the product behind it.
 *
 * These pages used to borrow login.css, the operator form's stylesheet, and
 * every rule written for one form landed on the other (AIP-103). They now
 * share only tokens.css.
 *
 * The form column is `--bg-surface` because that is the ground Clerk's card is
 * painted in (colorBackground in portal-sign-in.js): any other tone and the
 * widget reads as a box dropped on the page. */

body { background: var(--bg-surface); }

.split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.brand {
  display: flex;
  align-items: center;
  padding: var(--step-6);
  background: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
}

.wordmark {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.wordmark .maker {
  display: block;
  font-size: 0.4em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-secondary);
}

.form-column {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: var(--step-6) var(--step-4);
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--step-3);
  width: min(28rem, 100%);
  min-width: 0;
}

.sub { margin: 0; color: var(--text-muted); }

/* Where Clerk's component lands. It arrives sized by Clerk — the card box
 * computes to a fixed 350px — so on a phone it hung past both edges and
 * scrolled the page sideways at 390px. A flex item will not shrink below its
 * own content either, so the floor has to be released here before the width
 * handed to Clerk in portal-sign-in.js can take. Nothing is positioned: the
 * overhang was width overflow, and floating the widget would hide it rather
 * than fix it. */
#clerk-mount { width: 100%; min-width: 0; }

/* Two data attributes naming the Clerk instance, not something to look at.
 * Left displayed it is an empty flex item that still takes a row and a gap —
 * part of the dead band between the intro copy and the widget. */
#clerk-config { display: none; }

.message { margin: 0; min-height: 1.3em; color: var(--accent-red); }
/* Progress, not a verdict. In the line's own red, "Loading the sign-in form…"
   read as a failure before anything had failed (FE-013). */
.message.info { color: var(--text-secondary); }

/* The way out when Clerk does not come up, pressed with a finger on a phone:
   44px is the smallest target a thumb reliably hits (UI-5). The ink is
   --on-accent because white on the dark palette's blue is 2.78:1. */
#retry {
  min-height: 44px;
  padding: 0 var(--step-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent-blue);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* The second way out, beside Retry, for a Clerk user the platform refuses.
   Outlined rather than filled, so Retry stays the one the eye lands on. */
#sign-out {
  min-height: 44px;
  padding: 0 var(--step-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}

/* The links across to the other page and to staff sign-in. Text links, but
   tapped on a phone like any button, so the line box is grown to 44px rather
   than the link padded into a pill. */
.other { margin: 0; color: var(--text-muted); }
.other a { display: inline-flex; align-items: center; min-height: 44px; }
.staff a { color: var(--text-secondary); font-size: 0.93rem; }

/* A phone: the panel becomes a heading band above the form, so the form is
   on the first screen rather than a viewport's scroll below a wordmark. */
@media (max-width: 48rem) {
  .split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .brand {
    padding: var(--step-4);
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .wordmark { font-size: 1.6rem; }
  .wordmark .maker { display: inline; font-size: inherit; }
  .form-column { place-items: start center; padding: var(--step-5) var(--step-4); }
}
