/* Mezura Funding Portal - split-screen sign-in styles.
 *
 * Mirrors the Client Commercial Platform (CNI) login layout so the two
 * platforms read as one family: a Navy 950 brand panel on the left with an
 * abstract energy-grid line pattern, wordmark and positioning copy; a white
 * form panel on the right with the sign-in form vertically centred.
 *
 * This page renders OUTSIDE the app shell and loads brand.css for the shared
 * design tokens; only login-specific scaffolding lives here. Accents use the
 * mandated Mezura green (--green family) so the panel stays on-brand rather
 * than importing a bespoke palette. On mobile the navy panel collapses to a
 * wordmark top bar and the form takes the full width below it. */

:root {
  /* Deep Navy 950 for the brand panel (dark decorative surface only). */
  --login-navy-950: #0a1628;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

.hidden { display: none !important; }

.auth-split {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 57fr 43fr;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--panel);
}

/* ───────── Left: Navy 950 brand panel ───────── */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 56px;
  background: var(--login-navy-950);
  color: #fff;
  isolation: isolate;
}

/* Soft green energy glow behind the grid. */
.auth-brand::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -18%;
  right: -14%;
  width: 62%;
  height: 62%;
  background: radial-gradient(closest-side, rgba(30, 230, 0, 0.22), transparent 72%);
  pointer-events: none;
}

.auth-brand__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}

.auth-brand__mark { position: relative; }
.auth-brand__logo { display: block; height: 30px; width: auto; }

.auth-brand__copy { position: relative; max-width: 32ch; }

.auth-brand__eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
}

.auth-brand__headline {
  font-family: 'Space Grotesk', var(--font-head);
  font-weight: 600;
  font-size: clamp(28px, 3.1vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.6px;
  color: #fff;
  margin: 0;
}

.auth-brand__foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
}

.auth-brand__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(30, 230, 0, 0.55);
  animation: auth-pulse 2.4s ease-out infinite;
}

@keyframes auth-pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 230, 0, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(30, 230, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 230, 0, 0); }
}

/* Travelling dash on the energy-grid lines. */
.auth-brand__art .flow {
  stroke-dasharray: 5 190;
  animation: auth-flow 6s linear infinite;
}
.auth-brand__art .flow--2 { animation-delay: -2s; }
.auth-brand__art .flow--3 { animation-delay: -4s; }
@keyframes auth-flow {
  to { stroke-dashoffset: -195; }
}

/* ───────── Right: white form panel ───────── */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--panel);
}
.auth-form-inner { width: 100%; max-width: 384px; }

.auth-form-head { margin-bottom: 26px; }
.auth-form-head h1 {
  font-family: 'Space Grotesk', var(--font-head);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.2px;
  color: var(--slate);
  margin: 0 0 6px;
}
.auth-form-head p {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field > span {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.auth-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input::placeholder { color: var(--text-faint); }
.auth-input:focus {
  outline: none;
  border-color: var(--green-border);
  box-shadow: 0 0 0 4px var(--green-dim);
}

/* Password field with a show/hide toggle (carried over from the Funding login). */
.auth-field-password { position: relative; display: block; }
.auth-field-password .auth-input { padding-right: 46px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}
.password-toggle:hover { color: var(--green-ink); background: var(--green-soft); }
.password-toggle:focus-visible { outline: 2px solid var(--green-border); outline-offset: 1px; }

/* Emerald-style gradient primary action, in the Mezura green family. */
.auth-btn {
  margin-top: 4px;
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #06200a;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-hover) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.06s ease, box-shadow 0.12s ease;
  box-shadow: 0 6px 16px rgba(30, 230, 0, 0.22);
}
.auth-btn:hover { filter: brightness(1.04); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 3px solid var(--green-border); outline-offset: 2px; }

/* Inline error. */
.auth-alert {
  display: flex;
  gap: 9px;
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  background: var(--alert-dim);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--alert);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
}

.auth-secondary {
  margin: 20px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
}

/* ───────── Trust marks ───────── */
.auth-trust {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.auth-trust span {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.auth-trust i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

/* ───────── Responsive: navy panel -> wordmark top bar ───────── */
@media (max-width: 860px) {
  .auth-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .auth-brand {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    min-height: 60px;
    padding: 0 22px;
  }
  .auth-brand__logo { height: 24px; }
  .auth-brand__copy,
  .auth-brand__foot,
  .auth-brand__art { display: none; }
  .auth-brand::after { display: none; }
  .auth-form-panel { padding: 34px 22px 48px; }
  .auth-form-inner { max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand__pulse,
  .auth-brand__art .flow { animation: none; }
}
