/* ---- The shared sign-in (portal A.1, David 12 Nov 2026) ----
 * crm.geniusy.ai's one sign-in, for admins and clients, in the client portal's look (Login.dc.html;
 * docs/design/portal-visual-spec.md). Loaded after style.css and admin-mobile.css; every rule is scoped to
 * #auth-screen.signin, so nothing else in the admin changes. Being later and more specific wins over their
 * plain rules, but NOT over their !important ones: admin-mobile.css's phone rule `.pw-toggle { right: 0
 * !important }` (written for the old sign-in) is met by the one !important position rule below.
 * The colours, sizes and radii are the portal's
 * tokens (public/client/index.html :root), copied here as .signin's own custom properties.
 * Checked by src/sharedSignIn.test.ts.
 * Portal A.2 (David, 12 Nov 2026): the big mark, an outline icon in each field, the link
 * underlined white (not cyan), "Need help? Contact support". Cyan is the one "Sign in" button only.
 */

/* The portal's own self-hosted fonts (SIL Open Font License; served from /client/fonts/) */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/client/fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/client/fonts/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/client/fonts/dm-sans-latin-600-normal.woff2") format("woff2"); }

#auth-screen.signin {
  /* tokens (the portal's values) */
  --si-bg: #0B1626;
  --si-surface: #12223A;
  --si-text: #F4F7FB;
  --si-text-2: #B7C4D6;
  --si-muted: #93A4BA;
  --si-primary: #22D3EE;
  --si-on-primary: #0B1626;
  --si-focus: #67E8F9;
  --si-raised: #1A2E4A;
  --si-font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --si-font-head: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --si-fs-name: 34px;
  --si-fs-body: 16px;
  --si-fs-tag: 15px;
  --si-fs-secondary: 14px;
  --si-fs-label: 13px;
  --si-fs-input: 16px;
  --si-r-field: 12px;
  --si-r-btn: 12px;
  --si-r-sm: 8px;
  --si-h-touch: 44px;
  --si-h-field: 54px;
  --si-h-btn: 52px;

  /* the page: one flat colour, no gradient, no glow (overrides style.css's radial background) */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--si-bg);
  color: var(--si-text);
  font-family: var(--si-font-body);
  font-size: var(--si-fs-body);
  line-height: 1.5;
}
#auth-screen.signin.hidden { display: none !important; }

.signin .si-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 32px; overflow-wrap: anywhere; }
.signin .si-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.signin .si-mark { display: block; width: 96px; height: 96px; margin-bottom: 12px; }
.signin .si-name { margin: 0; font-family: var(--si-font-head); font-weight: 600; font-size: var(--si-fs-name); letter-spacing: -0.5px; line-height: 1.2; color: var(--si-text); }
.signin .si-tag { margin: 0; color: var(--si-text-2); font-size: var(--si-fs-tag); }
/* portal A.2: an outline icon at the start of each field (decorative; the label names the field) */
.signin .si-iconfield { position: relative; }
.signin .si-iconfield .si-field { padding-left: 48px; }
.signin .si-lead { position: absolute; top: 16px; left: 14px; color: var(--si-muted); pointer-events: none; }

.signin .si-form { display: flex; flex-direction: column; gap: 8px; }
.signin .si-label { color: var(--si-text-2); font-size: var(--si-fs-label); font-weight: 600; }
.signin .si-field {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--si-h-field);
  margin: 0 0 8px;
  padding: 0 16px;
  border: 1px solid var(--si-muted);   /* the field's edge: at least 3:1 against the field and the page */
  border-radius: var(--si-r-field);
  background: var(--si-surface);
  color: var(--si-text);
  font-family: inherit;
  font-size: var(--si-fs-input);   /* 16 px: no iPhone zoom */
}
.signin .si-field:focus { border-color: var(--si-focus); }
.signin .si-pw { position: relative; }
.signin .si-field-pw { padding-right: 56px; }
.signin .pw-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--si-h-touch);
  height: var(--si-h-touch);
  padding: 0;
  border: 0;
  border-radius: var(--si-r-sm);
  background: none;
  color: var(--si-text-2);
  cursor: pointer;
}
/* Phones (768 px and narrower): admin-mobile.css sets `.pw-toggle { right: 0 !important; }`, which would push
   the eye onto the field's edge. This sign-in keeps its 5 px inset: an id-scoped selector, !important for this
   one property only (admin-mobile.css is not edited; its 44 px minimum size still applies and matches). */
#auth-screen.signin .pw-toggle { right: 5px !important; }
/* the outline eye: one inline SVG set, stroke 1.8, round caps and joins; the crossed eye while the password shows */
.signin .si-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.signin .si-eye-off { display: none; }
.signin .pw-toggle[aria-pressed="true"] .si-eye { display: none; }
.signin .pw-toggle[aria-pressed="true"] .si-eye-off { display: block; }

.signin .si-error { padding: 8px 12px; border-radius: var(--si-r-sm); background: var(--si-raised); color: var(--si-text); font-size: var(--si-fs-secondary); }
/* the ONE primary action: cyan, dark text */
.signin .si-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--si-h-btn);
  margin-top: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--si-r-btn);
  background: var(--si-primary);
  color: var(--si-on-primary);
  font-family: inherit;
  font-size: var(--si-fs-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform 100ms ease, filter 100ms ease;
}
.signin .si-btn:active { transform: scale(0.98); filter: brightness(0.9); }
.signin .si-btn:disabled { opacity: 0.6; cursor: progress; }
.signin .si-help { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin: 0; color: var(--si-text-2); font-size: var(--si-fs-secondary); text-align: center; }
.signin .si-help-ic { color: var(--si-muted); }
.signin .si-link { display: inline-flex; align-items: center; justify-content: center; min-height: var(--si-h-touch); min-width: var(--si-h-touch); padding: 0 4px; color: var(--si-text); font-weight: 600; text-decoration: underline; }   /* A.2: underlined white, not cyan */

.signin :focus-visible { outline: 3px solid var(--si-focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .signin *, .signin *::before, .signin *::after { animation: none !important; transition: none !important; }
  .signin .si-btn:active { transform: none; }
}
