/* ============================================================================
   Beta auth / deny / error pages.

   Loaded ONLY by the beta copies of login.html, no-access.html, auth-failed.html
   and employment-lookup-login.html, served by web/beta-server.js. Built entirely
   on the mockup.css token set (--bg-app, --brand, --r-lg, --sp-*, …) so these
   pages render standalone and NEVER link the production styles.css.

   Deliberately additive: this file is new and lives under public/beta/, so it
   cannot affect the production pages (which this file is not loaded by).
   ========================================================================= */

/* ---------- page frame ---------- */
.beta-auth-page {
  min-height: 100vh;            /* fallback first … */
  min-height: 100dvh;           /* … dvh last so it wins where supported (mobile Safari) */
  margin: 0;
  padding: calc(var(--sp-5) + env(safe-area-inset-top, 0px)) var(--sp-4)
    calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  overflow-x: clip;
  background:
    radial-gradient(120% 150% at 0% 0%, var(--brand-soft) 0%, transparent 58%),
    radial-gradient(90% 120% at 100% 100%, var(--accent-2-soft, var(--brand-soft)) 0%, transparent 60%),
    var(--bg-app);
}

.beta-auth-shell {
  width: 100%;
  max-width: 960px;
  display: grid;
  gap: var(--sp-4);
}
@media (min-width: 880px) {
  .beta-auth-shell.split { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: stretch; }
  .beta-auth-shell.narrow { max-width: 520px; }
}

/* ---------- card ---------- */
.beta-auth-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  text-align: center;
}
.beta-auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand) 22%, var(--accent-2) 55%, var(--brand) 78%, transparent);
  opacity: .9;
}
.beta-auth-card.bad::before {
  background: linear-gradient(90deg, transparent, var(--bad) 24%, var(--bad) 76%, transparent);
}
.beta-auth-card.aside {
  text-align: center;
  justify-content: center;
  gap: var(--sp-3);
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
}

/* ---------- brand row ---------- */
/* The row carries the service's REAL lockup, the same treatment the rail applies via
   `.rail-brand-logo` (mockup.css): the artwork already contains the wordmark, so the former 42x42
   gradient "FR"/"MA" text tile + `<b>`/`<small>` brand-text pair duplicated it and was retired.
   The status chip stays and is pushed to the trailing edge. */
.beta-auth-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-align: left;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.beta-auth-badge { margin-left: auto; flex: 0 0 auto; }

/* ---------- logo ---------- */
/* Sized like the rail's lockup (30px, natural width, never cropped to a square). */
.beta-auth-logo {
  display: block;
  height: 30px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Every brand PNG in web/public is left EXACTLY as authored, in both themes. Two treatments are
   forbidden on a logo surface, and this block exists to keep them out:
     - darkening the artwork (`filter: brightness(...)`): the lockups are NOT white-on-transparent —
       they carry their own dark ink — so they read on the light theme's near-white surfaces unaided,
       and dimming them only makes the mark look washed out;
     - mounting the artwork on a near-black backing plate (the rail's own near-black was reused): that
       dark rectangle sitting on the card (and the plate `padding` it needed) is the defect this
       treatment had to lose.
   `invert()` is never used either: the lockups contain brand colour and the two services' logos have
   opposite polarity, so inverting would wash one of them out. */
/* `.beta-auth-apply-logo` is the one logo surface that paints its own disc as a *background* on the
   same element. In the light theme that disc was explicitly the rail's near-black — i.e. a backing
   plate — so it stays dropped and the artwork sits directly on the card. */
html[data-theme="light"] .beta-auth-apply-logo {
  background: none;
}
.beta-auth-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.beta-auth-logo-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.beta-auth-logo-item img { height: 68px; width: auto; max-width: 130px; object-fit: contain; }
.beta-auth-logo-item span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.beta-auth-logo-item.frs span { color: var(--brand); }
.beta-auth-logo-item.mas span { color: var(--accent-2); }
.beta-auth-logo-item.police span { color: var(--info); }

/* logo strip used by auth-failed */
.beta-auth-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.beta-auth-strip img { height: 62px; width: auto; max-width: 150px; object-fit: contain; }
.beta-auth-strip .beta-auth-divider {
  width: 1px;
  height: 46px;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

/* ---------- type ---------- */
.beta-auth-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.beta-auth-title.wide { letter-spacing: .06em; text-transform: uppercase; font-size: 20px; }
.beta-auth-sub { color: var(--text-3); font-size: 13px; }
.beta-auth-lead { color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.beta-auth-lead + .beta-auth-lead { margin-top: calc(var(--sp-3) * -1 + var(--sp-1)); }
.beta-auth-hint {
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.5;
  padding: var(--sp-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--field-bg);
  text-align: left;
}
.beta-auth-hint b, .beta-auth-hint strong { color: var(--text); }

.beta-auth-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.beta-auth-list li {
  position: relative;
  padding-left: 26px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.beta-auth-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.beta-auth-list b, .beta-auth-list strong { color: var(--text); }

/* ---------- actions ---------- */
.beta-auth-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: stretch;
}
.beta-auth-actions.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.beta-auth-actions.row .btn { flex: 1 1 200px; }
.beta-auth-sub-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  font-size: 12.5px;
}
.beta-auth-sub-actions a { color: var(--brand); font-weight: 600; }
.beta-auth-sub-actions a:hover { text-decoration: underline; }

/* ---------- footer / apply panel ---------- */
.beta-auth-apply-logo {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, var(--bg-hover) 0%, var(--bg-surface-2) 100%);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.beta-auth-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  justify-content: center;
  color: var(--text-3);
  font-size: 11.5px;
  text-align: center;
}
.beta-auth-foot .dot { opacity: .5; }

/* ---------- responsive / touch ---------- */
@media (max-width: 560px) {
  .beta-auth-page { justify-content: flex-start; padding-top: calc(var(--sp-5) + env(safe-area-inset-top, 0px)); }
  .beta-auth-card { padding: var(--sp-4); border-radius: var(--r-lg); }
  .beta-auth-title { font-size: 20px; }
  .beta-auth-logo { height: 24px; }
  .beta-auth-logo-item img { height: 54px; }
  .beta-auth-strip img { height: 48px; }
  .beta-auth-strip { gap: var(--sp-4); }
}
/* A glove-friendly minimum: mockup.css sizes .btn at 38px, which is below the 44px target. */
@media (max-width: 768px) {
  .beta-auth-card .btn { min-height: 46px; }
  .beta-auth-sub-actions a { min-height: 44px; display: inline-flex; align-items: center; }
}
