/* ─────────────────────────────────────────────────────────────────
   C Form Plus — the public auth shell
   ─────────────────────────────────────────────────────────────────

   ONE stylesheet for the seven signed-out pages that are not the landing page:

     register · verify-email · forgot-password · reset-password ·
     complete-profile · invites · accept-invite

   Every one of them carried its own inline <style> block — 170 lines across the
   seven, each a near-copy of the last, and they had already drifted: the shell
   padding matched but the brand mark was 44px on three pages and 40px on two,
   the input padding was 10/12 on one and 12/14 on the rest, the label margin was
   10, 12 or 14 depending on the file, and .auth-foot links were bold-and-grey on
   four pages and plain-grey on two. A visitor crosses several of these screens in
   one sitting.

   🔴 LOAD ORDER: home.css FIRST, then this file. home.css owns the tokens, the
   buttons and the .alert component; this file only adds the shell and overrides.
   Nothing here redefines a token.

   ⚠️ The webfont is NOT loaded by any stylesheet. Every page that links this one
   must also carry its own api.fontshare.com <link> (plus the one-glyph Inter
   subset for ₹), or it falls back to system sans with no error and no CSP
   violation. See the type comment in home.css.

   The two LOGIN pages (client/login.php, admin/login.php) are deliberately NOT
   here: they render on dashboard.css's .auth-card shell, which is a different
   component with the sidebar-era blobs behind it. Do not merge them — the
   duplication between the two shells is real but small, and unifying them means
   restyling the signed-in half of the app.
   ───────────────────────────────────────────────────────────────── */

/* ── The shell ─────────────────────────────────────────── */
body.auth-body {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--font);
}

.auth-shell {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
/* register: six fields, paired two-up. The extra width is what keeps the form
   inside a laptop viewport without scrolling. */
.auth-shell.is-wide { max-width: 520px; }
/* invites: a stack of invitation cards, each with a heading, a paragraph and a
   button — narrower and every card wraps twice. */
.auth-shell.is-widest { max-width: 540px; }

/* ── Brand lockup ──────────────────────────────────────── */
.auth-shell .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  text-decoration: none;
  color: var(--ink-2);
}
.auth-shell .brand img { height: 42px; }
.auth-shell .brand-text { font-size: 24px; font-weight: 600; }
/* home.css has no .serif-em rule, and without this the brand's <em> falls back
   to browser-default italic — the retired lockup. */
.serif-em { font-style: normal; font-weight: 600; color: var(--accent-strong); }
/* Brand "Plus" matches "C Form": the wordmark is one flat colour everywhere. */
.brand-text .serif-em { color: inherit; }

/* ── Headings ──────────────────────────────────────────── */
/* Two conventions on purpose, not by accident. .auth-h is the task pages
   ("Check your inbox", "One last step") — a large calm instruction. The invite
   screens use .auth-shell h1 with a .lede under it, because they have to name a
   property and then explain an invitation, which needs a smaller heading and a
   real paragraph rather than one line of sub-copy. */
.auth-h { font-family: var(--font); font-size: 26px; margin: 0 0 8px; }
.auth-sub { color: var(--ink-2); font-size: 14px; margin-bottom: 20px; }
.auth-shell h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.auth-shell p.lede { color: var(--muted); font-size: 14px; margin: 0 0 22px; line-height: 1.55; }
/* Sits under the Google button, above the "or" rule. */
.auth-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 0; }

/* ── Forms (uppercase micro-label convention) ──────────── */
.auth-form label {
  display: block;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
/* auto-fit collapses the pair to one column on narrow screens with no media
   query, so the wide shell stays usable down to phone widths. */
.auth-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.auth-form input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-family: var(--font);
  /* Resets are REQUIRED: .auth-form label above sets uppercase tracking, and an
     input inside a label would inherit it. */
  text-transform: none;
  letter-spacing: normal;
}
/* A 6-digit code, spaced out and centred so it reads as a code rather than as a
   word. Used by verify-email and reset-password. */
.auth-form input.code-input { font-size: 18px; letter-spacing: 6px; text-align: center; }
/* Same resets, same reason. */
.auth-form .field-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.auth-form .btn { width: 100%; margin-top: 4px; }
.auth-form .btn-ghost svg { margin-right: 6px; vertical-align: -3px; }

