/* AfriMedlink Admin, login gate.
   Split screen after PP.png: a deep-emerald brand panel (dotted Africa,
   headline, desk photo, three product areas) beside a bright, blurred clinic
   atmosphere holding the one glass surface of the page, the sign-in card.
   Tokens are scoped to the gate so the console's own palette is untouched. */

#login-gate {
  --lg-page: #eef5f2;
  --lg-deep: #06362d;
  --lg-deep-2: #0a4d3d;
  --lg-mint: #43dfa1;
  --lg-brand: #087f54;
  --lg-brand-hover: #066c47;
  --lg-brand-ink: #066e49;
  --lg-ink: #13241e;
  --lg-ink-2: #3b4d46;
  --lg-muted: #56665f;
  --lg-line: rgba(16, 58, 46, 0.14);
  --lg-on-dark: #f3faf7;
  --lg-on-dark-2: rgba(236, 248, 243, 0.82);
  --lg-danger: #b42318;

  --lg-r-shell: 22px;
  --lg-r-control: 12px;
  --lg-ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Full-bleed: the split screen is the page, edge to edge. */
  position: fixed; inset: 0; z-index: 500;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--lg-deep);
  color: var(--lg-ink);
}
#login-gate ::selection { background: rgba(67, 223, 161, 0.35); color: var(--lg-ink); }
#login-gate svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.lg-shell {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  isolation: isolate;
}

/* ── Brand panel ───────────────────────────────────────────────────────── */
.lg-brand {
  position: relative;
  display: flex; flex-direction: column;
  padding: clamp(40px, 6vh, 72px) clamp(36px, 5.6vw, 104px) clamp(32px, 5vh, 56px);
  color: var(--lg-on-dark);
  background:
    radial-gradient(90% 60% at 85% 12%, rgba(67, 223, 161, 0.20), transparent 65%),
    radial-gradient(70% 38% at 30% 92%, rgba(24, 120, 92, 0.38), transparent 70%),
    linear-gradient(160deg, var(--lg-deep-2) 0%, var(--lg-deep) 58%, #042a23 100%);
  overflow: hidden;
}
#login-gate .lg-map {
  position: absolute; z-index: 0;
  top: 5%; right: 6%;
  width: clamp(190px, 19vw, 320px);
  /* Texture, not a second headline: low enough that the type always leads. */
  fill: rgba(170, 245, 212, 0.24);
  stroke: none;
  pointer-events: none;
}

/* The desk photo owns the lower half of the panel: it rises out of the
   green behind the lede and sinks back into it under the features. */
.lg-photo {
  position: absolute; z-index: 0; left: 0; right: 0; bottom: 0; top: 40%;
  background: url("images/login-left-bg.webp") 30% 62% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 18%, #000 36%);
          mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 18%, #000 36%);
}
.lg-photo::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 42, 35, 0.35) 0%, transparent 45%),
    linear-gradient(180deg, rgba(6, 54, 45, 0.25) 0%, rgba(6, 54, 45, 0.05) 45%, rgba(4, 38, 31, 0.78) 82%, rgba(4, 34, 28, 0.94) 100%);
}

.lg-brand-top { position: relative; z-index: 1; max-width: 30rem; }

.lg-logo { display: flex; align-items: center; gap: 12px; }
.lg-logo-tile {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: var(--lg-r-control);
  background: #fff;
  box-shadow: 0 6px 16px -8px rgba(4, 42, 35, 0.45);
}
.lg-logo-tile img { width: 38px; height: 38px; object-fit: contain; }
.lg-wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.025em; white-space: nowrap; }
.lg-wordmark em { font-style: normal; color: var(--lg-mint); }

.lg-headline {
  margin-top: clamp(40px, 8vh, 96px);
  font-size: clamp(2.05rem, 1.05rem + 2vw, 3.15rem);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--lg-on-dark);
}
.lg-headline span { color: var(--lg-mint); }
.lg-headline::after {
  content: ""; display: block;
  width: 64px; height: 3px; border-radius: 2px;
  margin-top: clamp(22px, 3vh, 30px);
  background: var(--lg-mint);
}
.lg-lede {
  margin-top: clamp(18px, 2.4vh, 24px);
  max-width: 24rem;
  font-size: clamp(0.98rem, 0.9rem + 0.25vw, 1.08rem);
  line-height: 1.6;
  color: var(--lg-on-dark-2);
}

