/* pages/auth — sign in, create an account, forgot and reset (DESIGN.md §6, §9 field spec).
   White ground, hung left, generous space: the introduction in the first columns, the form in the
   last, one hairline foot. No sheet, no frame, no rotated margin label — the quiet is the design.
   This file is served to signed-out visitors, so no member vocabulary appears anywhere in it,
   comments included. */

.auth {
  padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(3rem, 7vw, 6rem);
  background: var(--bg); color: var(--fg-2);
}
.auth__grid { row-gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }

/* ---- Introduction ---------------------------------------------------------------------------- */
.auth__intro { display: flex; flex-direction: column; gap: 1.5rem; }
.auth__eyebrow { color: var(--fg-3); }
.auth__title { font-size: var(--t-display-l); line-height: .98; letter-spacing: -.025em; margin: 0; max-width: 11ch; color: var(--fg); }
.auth__lead { color: var(--fg-2); max-width: 34ch; margin: 0; }

/* ---- Form ------------------------------------------------------------------------------------ */
.auth__body { display: flex; flex-direction: column; gap: clamp(1.75rem, 3vw, 2.5rem); padding-block-start: .35rem; }
.auth__form { gap: clamp(1.75rem, 3vw, 2.25rem); }
.auth .field { gap: .6rem; }
.auth .field__control { position: relative; }
.auth .field__input { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); padding-block: .5rem .65rem; }
.auth .field__hint { max-width: 36ch; }
.auth .field__errors { display: flex; flex-direction: column; gap: .25rem; }
.auth .field__peek { bottom: .6rem; }
.auth .field--peek .field__input { padding-inline-end: 4.5rem; }
.auth input[type="date"].field__input { color-scheme: light; min-width: 0; }
.auth input[type="date"].field__input::-webkit-datetime-edit { padding: 0; }
/* The native picker glyph is kept (it is the only pointer route to the calendar) but quietened to the
   eyebrow's weight and size so the row still reads as a bare hairline of type. */
.auth input[type="date"].field__input::-webkit-calendar-picker-indicator {
  opacity: .35; filter: none; cursor: pointer; width: var(--t-eyebrow); height: var(--t-eyebrow); padding: 0; margin-inline-start: .5rem;
}
.auth input[type="date"].field__input:hover::-webkit-calendar-picker-indicator,
.auth input[type="date"].field__input:focus::-webkit-calendar-picker-indicator { opacity: .7; }
.auth .field__input:-webkit-autofill,
.auth .field__input:-webkit-autofill:hover,
.auth .field__input:-webkit-autofill:focus { -webkit-text-fill-color: var(--fg); -webkit-box-shadow: 0 0 0 1000px var(--bg) inset; caret-color: var(--fg); transition: background-color 9999s; }

/* Strength hint: a 1px line along the field's underline that grows with the entry. Colour is never
   the only signal — the sentence under the field changes with it. */
.key__meter {
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: var(--mark); transform-origin: left center; transform: scaleX(var(--p, 0));
  transition: transform 600ms var(--ease-out);
}
.field[data-strength="short"] .key__meter { background: var(--fg-3); }
.field[data-strength="short"] .field__hint, .field[data-strength="empty"] .field__hint { color: var(--fg-3); }
.field[data-strength="enough"] .field__hint, .field[data-strength="good"] .field__hint,
.field[data-strength="strong"] .field__hint, .field[data-strength="very-strong"] .field__hint { color: var(--fg-2); }

/* ---- Server messages, read inside the form rather than as a note in the corner ---------------- */
.auth__alert { margin: 0; }
.auth__ok { font-size: var(--t-lead); line-height: 1.4; color: var(--mark); max-width: 34ch; margin: 0; }

/* ---- Actions --------------------------------------------------------------------------------- */
.auth__actions { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem 2.5rem; padding-block-start: .25rem; }
.auth__submit { color: var(--fg); }
.auth__quiet {
  color: var(--fg-3); font-size: var(--t-body); padding-block: .5rem; min-height: 44px; display: inline-flex; align-items: center;
  background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat;
  background-size: 100% 1px; background-position: left calc(100% - .55rem);
  transition: color var(--d-hover) var(--ease-out), background-size var(--d-hover) var(--ease-out);
}
.auth__quiet:hover { color: var(--fg); background-size: 0 1px; background-position: right calc(100% - .55rem); }
/* The fine print takes its own row under the button rather than crowding it. */
.auth__fine { flex: 1 0 100%; color: var(--fg-3); max-width: 46ch; margin-block-start: .25rem; }
.auth__fine a { color: var(--fg-3); }
.auth__fine a:hover { color: var(--fg); }

/* The other way in. */
.auth__alt { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .75rem 2rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--line); }
.auth__alt .btn { color: var(--fg); }

/* ---- Foot ------------------------------------------------------------------------------------ */
.auth__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  margin-block-start: clamp(3rem, 7vw, 6rem); padding-block-start: 1rem;
  border-block-start: 1px solid var(--line); color: var(--fg-3); }
.auth__legal a { color: inherit; background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-size: 100% 1px; background-position: left 100%; }
.auth__legal a:hover { color: var(--fg); }

/* ---- Under 64em: one column, the introduction first ------------------------------------------ */
@media (max-width: 63.98em) {
  .auth { padding-block: clamp(1.75rem, 5vw, 3rem) clamp(2.5rem, 6vw, 4rem); }
  .auth__grid { row-gap: 2.25rem; }
  .auth__intro { gap: 1.1rem; }
  .auth__title { max-width: none; }
  .auth__lead { max-width: 40ch; }
  .auth__form { gap: 1.75rem; }
  .auth__actions { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .auth__foot { flex-direction: column; gap: .5rem; margin-block-start: 3rem; }
}
@media (max-width: 39.98em) {
  .auth .field__input { font-size: 1.0625rem; }
  .auth__ok { font-size: var(--t-body); }
}
