/* TAC CREDIT — sign-in page. The logo's navy and crimson, as on the landing page; a calm split
   layout. The same panel also holds the "Request access" form (styles in lead_form.css). */

:root {
  --navy: #243864;            /* logo navy */
  --navy-deep: #172a52;
  --navy-ink: #1a2a55;
  --accent: #8c2438;           /* logo crimson, 8.3:1 on paper */
  --accent-soft: #e7a1ae;      /* crimson for text on the deep navy (6.8:1) */
  --paper: #fbfaf6;
  --ink: #1d2530;
  --ink-2: #4a5462;
  --rule: #d9d3c2;
  --field: #b9b09a;
  --danger: #a3261b;           /* 6.4:1 on white */
  --danger-bg: #fbeeec;
  --ok: #1f6a3f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body.auth { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.auth-shell { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; min-height: 100vh; }

/* Brand panel */
.auth-brand {
  background: var(--navy-deep); color: #dfe6ef; padding: 40px 48px;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
/* The logo has a transparent background and navy letters, so it sits on a white plate here */
.auth-logo {
  align-self: flex-start; display: inline-flex; line-height: 0; background: #fff;
  padding: 10px 14px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.auth-logo img { display: block; height: 32px; width: auto; }
.auth-trust {
  margin: 22px 0 0; display: inline-flex; align-items: center; gap: 8px;
  font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #dfe6ef;
}
.auth-trust::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-soft); }
.auth-brand-body { margin-top: auto; margin-bottom: 40px; max-width: 30ch; }
.auth-eyebrow {
  margin: 0 0 16px; font: 600 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-soft);
  display: flex; align-items: center; gap: 12px;
}
.auth-eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.auth-statement { margin: 0; font: 600 clamp(26px, 2.6vw, 34px)/1.18 var(--serif); color: #fff; }
.auth-motif { width: 100%; max-width: 420px; height: auto; margin-bottom: 32px; }
.am-rows line { stroke: rgba(255,255,255,.14); stroke-width: 1; }
.am-bars rect { fill: rgba(255,255,255,.28); }
.am-trend { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s .3s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.auth-foot { margin: 0; font-size: 12px; color: #9fb0c4; }

/* Form panel */
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.auth-back {
  position: absolute; top: 28px; left: 32px; font-size: 13px; color: var(--ink-2); text-decoration: none;
  display: inline-flex; gap: 6px; align-items: center;
}
.auth-back span { transition: transform .2s var(--ease); }
.auth-back:hover { color: var(--navy); }
.auth-back:hover span { transform: translateX(-3px); }

.auth-card { width: 100%; max-width: 380px; }
.js .auth-card { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.auth-card h1 { margin: 0; font: 600 30px/1.15 var(--serif); color: var(--navy-ink); }
.auth-sub { margin: 8px 0 28px; color: var(--ink-2); }

/* Error banner */
.auth-error {
  margin: 0 0 20px; padding: 12px 14px; border-radius: 4px; background: var(--danger-bg);
  border-left: 3px solid var(--danger); color: var(--danger); font-size: 14px;
}
.auth-error.shake { animation: shake .36s var(--ease); }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* Fields with labels that float above once the box has focus or a value */
.field { position: relative; margin-bottom: 18px; }
.field input {
  width: 100%; height: 52px; padding: 20px 14px 6px; font: 15px var(--sans); color: var(--ink);
  background: #fff; border: 1px solid var(--field); border-radius: 4px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field-password input { padding-right: 48px; }
.field label {
  position: absolute; left: 14px; top: 16px; font-size: 15px; color: var(--ink-2); pointer-events: none;
  transform-origin: left top; transition: transform .16s var(--ease), color .16s;
}
.field input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(36,56,100,.14); }
.field input:focus + label,
.field input:not(:placeholder-shown) + label { transform: translateY(-9px) scale(.78); }
.field input:focus + label { color: var(--navy); }
.field.has-error input { border-color: var(--danger); }
.field.has-error input:focus { box-shadow: 0 0 0 3px rgba(163,38,27,.14); }
.field-msg { margin: 6px 2px 0; min-height: 0; font-size: 13px; color: var(--danger); }
.field-msg:empty { display: none; }
.field-caps { margin: 6px 2px 0; font-size: 13px; color: #7a5d0c; display: flex; align-items: center; gap: 6px; }
.field-caps[hidden] { display: none; }  /* display: flex would otherwise override hidden */
.field-caps::before { content: "\21EA"; font-size: 14px; }

/* Show / hide password */
.pw-toggle {
  position: absolute; right: 6px; top: 8px; width: 36px; height: 36px; border: 0; border-radius: 4px;
  background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.pw-toggle:hover { background: rgba(36,56,100,.07); color: var(--navy); }
.pw-eye { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.pw-slash { stroke-dasharray: 20; stroke-dashoffset: 0; transition: stroke-dashoffset .2s var(--ease); }
.pw-toggle[aria-pressed="true"] .pw-slash { stroke-dashoffset: 20; }

/* Primary button: label, spinner while signing in, a tick on success */
.btn-primary {
  width: 100%; height: 50px; margin-top: 6px; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--navy); color: #fff; font: 600 15px var(--sans); position: relative;
  transition: background .15s, transform .08s, box-shadow .15s;
  box-shadow: 0 1px 0 rgba(23,42,82,.25);
}
.btn-primary:hover { background: var(--navy-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { cursor: progress; }
.btn-spinner, .btn-check { position: absolute; left: 50%; top: 50%; opacity: 0; transition: opacity .15s; }
.btn-spinner {
  width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-check { width: 22px; height: 22px; margin: -11px 0 0 -11px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 20; stroke-dashoffset: 20; }
.btn-label { transition: opacity .15s; }
.btn-primary.is-busy .btn-label { opacity: 0; }
.btn-primary.is-busy .btn-spinner { opacity: 1; }
.btn-primary.is-done { background: var(--ok); }
.btn-primary.is-done .btn-label, .btn-primary.is-done .btn-spinner { opacity: 0; }
.btn-primary.is-done .btn-check { opacity: 1; animation: tick .35s var(--ease) forwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tick { to { stroke-dashoffset: 0; } }

/* Divider */
.auth-or { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* Google (not available yet) */
.sso-wrap { display: block; position: relative; }
.btn-sso {
  width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 1px solid var(--rule); border-radius: 4px; background: #fff; color: var(--ink-2);
  font: 600 14px var(--sans); cursor: not-allowed; opacity: .72;
}
.sso-g { width: 18px; height: 18px; filter: grayscale(.35); }
.sso-soon {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 600 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 7px; border-radius: 3px; background: #f3efe1; color: #6b520c;
}

.auth-help { margin: 28px 0 0; font-size: 13px; color: var(--ink-2); }
.auth-request-cta { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }
.auth-request-cta a, .auth-switch { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-request-cta a:hover, .auth-switch:hover { text-decoration: underline; }

/* Request access: a wider card in place of the sign-in card (with JS: one at a time) */
.auth-request { max-width: 560px; margin-top: 40px; }
.auth-request h2 { margin: 0; font: 600 28px/1.15 var(--serif); color: var(--navy-ink); }
.js .auth-request { display: none; margin-top: 0; }
.js .auth-panel.show-request .auth-request { display: block; }
.js .auth-panel.show-request .auth-signin { display: none; }

/* Small screens: the brand panel becomes a header */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }  /* header keeps its own height */
  .auth-brand { padding: 22px 20px; flex-direction: row; align-items: center; gap: 16px; }
  .auth-brand-body, .auth-motif, .auth-foot { display: none; }
  .auth-logo { padding: 8px 10px; }
  .auth-logo img { height: 26px; }
  .auth-panel { padding: 56px 16px 40px; justify-content: flex-start; }
  .auth-back { top: 18px; left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .am-trend { stroke-dashoffset: 0; }
  .btn-primary.is-done .btn-check { stroke-dashoffset: 0; }
}
