/*
 * GITC admin portal: sign-in, password reset and two-factor pages.
 *
 * Ported from the approved v4 "option A" mockup (GITC/mockup/v4-admin-login/:
 * corporate.css, the shared form rules, the .a rules and the fixes appended at
 * its end). A split screen: the brand panel on the left (Paul's banner, a navy
 * scrim, the logo and the product copy) and a plain white panel on the right
 * holding the form. Plain CSS on purpose: no new Tailwind utilities, because
 * the compiled Tailwind bundle can lag behind in development. Everything is
 * scoped under .ga, so it cannot leak into the app.
 *
 * Loaded by app/views/shared/auth/_styles.html.erb.
 */

.ga {
  --navy-950: #0A1630; --navy-800: #14284B; --navy-700: #1D3B69; --navy-600: #295288;
  --navy-200: #C9D7EA; --navy-100: #E2EAF5; --navy-50: #F1F5FB;
  --orange: #FF530D; --cyan: #46A7C9; --cyan-300: #7CCBE4;
  --ink: #0F1B2E; --ink-2: #344256; --ink-3: #5E6C82; --ink-4: #97A2B4;
  --line: #E1E6EE;

  position: relative;
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(460px, 1fr);
  color: var(--ink-2);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: #fff;
}
.ga *, .ga *::before, .ga *::after { box-sizing: border-box; }
.ga h1, .ga h2, .ga p { margin: 0; }
.ga a { color: inherit; text-decoration: none; }
.ga .hidden { display: none !important; }
.ga .ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ga .ic.sm { width: 15px; height: 15px; }

/* ---------- the brand panel (left): the same on every page ---------- */
.ga .brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px; color: #fff;
  /* the fallback when the banner image fails to load (the shell's <img onerror> adds .noimg to <html>) */
  background: linear-gradient(140deg, var(--navy-700), var(--navy-950));
}
.ga .brand picture, .ga .brand picture img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ga .brand picture { z-index: 0; }
.ga .brand picture img { max-width: none; object-fit: cover; object-position: 88% 50%; }
html.noimg .ga .brand picture { display: none; }
/* the navy scrim sits above the picture (it comes after it, both at z-index 0); the content is above both */
.ga .brand::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(0deg, rgba(10, 22, 48, .97) 0%, rgba(10, 22, 48, .88) 30%, rgba(10, 22, 48, .4) 52%, rgba(10, 22, 48, 0) 70%),
              linear-gradient(180deg, rgba(10, 22, 48, .55) 0%, transparent 22%);
}
.ga .brand > .logo-link, .ga .brand > .copy { position: relative; z-index: 1; }
.ga .brand > .logo-link { align-self: flex-start; display: block; }
/* the PNG has transparent padding: 44px of box shows about 26px of mark */
.ga .logo { display: block; height: 44px; width: auto; max-width: none; filter: brightness(0) invert(1); }
.ga .brand .tag {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cyan-300);
}
.ga .brand h2 { margin-top: 12px; max-width: 520px; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.ga .brand p { margin-top: 12px; max-width: 520px; font-size: 15px; line-height: 1.6; color: var(--navy-200); }
.ga .marks {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px; padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .16); font-size: 13px; color: var(--navy-100);
}
.ga .marks span { display: inline-flex; align-items: center; gap: 8px; }
.ga .marks .ic { color: var(--cyan-300); }

/* ---------- the white panel (right) ---------- */
.ga .panel { display: flex; flex-direction: column; padding: 36px 56px 28px; background: #fff; }
.ga .panel .top { display: flex; justify-content: flex-end; }
.ga .panel .link-portal { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.ga .panel .link-portal:hover { color: var(--ink); }
.ga .panel .center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.ga .legal { width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-4); }
.ga .legal .help { color: var(--ink-3); }

/* ---------- the form column: eyebrow, title, sub, step bar, then the form ---------- */
.ga .form-wrap { width: 100%; max-width: 400px; }
.ga .head { margin-bottom: 26px; }
.ga .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--navy-600);
}
.ga .eyebrow .bar { width: 18px; height: 2px; background: var(--orange); border-radius: 2px; }
.ga .form-wrap h1 { margin-top: 14px; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.ga .form-wrap .sub { margin-top: 8px; font-size: 14px; color: var(--ink-3); }

/* step bar: password, then the emailed code (rendered by the shell when it gets step:); done is cyan, current is navy */
.ga .steps { display: flex; gap: 6px; margin: 0 0 22px; }
.ga .steps .seg { flex: 1; }
.ga .steps .seg i { display: block; height: 3px; border-radius: 3px; background: var(--line); }
.ga .steps .seg.on i { background: var(--navy-700); }
.ga .steps .seg.done i { background: var(--cyan); }
.ga .steps .seg span { display: block; margin-top: 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-4); }
.ga .steps .seg.on span { color: var(--ink); }
.ga .steps .seg.done span { color: var(--ink-3); }

