/* HMA Globe — sign-in page
   Matches the hmatax.co.uk rebuild: navy/green brand tokens, Roboto headings + Inter body,
   cut-corner buttons (K3 Advisory Group style), navy "ledger" grid panel.
   Self-contained: no Bootstrap or theme CSS needed on this page. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(globe-fonts/inter.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(globe-fonts/roboto.woff2) format("woff2"); }

:root {
  --navy: #2e394a;
  --navy-deep: #1f2733;
  --green: #65b04d;
  --green-ink: #3a7f28;
  --on-green: #14200f;

  --bg: #ffffff;
  --bg-alt: #f3f5f7;
  --surface: #ffffff;
  --fg: #18202b;
  --fg-muted: #4a5566;
  --line: #dde2e8;
  --link: var(--navy);
  --focus: #1a6dd8;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --info-soft: #eef2f6;

  --font-display: "Roboto", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121820; --bg-alt: #19212c; --surface: #1c2531;
    --fg: #e8edf3; --fg-muted: #a7b2bf; --line: #2c3746;
    --link: #c9d4e0; --focus: #7db4ff;
    --danger: #ffb4ab; --danger-soft: #3a1f1f; --info-soft: #1f2936;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }

/* ---------- layout ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

/* brand panel (left) */
.auth-brand {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--navy-deep); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; gap: 3rem;
  padding: clamp(2rem, 1rem + 3vw, 3.5rem);
}
.auth-brand::before { /* ledger grid, as on the hmatax.co.uk hero */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: linear-gradient(115deg, transparent 20%, #000 80%);
          mask-image: linear-gradient(115deg, transparent 20%, #000 80%);
}
.auth-brand::after { /* soft navy glow, bottom right */
  content: ""; position: absolute; z-index: -1; right: -20%; bottom: -30%; width: 80%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(101,176,77,.10), transparent); pointer-events: none;
}
.auth-logo img { display: block; width: 132px; height: auto; }
.auth-pitch { display: grid; gap: 1.1rem; max-width: 32rem; }
.eyebrow { font: 600 .78rem/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: #9aa8b8; }
.auth-pitch h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); letter-spacing: -.025em; }
.auth-pitch h1 span { color: var(--green); }
.auth-pitch p { color: #c5cfda; font-size: 1.0625rem; max-width: 30rem; }
.auth-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; font-size: .82rem; color: #9aa8b8; }
.auth-foot .tag { font: 500 .72rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .04em;
  padding: .35rem .55rem; border: 1px solid rgba(255,255,255,.16); border-radius: 4px; color: #c5cfda; }

/* form panel (right) */
.auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(2rem, 1rem + 4vw, 4rem) 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 25rem; display: grid; gap: 1.5rem; }
.auth-head { display: grid; gap: .5rem; }
.auth-head h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); }
.auth-head p { color: var(--fg-muted); }

/* status messages (the existing helper paragraphs) */
.note { padding: .85rem 1rem; border-radius: 8px; font-size: .92rem; line-height: 1.5;
  background: var(--info-soft); border-left: 3px solid var(--navy); color: var(--fg); }
.note--error { background: var(--danger-soft); border-left-color: var(--danger); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note { border-left-color: #c9d4e0; } :root:not([data-theme="light"]) .note--error { border-left-color: var(--danger); } }
.auth-card > .note, .auth-card > #div-loginLoading, .auth-card > #div-loginDuoManualRedirect { margin: 0; }

/* fields */
.fields { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field label { font-weight: 600; font-size: .92rem; }
.link-btn { font: 500 .85rem var(--font-body); color: var(--link); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.link-btn:hover { text-decoration-thickness: 2px; }
.input {
  width: 100%; min-height: 48px; padding: .7rem .85rem; font: 400 1rem var(--font-body); color: var(--fg);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--fg-muted); opacity: .7; }
.input:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--fg-muted)); }
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px rgba(101,176,77,.18); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 3rem; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--fg-muted); cursor: pointer; }
.pw-toggle:hover { color: var(--fg); background: var(--bg-alt); }
.pw-toggle svg { width: 20px; height: 20px; }
.check { display: flex; align-items: center; gap: .6rem; font-size: .92rem; color: var(--fg-muted); cursor: pointer; width: fit-content; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); cursor: pointer; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .check input { accent-color: var(--green); } }

/* buttons — cut-corner, as on hmatax.co.uk */
.btn { --cut: 12px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.6rem .7rem 1.35rem;
  border-radius: 0; border: 0; font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: none; }
.btn-primary { background: var(--green); color: var(--on-green); }
.btn-primary:hover { background: #75bf5c; box-shadow: 0 6px 18px rgba(101,176,77,.35); }
.w-100 { width: 100%; }
.btn svg { width: 18px; height: 18px; transition: transform .15s; }
.btn:hover svg { transform: translateX(2px); }

/* loading + Duo states */
.loading { display: flex; align-items: center; gap: .75rem; padding: 1rem 0; color: var(--fg-muted); font-size: .95rem; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.duo { display: grid; gap: 1rem; font-size: .95rem; color: var(--fg-muted); }

.auth-help { font-size: .85rem; color: var(--fg-muted); border-top: 1px solid var(--line); padding-top: 1.25rem; }

/* SweetAlert2 pop-ups, brought into line */
.swal2-popup { font-family: var(--font-body) !important; border-radius: 12px !important; }
.swal2-title { font-family: var(--font-display) !important; color: var(--fg) !important; }
.swal2-styled.swal2-confirm { background: var(--green) !important; color: var(--on-green) !important; border-radius: 0 !important; font-weight: 600 !important;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); box-shadow: none !important; }

/* ---------- small screens: brand panel becomes a header strip ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { gap: 1.25rem; padding: 1.25rem 16px 1.75rem; padding-top: max(1.25rem, env(safe-area-inset-top)); }
  .auth-pitch h1 { font-size: 1.6rem; }
  .auth-pitch p, .auth-foot { display: none; }
  .auth-main { align-items: flex-start; padding-top: 2rem; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: 2s !important; } .btn:hover { transform: none; } }
