/* InteliCargo sign-in — "InteliCargo Command" design system.
   Form on the left, live-operations scene on the right (hidden on small screens). */

:root {
  --lg-navy: #0A1647;
  --lg-navy-2: #14215A;
  --lg-ink: #0A1240;
  --lg-text: #2B3252;
  --lg-muted: #5A6282;
  --lg-line: #D5D9E4;
  --lg-line-soft: #E3E6ED;
  --lg-page: #F3F4F7;
  --lg-ground: #E4E8F3;
  --lg-gold: #FFD555;
  --lg-gold-hover: #F5C93A;
  --lg-link: #1D4FB8;
  --lg-blue-soft: #E8EFFC;
  --lg-danger: #A61E2B;
  --lg-danger-line: #C2263A;
  --lg-danger-soft: #FDECEE;
  --lg-ok: #0F6B4A;
  --lg-ok-soft: #E7F5EF;
  --lg-warn: #8F4500;
  --lg-warn-soft: #FFF2DD;
  --lg-radius: 10px;
  --lg-font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --lg-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body.lg-body { margin: 0; padding: 0; }
body.lg-body {
  background: var(--lg-page);
  color: var(--lg-text);
  font-family: var(--lg-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lg-link); outline-offset: 2px; }

.lg { min-height: 100vh; display: flex; flex-wrap: wrap; }

/* ---------- form side ---------- */
.lg-main {
  flex: 1 1 520px;
  min-width: 0;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 28px max(24px, 6vw);
}
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lg-logo { display: block; height: auto; width: auto; max-height: 60px; max-width: 240px; }

.lg-card { width: 100%; max-width: 400px; align-self: center; display: flex; flex-direction: column; gap: 22px; }
.lg-card form { display: flex; flex-direction: column; gap: 18px; margin: 0; }

.lg-dots { display: flex; gap: 6px; }
.lg-dots span { height: 4px; width: 12px; border-radius: 2px; background: var(--lg-line-soft); transition: width .25s ease, background-color .25s ease; }
.lg-dots span.is-on { background: var(--lg-navy); }
.lg-dots span.is-cur { width: 28px; }

.lg-head { display: flex; flex-direction: column; gap: 8px; }
.lg-head h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; color: var(--lg-ink); }
.lg-head h1:focus { outline: none; }
.lg-head p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--lg-muted); }
.lg-head strong { color: var(--lg-ink); font-weight: 600; word-break: break-all; }
.lg-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lg-muted); }

.lg-alert { border-radius: var(--lg-radius); padding: 12px 14px; font-size: 13px; line-height: 1.45; font-weight: 500; }
.lg-alert--error, .lg-alert--danger { background: var(--lg-danger-soft); color: var(--lg-danger); }
.lg-alert--success { background: var(--lg-ok-soft); color: var(--lg-ok); }
.lg-alert--warning { background: var(--lg-warn-soft); color: var(--lg-warn); }
.lg-alert--info, .lg-alert--debug { background: var(--lg-blue-soft); color: var(--lg-link); }

.lg-field { display: flex; flex-direction: column; gap: 6px; }
.lg-field label, .lg-otp legend { font-size: 12.5px; font-weight: 500; color: var(--lg-text); }
.lg-field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lg-field input {
  height: 44px;
  width: 100%;
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius);
  padding: 0 12px;
  font-size: 14px;
  color: var(--lg-ink);
  background: #FFFFFF;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lg-field input:hover { border-color: #B9C0D3; }
.lg-field input:focus { outline: none; border-color: var(--lg-link); box-shadow: 0 0 0 3px rgba(29, 79, 184, 0.15); }
.lg-field input[aria-invalid="true"] { border: 2px solid var(--lg-danger-line); padding: 0 11px; }
.lg-field input[readonly] { background: var(--lg-page); }

.lg-pw { position: relative; display: flex; }
.lg-pw input { padding-right: 72px; }
.lg-field .lg-pw input[aria-invalid="true"] { padding-right: 71px; }
.lg-pw__toggle {
  position: absolute; right: 4px; top: 4px; height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--lg-muted);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.lg-pw__toggle:hover { background: var(--lg-page); color: var(--lg-ink); }