/* The three product areas rest on the darkened foot of the photo, divided
   from it by one hairline, so they read as part of the panel, not stickers. */
.lg-features {
  position: relative; z-index: 1;
  list-style: none;
  margin-top: auto;
  padding-top: clamp(20px, 3vh, 28px);
  border-top: 1px solid rgba(190, 240, 218, 0.14);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.lg-features::before {
  content: ""; position: absolute; z-index: -1;
  left: calc(-1 * clamp(36px, 5.6vw, 104px)); right: calc(-1 * clamp(36px, 5.6vw, 104px));
  top: -60px; bottom: calc(-1 * clamp(32px, 5vh, 56px));
  background: linear-gradient(180deg, transparent, rgba(3, 30, 25, 0.55) 45%, rgba(3, 28, 23, 0.8));
  pointer-events: none;
}
.lg-features li {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  font-size: 0.92rem; font-weight: 600; letter-spacing: 0.005em;
  color: rgba(236, 248, 243, 0.9);
}
.lg-features svg {
  width: 34px; height: 34px; stroke-width: 1.4;
  color: #a6eccd;
  transition: transform 0.35s var(--lg-ease), color 0.35s var(--lg-ease);
}
.lg-features li:hover svg { transform: translateY(-3px); color: var(--lg-mint); }

/* ── Access panel ──────────────────────────────────────────────────────── */
.lg-access {
  position: relative;
  display: grid; place-items: center;
  padding: clamp(40px, 7vh, 88px) clamp(24px, 6vw, 112px);
  /* Blurred clinic light, built in CSS: cool window light top-left,
     pale lime bloom right, deeper teal pooling bottom-right. */
  background: #dfeee9;
  overflow: hidden;
}
.lg-access::before {
  content: ""; position: absolute; inset: -12%; z-index: 0;
  background:
    radial-gradient(38% 46% at 8% 10%, #cfe9ea 0%, transparent 70%),
    radial-gradient(22% 60% at 22% 55%, rgba(255, 255, 255, 0.75) 0%, transparent 70%),
    radial-gradient(34% 40% at 92% 22%, #e9f3c9 0%, transparent 72%),
    radial-gradient(30% 34% at 60% 88%, #bfe6cf 0%, transparent 70%),
    radial-gradient(40% 44% at 100% 100%, #5f93a6 0%, transparent 70%),
    radial-gradient(26% 30% at 4% 96%, #9cc9bf 0%, transparent 70%),
    linear-gradient(135deg, #d5ebe8 0%, #e6f1ea 50%, #cfe3df 100%);
  filter: blur(28px) saturate(115%);
}
.lg-access::after {
  /* Two soft vertical light shafts (the out-of-focus windows of the
     reference), a faint cool light falling on the form, and a quiet edge
     vignette that gives the panel depth without any visible shape. */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(46% 40% at 50% 44%, rgba(255, 255, 255, 0.34), transparent 72%),
    radial-gradient(120% 90% at 50% 50%, transparent 58%, rgba(12, 66, 54, 0.10) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 30%, transparent 75%, rgba(20, 84, 70, 0.07)),
    linear-gradient(90deg, transparent 6%, rgba(255, 255, 255, 0.26) 10%, transparent 16%),
    linear-gradient(90deg, transparent 80%, rgba(255, 255, 255, 0.2) 86%, transparent 92%);
  filter: blur(18px);
  pointer-events: none;
}
.lg-access-foot {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: clamp(20px, 3.5vh, 32px);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.82rem; color: var(--lg-ink-2);
}
.lg-access-foot svg { width: 15px; height: 15px; }

/* The form sits in the panel itself, no card. The only glass is a faint
   veil of light behind it: no fill edge, no border, no shadow, so the clinic
   background stays visible and the form reads as part of the page. */
.lg-card {
  position: relative; z-index: 1;
  width: min(88%, 560px);
  /* Optical centre sits a little above the geometric one. */
  margin-bottom: clamp(16px, 4vh, 48px);
}
.lg-card::before {
  content: ""; position: absolute; z-index: -1;
  inset: -12% -16%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.22) 60%, transparent);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
          mask-image: radial-gradient(closest-side, #000 55%, transparent);
  pointer-events: none;
}
@media (prefers-reduced-transparency: reduce) {
  .lg-card::before { background: radial-gradient(closest-side, rgba(247, 251, 249, 0.9), transparent); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Quieter than the brand panel's logo: the form is the subject here. */
.lg-logo--card { justify-content: center; gap: 10px; }
.lg-logo--card .lg-logo-tile { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 4px 12px -8px rgba(10, 64, 52, 0.5); }
.lg-logo--card .lg-logo-tile img { width: 30px; height: 30px; }
.lg-logo--card .lg-wordmark { font-size: 1.12rem; color: var(--lg-ink); }
.lg-logo--card .lg-wordmark em { color: #0f9a62; }

.lg-title {
  margin-top: clamp(22px, 3vh, 30px);
  text-align: center;
  font-size: clamp(1.55rem, 1.2rem + 0.8vw, 2rem);
  font-weight: 700; letter-spacing: -0.022em; line-height: 1.2;
  color: var(--lg-ink);
}
.lg-sub { margin-top: 10px; text-align: center; font-size: 1.02rem; color: var(--lg-ink-2); }

.lg-form { margin-top: clamp(28px, 4vh, 40px); display: grid; gap: 20px; }
.lg-field { display: grid; gap: 8px; }
.lg-field label { font-size: 0.95rem; font-weight: 600; color: var(--lg-ink); }

.lg-input { position: relative; display: flex; align-items: center; }
.lg-input > svg {
  position: absolute; left: 18px; width: 21px; height: 21px;
  color: var(--lg-ink-2); pointer-events: none;
  transition: color 0.2s var(--lg-ease);
}
.lg-input input {
  width: 100%; height: 56px;
  padding: 0 52px 0 54px;
  border-radius: var(--lg-r-control);
  border: 1px solid var(--lg-line);
  background: rgba(255, 255, 255, 0.64);
  font: inherit; font-size: 0.98rem; color: var(--lg-ink);
  caret-color: var(--lg-brand);
  transition: border-color 0.2s var(--lg-ease), box-shadow 0.2s var(--lg-ease), background-color 0.2s var(--lg-ease);
}
.lg-input input::placeholder { color: var(--lg-muted); opacity: 1; }
.lg-input input:hover { border-color: rgba(16, 58, 46, 0.26); }
.lg-input input:focus {
  outline: none;
  border-color: var(--lg-brand);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(8, 127, 84, 0.14);
}
.lg-input:focus-within > svg { color: var(--lg-brand); }
.lg-input input[aria-invalid="true"] { border-color: var(--lg-danger); }

.lg-reveal {
  position: absolute; right: 8px;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: var(--lg-ink-2);
  transition: background-color 0.2s var(--lg-ease), color 0.2s var(--lg-ease);
}
.lg-reveal svg { width: 21px; height: 21px; }
.lg-reveal:hover { background: rgba(8, 127, 84, 0.08); color: var(--lg-brand); }
.lg-reveal .ic-hide { display: none; }
.lg-reveal[aria-pressed="true"] .ic-show { display: none; }
.lg-reveal[aria-pressed="true"] .ic-hide { display: block; }

.lg-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -2px; }
.lg-check { display: inline-flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--lg-ink); cursor: pointer; }
.lg-check input {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 20px; height: 20px; margin: 0; border-radius: 6px;
  border: 1.5px solid rgba(19, 36, 30, 0.45);
  background: rgba(255, 255, 255, 0.7) center / 14px no-repeat;
  cursor: pointer;
  transition: background-color 0.15s var(--lg-ease), border-color 0.15s var(--lg-ease);
}
.lg-check input:checked {
  border-color: var(--lg-brand);
  background-color: var(--lg-brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E");
}
.lg-link {
  border: 0; background: none; padding: 2px 0;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--lg-brand-ink);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--lg-ease);
}
.lg-link:hover { text-decoration-color: currentColor; }
.lg-help {
  margin-top: -6px; padding: 12px 14px;
  border-radius: var(--lg-r-control);
  background: rgba(8, 127, 84, 0.08);
  font-size: 0.88rem; line-height: 1.5; color: var(--lg-ink-2);
}

.lg-submit {
  margin-top: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 58px;
  border: 0; border-radius: var(--lg-r-control);
  background: var(--lg-brand);
  color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.005em;
  box-shadow: 0 12px 24px -14px rgba(8, 127, 84, 0.8);
  transition: background-color 0.2s var(--lg-ease), transform 0.2s var(--lg-ease), box-shadow 0.2s var(--lg-ease);
}
.lg-submit svg { width: 22px; height: 22px; stroke-width: 2; transition: transform 0.25s var(--lg-ease); }
.lg-submit:hover { background: var(--lg-brand-hover); transform: translateY(-1px); box-shadow: 0 16px 28px -14px rgba(8, 127, 84, 0.85); }
.lg-submit:hover svg { transform: translateX(3px); }
.lg-submit:active { transform: translateY(0) scale(0.99); }
.lg-submit:disabled { cursor: progress; background: var(--lg-brand); opacity: 0.72; transform: none; }
.lg-submit.is-loading svg { animation: lg-nudge 0.9s var(--lg-ease) infinite; }
@keyframes lg-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

.lg-error { min-height: 1.3em; font-size: 0.9rem; font-weight: 500; color: var(--lg-danger); text-align: center; }
.lg-error:empty { min-height: 0; margin-top: -18px; }

/* Keyboard focus, themed from the palette rather than browser defaults. */
.lg-reveal:focus-visible, .lg-link:focus-visible, .lg-submit:focus-visible, .lg-check input:focus-visible {
  outline: 2px solid var(--lg-brand); outline-offset: 3px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
/* Large desktops: the type and controls step up one size so the page keeps
   its proportions instead of shrinking into the middle of a wide screen. */
@media (min-width: 1800px) and (min-height: 900px) {
  #login-gate .lg-map { width: clamp(320px, 17vw, 420px); }
  .lg-logo-tile { width: 54px; height: 54px; }
  .lg-logo-tile img { width: 43px; height: 43px; }
  .lg-wordmark { font-size: 1.55rem; }
  .lg-brand-top { max-width: 38rem; }
  .lg-headline { font-size: clamp(3.15rem, 1.4rem + 1.6vw, 4rem); }
  .lg-lede { font-size: 1.2rem; max-width: 28rem; }
  .lg-features li { font-size: 1.02rem; }
  .lg-features svg { width: 40px; height: 40px; }

  .lg-card { width: min(88%, 620px); }
  .lg-logo--card .lg-logo-tile { width: 44px; height: 44px; }
  .lg-logo--card .lg-logo-tile img { width: 35px; height: 35px; }
  .lg-logo--card .lg-wordmark { font-size: 1.28rem; }
  .lg-title { font-size: 2.3rem; }
  .lg-sub { font-size: 1.14rem; }
  .lg-form { gap: 24px; }
  .lg-field label, .lg-check, .lg-link { font-size: 1.04rem; }
  .lg-input input { height: 62px; font-size: 1.06rem; }
  .lg-submit { height: 64px; font-size: 1.14rem; }
  .lg-access-foot { font-size: 0.9rem; }
}

@media (max-width: 1100px) {
  .lg-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lg-features li { font-size: 0.88rem; }
  .lg-features svg { width: 34px; height: 34px; }
}

/* Single column: the form comes first to the eye, the brand shrinks to a band. */
@media (max-width: 860px) {
  .lg-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .lg-brand { padding: 28px 24px 30px; }
  .lg-map { width: 140px; top: 10px; right: -10px; opacity: 0.7; }
  .lg-photo, .lg-features, .lg-lede { display: none; }
  .lg-headline { margin-top: 22px; font-size: clamp(1.55rem, 1.1rem + 2.2vw, 2rem); }
  .lg-headline br { display: none; }
  .lg-headline::after { width: 48px; margin-top: 16px; }
  .lg-access { padding: 28px 16px 40px; place-items: start center; }
  .lg-logo--card { display: none; }
  .lg-title { margin-top: 0; }
  .lg-card { margin-bottom: 56px; }
  .lg-access-foot { bottom: 18px; }
}
@media (max-width: 420px) {
  .lg-wordmark { font-size: 1.15rem; }
  .lg-logo-tile { width: 42px; height: 42px; }
  .lg-logo-tile img { width: 33px; height: 33px; }
  .lg-card { width: 100%; }
  .lg-options { font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  #login-gate *, #login-gate *::before, #login-gate *::after { transition-duration: 0.01ms; animation: none; }
}