/* ── Forms (sentence-case label convention: the invite pages) ──
   A password field on an invitation is not a micro-labelled data entry field;
   these two screens read as a short letter, so the labels match. */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
.field input:focus { outline: 2px solid var(--accent-strong); outline-offset: 1px; border-color: transparent; }

/* ── Dividers, Google, footer ──────────────────────────── */
.auth-divider,
.or-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider { margin: 14px 0 12px; text-transform: uppercase; letter-spacing: .08em; }
.or-rule { margin: 18px 0; }
.auth-divider::before, .auth-divider::after,
.or-rule::before, .or-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Google's brand guidelines require their mark on a neutral surface at full
   colour, so this stays white/slate rather than taking the accent. */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 500;
}
.btn-google svg { flex: none; }
/* accept-invite's Google button is not a .btn, so it needs its own box. */
a.btn-google:not(.btn) {
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
a.btn-google:not(.btn):hover { background: var(--bg-2); }

.auth-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }
/* Grey, not accent — the accent is reserved for actions. The link still reads as
   one from its weight against the --muted sentence around it. Matches the
   .auth-foot convention in dashboard.css. */
.auth-foot a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { color: var(--ink); }

/* ── Inline status line (verify-email, reset-password) ──── */
/* Tokens, not the #15803D / #B91C1C these were: --status-* are the AA-checked
   text tones for exactly this — a coloured word on the card ground. The word
   prefix in the JS is what actually carries the meaning; colour is the echo. */
#verifyMsg.ok,  #resetMsg.ok,  #forgotMsg.ok  { color: var(--status-green); }
#verifyMsg.err, #resetMsg.err, #forgotMsg.err { color: var(--status-red); }

/* ── complete-profile ──────────────────────────────────── */
.signed-as {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 18px;
}

/* ── invites: the decision screen ──────────────────────── */
.invite-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.invite-card h2 { font-size: 16px; font-weight: 600; margin: 0 0 6px; line-height: 1.4; }
.invite-card p { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.55; }
.invite-card.warn { border-color: rgba(217,119,6,0.35); background: var(--accent-soft); }
.invite-card.warn h2 { font-size: 14px; }
.secondary { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.65; }
.secondary button.linky { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-deep); text-decoration: underline; cursor: pointer; }
.secondary label { display: block; font-size: 13px; color: var(--ink); margin: 10px 0 6px; }
.secondary input[type=text] { display: block; width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; margin-bottom: 10px; }
.secondary a { color: var(--accent-deep); }

/* The invite pages' own submit. Ink at rest, accent on hover with DARK ink on
   it — the landing page's button rule. White on the accent is 2.4:1 and fails AA
   outright, which is what the retired #E07A24 fill was doing. */
.auth-shell .btn-primary:not(.btn) {
  display: inline-block;
  padding: 10px 18px;
  background: var(--ink-soft);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.auth-shell .btn-primary:not(.btn):hover { background: var(--accent-strong); color: var(--ink-soft); }
/* accept-invite's is full width — it is the only action on the card. */
.auth-shell form#acceptForm .btn-primary { display: block; width: 100%; padding: 12px; font-size: 15px; }

/* ── accept-invite: the dead-link state and the legal line ── */
.dead { color: var(--muted); font-size: 14px; line-height: 1.6; }
.dead-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.7; color: var(--muted); }
.dead-actions a { color: var(--accent-deep); font-weight: 600; }
.invite-legal { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.invite-legal a { color: var(--ink-2); font-weight: 600; }
.pw-mismatch { display: none; color: var(--status-red); font-size: 12.5px; margin-top: 6px; }

/* ── Show / hide password ──────────────────────────────────
   The button is appended by assets/js/auth-forms.js, so with scripting off there
   is no dead control — hence no styling for an empty wrapper either.

   LAST in this file on purpose: the padding-right has to beat both field
   conventions above (.auth-form input and .field input), and all three are
   class+element specificity, so source order is what decides.

   display:block so the wrapper works as a <div> or a <span> — on the pages where
   the <label> wraps its own input it has to be phrasing-content-safe. */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 62px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 4px 6px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  /* Resets: on the .auth-form pages the button is a descendant of a label that
     sets uppercase tracking. */
  text-transform: none;
  letter-spacing: 0.02em;
  /* --ink-2, not the accent: a reading aid beside the field, not an action
     competing with the submit button below it. */
  color: var(--ink-2);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--bg-2); }