.lg-err { font-size: 12.5px; font-weight: 500; color: var(--lg-danger); }
.lg-ok { font-size: 12.5px; font-weight: 500; color: var(--lg-ok); }

.lg-btn {
  width: 100%; height: 44px; border: 0; border-radius: var(--lg-radius);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color .15s ease, opacity .15s ease;
}
.lg-btn--gold { background: var(--lg-gold); color: var(--lg-ink); }
.lg-btn--gold:hover:not(:disabled) { background: var(--lg-gold-hover); }
.lg-btn--navy { background: var(--lg-navy); color: #FFFFFF; }
.lg-btn--navy:hover:not(:disabled) { background: var(--lg-navy-2); }
.lg-btn:disabled { background: #E7E9F0; color: var(--lg-muted); cursor: not-allowed; }
.lg-btn.is-busy { cursor: progress; }
.lg-btn.is-busy::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: lg-spin .7s linear infinite;
}
@keyframes lg-spin { to { transform: rotate(360deg); } }

.lg-link { border: 0; background: none; padding: 0; color: var(--lg-link); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lg-link:hover:not(:disabled) { color: var(--lg-ink); text-decoration: underline; }
.lg-link:disabled { color: var(--lg-muted); cursor: default; }
.lg-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.lg-row .lg-link { font-size: 13px; }
.lg-muted { color: var(--lg-muted); }
.lg-mono { font-family: var(--lg-mono); }
.lg-ink { color: var(--lg-ink); font-weight: 600; }

/* one-time code boxes */
.lg-otp { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.lg-otp legend { padding: 0; margin-bottom: 10px; }
.lg-otp__boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.lg-otp__boxes input {
  width: 100%; height: 56px; min-width: 0;
  border: 1px solid var(--lg-line); border-radius: var(--lg-radius);
  background: #FFFFFF; text-align: center;
  font-family: var(--lg-mono); font-size: 24px; font-weight: 600; color: var(--lg-ink);
  caret-color: var(--lg-link);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lg-otp__boxes--sm input { height: 48px; font-size: 20px; }
.lg-otp__boxes input:focus { outline: none; border-color: var(--lg-link); box-shadow: 0 0 0 3px rgba(29, 79, 184, 0.15); }
.lg-otp__boxes input.is-filled { border-color: #9AA3BD; }
.lg-otp__boxes[data-state="bad"] input { border: 2px solid var(--lg-danger-line); background: #FFFBFB; }
.lg-otp__boxes[data-state="good"] input { border: 2px solid var(--lg-ok); background: #F6FCF9; }

/* password rules */
.lg-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lg-rules li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--lg-muted); }
.lg-rules__mark { width: 16px; height: 16px; border-radius: 50%; background: #EEF0F5; position: relative; flex: none; }
.lg-rules__mark::after { content: ''; position: absolute; left: 6.5px; top: 6.5px; width: 3px; height: 3px; border-radius: 50%; background: var(--lg-muted); }
.lg-rules li.is-met { color: var(--lg-ok); }
.lg-rules li.is-met .lg-rules__mark { background: var(--lg-ok-soft); }
.lg-rules li.is-met .lg-rules__mark::after {
  left: 5px; top: 3px; width: 4px; height: 8px; border-radius: 0; background: none;
  border: solid var(--lg-ok); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.lg-done { display: flex; flex-direction: column; gap: 16px; }
.lg-done__icon { width: 48px; height: 48px; border-radius: 50%; background: var(--lg-ok-soft); color: var(--lg-ok); display: flex; align-items: center; justify-content: center; }
.lg-done__icon svg { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.lg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--lg-muted); }
.lg-powered { display: inline-flex; align-items: center; gap: 8px; }
.lg-powered img { height: 22px; width: auto; display: block; }

/* ---------- live operations scene ---------- */
.lg-scene {
  flex: 1 1 560px;
  min-width: 0;
  min-height: 640px;
  position: relative;
  overflow: hidden;
  background: var(--lg-ground);
  color: var(--lg-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 24px max(20px, 2.4vw) 22px;
}
.lg-scene.is-pointing { cursor: pointer; }
.lg-scene__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.lg-scene__scrim {
  position: absolute; left: 0; right: 0; top: 0; height: 190px; pointer-events: none;
  background: linear-gradient(180deg, rgba(243, 244, 247, 0.92) 0%, rgba(243, 244, 247, 0.55) 55%, rgba(243, 244, 247, 0) 100%);
}
.lg-scene__top { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.lg-scene__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lg-live {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px;
  border-radius: 999px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(10, 18, 64, 0.12);
  font-size: 12.5px; font-weight: 600; color: var(--lg-ink);
}
.lg-live__dot { width: 8px; height: 8px; border-radius: 50%; background: #0F7A55; box-shadow: 0 0 0 3px var(--lg-ok-soft); }
.lg-hint { padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); font-size: 12px; color: var(--lg-muted); }

.lg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lg-kpi { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(10, 18, 64, 0.10); min-width: 0; }
.lg-kpi__icon { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--lg-blue-soft); color: var(--lg-link); display: flex; align-items: center; justify-content: center; }
.lg-kpi__icon svg, .lg-track__title svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-kpi__text { display: flex; flex-direction: column; min-width: 0; }
.lg-kpi__label, .lg-kpi__sub { font-size: 11.5px; color: var(--lg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-kpi__sub { font-size: 11px; }
.lg-kpi__line { display: flex; align-items: baseline; gap: 6px; }
.lg-kpi__value { font-size: 20px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; color: var(--lg-ink); white-space: nowrap; }
.lg-chip { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: #EEF0F5; color: #4A5272; white-space: nowrap; }
.lg-chip.is-good { background: var(--lg-ok-soft); color: var(--lg-ok); }

.lg-track {
  position: relative; z-index: 1; pointer-events: none;
  display: flex; flex-direction: column; gap: 12px; padding: 14px 16px;
  border-radius: 14px; background: #FFFFFF; box-shadow: 0 6px 18px rgba(10, 18, 64, 0.12);
}
.lg-track__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lg-track__title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--lg-ink); }
.lg-track__title svg { color: var(--lg-link); }
.lg-track__meta { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--lg-muted); }
.lg-pill { margin-left: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--lg-blue-soft); color: var(--lg-link); }
.lg-pill.is-good { background: var(--lg-ok-soft); color: var(--lg-ok); }
.lg-pill.is-warn { background: var(--lg-warn-soft); color: var(--lg-warn); }

.lg-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lg-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; min-width: 0; }
.lg-steps li + li::before { content: ''; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: var(--lg-line-soft); }
.lg-steps li.is-done::before, .lg-steps li.is-now::before { background: var(--lg-link); }
.lg-steps__dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; border: 2px solid var(--lg-line); }
.lg-steps li.is-done .lg-steps__dot { background: var(--lg-link); border-color: var(--lg-link); }
.lg-steps li.is-done .lg-steps__dot::after {
  content: ''; position: absolute; left: 5.5px; top: 2.5px; width: 4px; height: 8px;
  border: solid #FFFFFF; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg);
}
.lg-steps li.is-now .lg-steps__dot { background: var(--lg-navy); border-color: var(--lg-navy); box-shadow: 0 0 0 4px var(--lg-blue-soft); }
.lg-steps li.is-now .lg-steps__dot::after { content: ''; position: absolute; left: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--lg-gold); }
.lg-steps__label { font-size: 12px; line-height: 1.25; font-weight: 500; color: var(--lg-muted); }
.lg-steps li.is-done .lg-steps__label, .lg-steps li.is-now .lg-steps__label { color: var(--lg-ink); }
.lg-steps li.is-now .lg-steps__label { font-weight: 600; }
.lg-steps__time { font-size: 11px; color: var(--lg-muted); font-family: var(--lg-mono); }

/* small screens: just the form */
@media (max-width: 900px) {
  .lg-scene { display: none; }
  .lg-main { padding: 20px 16px 24px; gap: 28px; }
  .lg-logo { max-height: 48px; }
  .lg-head h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-dots span, .lg-btn, .lg-field input, .lg-otp__boxes input { transition: none; }
  .lg-btn.is-busy::before { animation-duration: 2s; }
}
