/* ============================================================================
   NorthGrid - css/ng-auth.css
   AUDIT 2026-10-05 BW: NEW. One stylesheet for every sign-in page:
   login.php, forgot_password.php, set_password.php, 2fa_challenge.php.
   Built to the 2026 NorthGrid Brand Guidelines (ARM Creative) with the same
   tokens, fonts and contrast rules as css/ng-brand.css (marketing site):
     Chalk page, white card, Pine card header, Pine primary button, Amber
     passkey button, Onyx ink. Headlines Rockwell Nova via local() only (no web
     license - see ng-brand.css), body Host Grotesk from /fonts/.
   Tabler is still loaded on these pages for form controls; everything here is
   scoped to body.ng-auth so nothing else in the app is affected.
   Contrast (WCAG AA): Chalk on Pine 9.8, Onyx on Amber 9.5, Onyx on white 16.3,
   #5C5856 on white 6.9, danger ink #B32430 on #FCECEC 5.6.
   ========================================================================== */

@font-face {
  font-family: 'Host Grotesk';
  src: url('/fonts/HostGrotesk-Variable-latin.woff2') format('woff2');
  font-weight: 300 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'NG Display';
  src: local('Rockwell Nova'), local('RockwellNova'), local('Rockwell Nova Regular'),
       local('RockwellNova-Regular'), local('Rockwell'), local('Rockwell-Regular');
  font-weight: 400; font-style: normal; font-display: swap;
}

body.ng-auth {
  --pine: #273B1A; --sage: #859E85; --amber: #FFB83B; --copper: #AB4F1C;
  --chalk: #EAE6DD; --chalk-50: #F5F3EE; --onyx: #221F20;
  --ink-2: #5C5856; --line: #D6D1C5; --line-ui: #7A756E; --on-pine-2: #D8D3C8;
  --danger-ink: #B32430;
  --f-display: 'NG Display', 'Rockwell Nova', Rockwell, 'Roboto Slab', Georgia, serif;
  --f-body: 'Host Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --tile: 14px 3px 14px 14px;
  --tile-chalk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M17.0,6.0 H58.0 V47.0 Q58.0,58.0 47.0,58.0 H17.0 Q6.0,58.0 6.0,47.0 V17.0 Q6.0,6.0 17.0,6.0 Z' fill='%23ECE8E0'/%3E%3C/svg%3E");

  margin: 0; min-height: 100vh; display: grid; place-items: center;
  font-family: var(--f-body); font-size: 1rem; line-height: 1.55; color: var(--onyx);
  background: var(--tile-chalk) repeat top left / 72px 72px, var(--chalk);
  -webkit-font-smoothing: antialiased;
}
body.ng-auth *, body.ng-auth *::before, body.ng-auth *::after { box-sizing: border-box; }
body.ng-auth :focus-visible { outline: 2px solid var(--onyx); outline-offset: 2px; }

.ng-auth .login-wrap { width: 100%; max-width: 440px; padding: 24px 16px; }

/* Logo */
.ng-auth .ng-brand { text-align: center; margin-bottom: 26px; }
.ng-auth .ng-brand img { height: 44px; width: auto; display: inline-block; }

/* Card */
.ng-auth .ng-card {
  background: #fff; border-radius: var(--tile); overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(34,31,32,0.06), 0 24px 48px -28px rgba(34,31,32,0.45);
}
.ng-auth .ng-card-header { background: var(--pine); padding: 26px 32px 22px; border-bottom: 3px solid var(--amber); }
.ng-auth .ng-card-header h1 {
  margin: 0; color: var(--chalk); font-family: var(--f-display); font-weight: 400;
  font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1.15;
}
.ng-auth .ng-card-header p { margin: 6px 0 0; color: var(--on-pine-2); font-size: 0.92rem; }
.ng-auth .ng-card-body { padding: 28px 32px; }
.ng-auth .ng-card-body > p { color: var(--ink-2); font-size: 0.95rem; }