/* ---------- notes (flash, errors) ---------- */
.ga .note {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 10px; margin-bottom: 18px;
  font-size: 13px; line-height: 1.5; background: var(--navy-50); border: 1px solid var(--navy-100); color: var(--navy-800);
}
.ga .note .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--navy-600); }
.ga .note.sent { background: #EEF8F3; border-color: #BFE5D2; color: #0C6B43; }
.ga .note.sent .ic { color: #12905A; }
.ga .note.bad { background: #FDEEEE; border-color: #F2C4C4; color: #A12B2B; }
.ga .note.bad .ic { color: #D63C3C; }
.ga .note.warn { background: #FFF6E6; border-color: #F1D9A6; color: #7A4E00; }
.ga .note.warn .ic { color: #A86A00; }
.ga .note ul { margin: 4px 0 0; padding-left: 16px; }
.ga .note b { font-weight: 700; }

/* ---------- form fields ---------- */
.ga form { margin: 0; }
.ga .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ga .lb-row { display: flex; justify-content: space-between; align-items: baseline; }
.ga .lb { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ga .link { font: 600 13px/1.4 Inter, system-ui, sans-serif; color: var(--navy-600); }
.ga .link:hover { text-decoration: underline; }
.ga .inp-wrap { position: relative; }
.ga .inp-wrap > .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.ga .inp {
  width: 100%; height: 46px; margin: 0; padding: 0 14px 0 40px; border-radius: 10px; border: 1px solid #CFD8E4; background: #fff;
  color: var(--ink); font: 500 14.5px Inter, system-ui, sans-serif; outline: none; -webkit-appearance: none; appearance: none;
}
.ga .inp:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(41, 82, 136, .16); }
.ga .inp::placeholder { color: var(--ink-4); font-weight: 400; }
.ga .inp-wrap.has-eye .inp { padding-right: 46px; }
.ga .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-4); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.ga .eye:hover { color: var(--navy-600); }
.ga .eye .off { display: none; }
.ga .eye.on .off { display: block; }
.ga .eye.on .on-i { display: none; }

/* the navy primary button (a <button> or an <input type="submit">) */
.ga .btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; margin: 6px 0 0; padding: 0;
  border: 0; border-radius: 10px; font: 600 15px/1 Inter, system-ui, sans-serif; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: var(--navy-800); color: #fff; box-shadow: 0 1px 2px rgba(10, 22, 48, .2);
}
.ga .btn:hover { background: var(--navy-700); }
.ga .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(41, 82, 136, .3), 0 1px 2px rgba(10, 22, 48, .2); }
.ga .hint { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--ink-3); }
.ga .hint .ic { color: var(--navy-600); }

/* two-factor: one code box, then the secondary actions */
.ga .inp.code-inp {
  height: 56px; padding: 0 14px 0 calc(14px + .6em); text-align: center;
  font: 700 24px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .6em;
}
.ga .inp.code-inp::placeholder { letter-spacing: .6em; color: #C6CFDC; font-weight: 700; }
.ga .alt { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 16px; font-size: 13px; }
.ga .alt form { margin: 0; }
.ga .alt button.link { background: none; border: 0; padding: 0; cursor: pointer; }
.ga .alt .muted { color: var(--ink-3); font-weight: 500; }

/* password strength (the new-password form); the script sets the fill's width and colour and the hint's text and colour */
.ga .ga-strength { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: -8px 0 8px; }
.ga .ga-strength > div { height: 100%; width: 0; border-radius: inherit; transition: width .2s, background .2s; }
.ga .ga-pwhint { margin-bottom: 16px; font-size: 12.5px; color: var(--ink-3); }

/* Turnstile gate (only rendered when a site key is configured): the widget is 300px wide, so it fits the 400px column */
.ga #turnstile-gate {
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 16px; padding: 14px;
  border-radius: 10px; background: var(--navy-50); border: 1px solid var(--line);
}
.ga #turnstile-gate p { font-size: 12.5px; color: var(--ink-3); text-align: center; }
.ga #reset-form-container.hidden { display: none !important; }

/* ---------- phones: the brand panel becomes a band with only the logo; the form sits right under it ---------- */
@media (max-width: 860px) {
  .ga { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ga .brand { height: 170px; padding: 16px 20px; justify-content: flex-start; }
  .ga .brand::after { background: linear-gradient(180deg, rgba(10, 22, 48, .6) 0%, transparent 45%); }
  .ga .brand .copy, .ga .marks { display: none; }
  .ga .logo { height: 40px; }
  .ga .panel { padding: 0 20px 22px; }
  .ga .panel .top { display: none; }
  .ga .panel .center { flex: none; align-items: flex-start; padding: 26px 0 24px; }
  .ga .form-wrap h1 { font-size: 24px; }
}
@media (max-width: 420px) {
  .ga #turnstile-gate { padding: 12px 4px; }
}