/* Form controls (also restyles Tabler's) */
.ng-auth .form-label {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--onyx); margin-bottom: 6px;
}
.ng-auth .form-control {
  display: block; width: 100%; min-height: 46px; padding: 10px 14px; font-size: 1rem;
  border: 1.5px solid var(--line-ui); border-radius: 10px; color: var(--onyx);
  font-family: var(--f-body); background: #fff;
}
.ng-auth .form-control::placeholder { color: #8A857E; }
/* AUDIT 2026-10-05 BW (rev b2): the legacy css/styles.css these pages still load
   gives input[type=text|password] margin-top:5px and label margin-top:10px, which
   pushed the password box 5px below its eye button. Neutralized here. */
.ng-auth .form-control,
.ng-auth input[type=text], .ng-auth input[type=password], .ng-auth input[type=email] { margin-top: 0; }
.ng-auth label, .ng-auth .form-label { margin-top: 0; }
.ng-auth .mb-3 { margin-bottom: 1rem; }
.ng-auth .mb-4 { margin-bottom: 1.5rem; }
/* AUDIT 2026-10-05 BW: the eye button wrapped under the password box on
   prod. Tabler's .input-group is flex-wrap:wrap and expects the input at
   width:1% / flex 1 1 auto; the .form-control width:100% above overrode
   that. Inside an input group the input is now flexible and never wraps. */
.ng-auth .input-group { display: flex; flex-wrap: nowrap; align-items: stretch; width: 100%; }
.ng-auth .input-group > .form-control { flex: 1 1 auto; width: 1%; min-width: 0; }
.ng-auth .input-group-text { display: flex; align-items: center; padding: 0 12px; flex: 0 0 auto; }
.ng-auth .form-label { display: block; }
.ng-auth .form-control:focus { border-color: var(--onyx); box-shadow: 0 0 0 3px rgba(39,59,26,0.18); }
.ng-auth .input-group-flat .form-control { border-right: none; border-radius: 10px 0 0 10px; }
.ng-auth .input-group-flat .input-group-text {
  background: #fff; border: 1.5px solid var(--line-ui); border-left: none; border-radius: 0 10px 10px 0;
}
.ng-auth .link-secondary { color: var(--ink-2); }
.ng-auth .link-secondary:hover { color: var(--onyx); }
.ng-auth .form-hint, .ng-auth .form-text, .ng-auth .text-secondary, .ng-auth .text-muted { color: var(--ink-2) !important; }
.ng-auth .form-check-input:checked { background-color: var(--pine); border-color: var(--pine); }
.ng-auth a { color: var(--pine); text-underline-offset: 0.18em; }

/* Buttons: Pine fill (primary), Amber fill (passkey), Onyx outline (secondary) */
.ng-auth .btn-ng-primary, .ng-auth .btn-primary {
  display: block; width: 100%; min-height: 48px; padding: 12px; margin-top: 8px;
  background: var(--pine); color: var(--chalk); border: 0; border-radius: 10px;
  font-family: var(--f-body); font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; text-align: center; text-decoration: none;
}
.ng-auth .btn-ng-primary:hover, .ng-auth .btn-primary:hover { background: #1d2c13; color: var(--chalk); }
.ng-auth .btn-outline-secondary {
  display: block; width: 100%; min-height: 48px; padding: 12px; border: 1.5px solid var(--onyx);
  border-radius: 10px; color: var(--onyx); background: transparent; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.9rem; text-align: center; text-decoration: none;
}
.ng-auth .btn-outline-secondary:hover { background: var(--onyx); color: var(--chalk); }
.ng-auth .btn-ng-passkey {
  width: 100%; min-height: 48px; padding: 12px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--amber); color: var(--onyx); border: 0; border-radius: 10px;
  font-family: var(--f-body); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer;
}
.ng-auth .btn-ng-passkey:hover { background: #f5aa22; }
.ng-auth .btn-ng-passkey:disabled { opacity: 0.6; cursor: not-allowed; }
.ng-auth .ng-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--ink-2); font-size: 0.8rem; }
.ng-auth .ng-divider::before, .ng-auth .ng-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* Messages (content is always one block inside, so flex never splits text) */
.ng-auth .ng-alert, .ng-auth .ng-notice, .ng-auth .ng-success {
  display: flex; align-items: flex-start; gap: 10px; border-radius: 10px; padding: 12px 16px;
  margin-bottom: 20px; font-size: 0.92rem; line-height: 1.5;
}
.ng-auth .ng-alert { background: #FCECEC; border: 1px solid #F0C4C7; border-left: 4px solid var(--danger-ink); color: var(--danger-ink); }
.ng-auth .ng-notice { background: var(--chalk-50); border: 1px solid var(--line); border-left: 4px solid var(--pine); color: var(--onyx); }
.ng-auth .ng-success { background: #EEF5EE; border: 1px solid #C9DECB; border-left: 4px solid #2F6B37; color: #1F4A25; }
.ng-auth .ng-alert svg, .ng-auth .ng-notice svg { flex-shrink: 0; margin-top: 2px; }
.ng-auth .alert { border-radius: 10px; }

/* Forgot link, footer, back link */
.ng-auth .ng-forgot { text-align: right; margin: -6px 0 14px; font-size: 0.88rem; }
.ng-auth .ng-forgot span { color: var(--ink-2); }
.ng-auth .ng-card-footer { padding: 14px 32px; background: var(--chalk-50); border-top: 1px solid var(--line); text-align: center; }
.ng-auth .ng-card-footer small, .ng-auth .ng-card-footer { color: var(--ink-2); font-size: 0.8rem; }
.ng-auth .ng-card-footer a { color: var(--ink-2); }
.ng-auth .ng-back { text-align: center; margin-top: 18px; font-size: 0.88rem; }
.ng-auth .ng-back a { color: var(--ink-2); }
.ng-auth .ng-back a:hover { color: var(--onyx); }

/* set_password: who the link is for */
.ng-auth .ng-who { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ng-auth .ng-who .avatar { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px 2px 10px 10px; background: var(--pine); color: var(--chalk); font-weight: 600; }
.ng-auth .strength-track { background: var(--line); border-radius: 2px; height: 4px; margin-top: 6px; }
.ng-auth .strength-bar { height: 4px; border-radius: 2px; transition: width .25s ease, background .25s ease; }
.ng-auth .ng-code { letter-spacing: 0.3em; font-size: 1.5rem; text-align: center; }

@media (max-width: 480px) {
  .ng-auth .ng-card-header, .ng-auth .ng-card-body { padding-left: 22px; padding-right: 22px; }
}
@media (prefers-reduced-motion: reduce) { .ng-auth * { transition: none !important; } }

/* AUDIT 2026-10-05 BW (rev b2): Chrome paints saved (autofilled) usernames and
   passwords light blue, but not the eye button beside them; keep fields white. */
.ng-auth input.form-control:-webkit-autofill,
.ng-auth input.form-control:-webkit-autofill:hover,
.ng-auth input.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--onyx);
}
