/*
 * The sign-in page (js/screens/login.js): an animated brand panel beside the sign-in card. Motion is CSS only, with
 * no glows or shadows, and stops for reduced motion. The brand panel is the same deep teal in both themes; the card
 * side follows the light / dark theme.
 */
.lg-page {
  --lg-ink: #062a2a;
  --lg-teal: #0f766e;
  --lg-mint: #5eead4;
  --lg-lime: #a3e635;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
  min-height: 100vh;
  background: var(--color-page);
  color: var(--color-text);
}

/* ─── Brand panel ─── */
.lg-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: 44px 52px;
  background: linear-gradient(150deg, #0b3b3a 0%, var(--lg-ink) 55%, #041716 100%);
  color: #e6fffb;
  isolation: isolate;
}
.lg-scene { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lg-grid {
  position: absolute;
  inset: -40px;
  background-image: radial-gradient(rgb(94 234 212 / 22%) 1.2px, transparent 1.4px);
  background-size: 28px 28px;
  animation: lg-drift 40s linear infinite;
  mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
}
.lg-rings { position: absolute; top: -18%; right: -22%; width: 78%; max-width: 760px; aspect-ratio: 1; }
.lg-ring { stroke: rgb(94 234 212 / 35%); stroke-width: 1.4; transform-box: view-box; transform-origin: 300px 300px; animation: lg-spin 60s linear infinite; }
.lg-ring.is-mid { stroke: rgb(163 230 53 / 30%); animation-duration: 42s; }
.lg-ring.is-fast { stroke: rgb(94 234 212 / 45%); animation-duration: 26s; }
.lg-ring.is-back { animation-direction: reverse; }
/* Growth bars in the bottom-right corner, clear of the feature chips: they rise one by one, then breathe; the curve
   over their tops draws itself and its end point pulses. */
.lg-chart { position: absolute; right: 0; bottom: 0; width: 50%; max-width: 640px; height: 46%; overflow: visible; }
.lg-base { stroke: rgb(94 234 212 / 25%); stroke-width: 1.5; stroke-dasharray: 4 6; }
.lg-bar { fill: url(#lg-bar-fill); stroke: rgb(94 234 212 / 45%); stroke-width: 1.2; transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); animation: lg-bar-up 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) forwards, lg-breathe 3.2s ease-in-out infinite alternate; }
.lg-line {
  fill: none;
  stroke: var(--lg-lime);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: lg-draw 1.8s cubic-bezier(0.6, 0, 0.2, 1) 1.1s forwards;
}
.lg-point { fill: var(--lg-lime); stroke: var(--lg-ink); stroke-width: 3; transform-box: fill-box; transform-origin: center; transform: scale(0); animation: lg-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 2.8s forwards; }
.lg-end-ring { fill: none; stroke: var(--lg-lime); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: lg-ping 2.2s ease-out 3.2s infinite; }.lg-shape { position: absolute; display: block; border: 1.5px solid rgb(94 234 212 / 45%); animation: lg-bob 9s ease-in-out infinite; }
.lg-shape-1 { top: 22%; left: 8%; width: 18px; height: 18px; border-radius: 5px; transform: rotate(18deg); }
.lg-shape-2 { top: 58%; left: 46%; width: 12px; height: 12px; border-radius: 50%; border-color: rgb(163 230 53 / 60%); animation-delay: -3s; }
.lg-shape-3 { top: 12%; left: 54%; width: 26px; height: 26px; border-radius: 50%; animation-delay: -6s; animation-duration: 12s; }
.lg-brand-content { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 40px; max-width: 560px; }
.lg-logo { display: flex; align-items: center; gap: 12px; animation: lg-rise 0.7s ease both; }
.lg-logo b { display: block; color: #ffffff; font-size: 18px; letter-spacing: 0.02em; }
.lg-logo small { display: block; color: rgb(230 255 251 / 70%); font-size: 12px; }
.lg-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(140deg, #0f766e 0%, #14b8a6 55%, #84cc16 100%); color: #ffffff; font-size: 20px; }
.lg-mark-sm { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
.lg-kicker { margin: 0 0 12px; color: var(--lg-mint); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; animation: lg-rise 0.7s ease 0.1s both; }
.lg-headline { margin: 0; color: #ffffff; font-size: clamp(30px, 3.6vw, 48px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; animation: lg-rise 0.7s ease 0.2s both; }
/* The headline's words take turns: each in, held, then out (4 × 3 s). */
.lg-words { position: relative; display: block; height: 1.2em; overflow: hidden; }
.lg-word {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ffffff 0%, var(--lg-mint) 60%, var(--lg-lime) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(100%);
  animation: lg-word 12s cubic-bezier(0.6, 0, 0.2, 1) infinite;
  animation-delay: calc(var(--i) * 3s);
}
.lg-lede { max-width: 420px; margin: 16px 0 0; color: rgb(230 255 251 / 78%); font-size: 15px; line-height: 1.6; animation: lg-rise 0.7s ease 0.3s both; }
.lg-features { display: flex; flex-wrap: wrap; gap: 10px; max-width: 48%; margin: 0; padding: 0; list-style: none; }
.lg-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgb(94 234 212 / 25%);
  border-radius: 999px;
  background: rgb(6 42 42 / 55%);
  backdrop-filter: blur(6px);
  color: #e6fffb;
  font-size: 13px;
  font-weight: 600;
  animation: lg-rise 0.6s ease both, lg-float 6s ease-in-out infinite;
  animation-delay: calc(0.45s + var(--i) * 0.12s), calc(var(--i) * -1.5s);
}
.lg-chip-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgb(94 234 212 / 16%); color: var(--lg-mint); font-size: 13px; }

/* ─── Sign-in side ─── */
.lg-side { position: relative; display: grid; place-items: center; padding: 40px 28px; }
.lg-card { width: min(100%, 400px); }
.lg-card > * { animation: lg-rise 0.6s ease both; }
.lg-card > :nth-child(2) { animation-delay: 0.08s; }
.lg-card > :nth-child(3) { animation-delay: 0.14s; }
.lg-card > :nth-child(4) { animation-delay: 0.2s; }
.lg-card > :nth-child(5) { animation-delay: 0.26s; }
.lg-card > :nth-child(6) { animation-delay: 0.34s; }
.lg-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.lg-card-top .lg-mark { visibility: hidden; }
.lg-theme {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 64px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-subtle);
  font-size: 13px;
  cursor: pointer;
}
.lg-theme::before { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--lg-teal); transition: transform 0.25s cubic-bezier(0.4, 1.4, 0.5, 1); }
html[data-theme="dark"] .lg-theme::before { transform: translateX(32px); }
.lg-theme i { position: relative; z-index: 1; }
html:not([data-theme="dark"]) .lg-theme .fa-sun, html[data-theme="dark"] .lg-theme .fa-moon { color: #ffffff; }
/* The heading block: the company and "Staff portal" beside the Helix mark, then "Sign in" with the rest lighter. */
.lg-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--color-border); }
.lg-identity-mark { position: relative; display: inline-grid; flex: none; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: linear-gradient(140deg, #0f766e 0%, #14b8a6 55%, #84cc16 100%); color: #ffffff; }
/* A thin ring that breathes out from the mark. */
.lg-identity-mark::after { content: ""; position: absolute; inset: -5px; border: 1.5px solid rgb(20 184 166 / 45%); border-radius: 19px; animation: lg-halo 2.8s ease-out infinite; }
.lg-identity-text { display: flex; flex-direction: column; gap: 3px; }
.lg-identity-text b { color: var(--color-text-strong); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.lg-identity-text small { display: inline-flex; align-items: center; gap: 6px; color: var(--color-brand-strong); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
html[data-theme="dark"] .lg-identity-text small { color: var(--lg-mint); }
.lg-title { margin: 0; color: var(--color-text-strong); font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
.lg-title-soft { color: var(--color-text-subtle); font-weight: 500; letter-spacing: -0.02em; }.lg-sub { margin: 10px 0 28px; line-height: 1.5; color: var(--color-text-subtle); font-size: 14px; }
.lg-form { display: flex; flex-direction: column; gap: 14px; }

/* A box with its icon; the label sits inside and floats up once the box has focus or text. */
.lg-field { position: relative; }
.lg-input {
  width: 100%;
  height: 56px;
  padding: 20px 46px 6px 46px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 14px;
  background: var(--color-surface);
  color: var(--color-text-strong);
  font-size: 15px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.lg-input:hover { border-color: var(--color-text-muted); }
.lg-input:focus { outline: none; border-color: var(--color-brand); background: var(--color-surface); }
.lg-label {
  position: absolute;
  top: 18px;
  left: 46px;
  color: var(--color-text-muted);
  font-size: 15px;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.2s ease, color 0.2s ease;
}
.lg-input:focus + .lg-label,
.lg-input:not(:placeholder-shown) + .lg-label { color: var(--color-brand-strong); transform: translateY(-11px) scale(0.76); }
html[data-theme="dark"] .lg-input:focus + .lg-label,
html[data-theme="dark"] .lg-input:not(:placeholder-shown) + .lg-label { color: var(--lg-mint); }
.lg-field-icon { position: absolute; top: 0; bottom: 0; left: 16px; display: grid; place-items: center; color: var(--color-text-muted); font-size: 15px; transition: color 0.2s ease; }
.lg-field:focus-within .lg-field-icon { color: var(--color-brand); }
.lg-eye { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--color-text-muted); cursor: pointer; transform: translateY(-50%); }
.lg-eye:hover { background: var(--color-surface-sunken); color: var(--color-text-strong); }
.lg-caps { display: flex; align-items: center; gap: 6px; margin: -4px 0 0 4px; color: var(--color-warning); font-size: 12px; font-weight: 600; }
.lg-message:empty { display: none; }
.lg-message span { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid rgb(225 29 72 / 30%); border-radius: 12px; background: var(--color-danger-soft); color: #b91c1c; font-size: 13px; font-weight: 600; }
html[data-theme="dark"] .lg-message span { background: rgb(244 63 94 / 12%); color: #fda4af; }

.lg-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, #0f766e, #14b8a6, #0f766e) 0 0 / 200% 100%;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-position 0.6s ease, transform 0.15s ease;
}
.lg-submit:hover { background-position: 100% 0; }
.lg-submit:active { transform: scale(0.985); }
.lg-submit:disabled { cursor: progress; opacity: 0.85; }
.lg-submit-arrow { display: inline-flex; transition: transform 0.25s ease; }
.lg-submit:hover .lg-submit-arrow { transform: translateX(4px); }
.lg-submit[aria-busy="true"] .lg-submit-arrow { display: none; }
.lg-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 28px 0 0; color: var(--color-text-muted); font-size: 12px; }

/* A wrong password shakes the card; a right one lifts it away. */
.lg-card.is-shaking { animation: lg-shake 0.45s ease; }
.lg-card.is-done { animation: lg-away 0.35s ease forwards; }

/* ─── Narrow screens: the brand panel becomes a band above the card ─── */
@media (max-width: 900px) {
  .lg-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .lg-brand { min-height: 220px; padding: 24px 20px; }
  .lg-brand-content { gap: 18px; }
  .lg-lede, .lg-features { display: none; }
  .lg-headline { font-size: 28px; }
  /* The chart would run through the headline in the short band. */
  .lg-chart { display: none; }
  .lg-side { place-items: start center; padding: 28px 16px 40px; }
  .lg-card-top { margin-bottom: 20px; }
  .lg-title { font-size: 26px; }
}

@keyframes lg-spin { to { transform: rotate(360deg); } }
@keyframes lg-drift { to { background-position: 280px 280px; } }
@keyframes lg-draw { to { stroke-dashoffset: 0; } }
@keyframes lg-fade { to { opacity: 1; } }
@keyframes lg-pop { to { transform: scale(1); } }
@keyframes lg-halo { 0% { opacity: 0.9; transform: scale(0.92); } 100% { opacity: 0; transform: scale(1.18); } }
@keyframes lg-bar-up { to { transform: scaleY(1); } }
@keyframes lg-breathe { from { scale: 1 1; } to { scale: 1 0.9; } }
@keyframes lg-ping { 0% { opacity: 0.9; transform: scale(0.6); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes lg-bob { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -14px; rotate: 25deg; } }
@keyframes lg-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes lg-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes lg-word {
  0% { opacity: 0; transform: translateY(100%); }
  4%, 22% { opacity: 1; transform: translateY(0); }
  26%, 100% { opacity: 0; transform: translateY(-100%); }
}
@keyframes lg-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
@keyframes lg-away { to { opacity: 0; transform: translateY(-12px) scale(0.98); } }

/* Reduced motion: everything still; the first headline stays. */
@media (prefers-reduced-motion: reduce) {
  .lg-page *, .lg-page *::before { animation: none !important; transition: none !important; }
  .lg-line { stroke-dashoffset: 0; }
  .lg-bar, .lg-point { transform: none; }
  .lg-word:first-child { opacity: 1; transform: none; }
}
/* The light / dark switch sits in the page's top-right corner, not above the card. */
.lg-card-top { display: none; }
.lg-side > .lg-theme { position: absolute; top: 22px; right: 26px; z-index: 2; }
@media (max-width: 900px) { .lg-side > .lg-theme { top: 14px; right: 16px; } }
/* Boxes the browser fills in (saved username / password): the label floats up as if typed, and the box keeps its
   own colours instead of the browser's autofill tint. */
.lg-input:-webkit-autofill + .lg-label,
.lg-input:autofill + .lg-label { color: var(--color-brand-strong); transform: translateY(-11px) scale(0.76); }
html[data-theme="dark"] .lg-input:-webkit-autofill + .lg-label,
html[data-theme="dark"] .lg-input:autofill + .lg-label { color: var(--lg-mint); }
.lg-input:-webkit-autofill,
.lg-input:-webkit-autofill:hover,
.lg-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text-strong);
  caret-color: var(--color-text-strong);
  box-shadow: 0 0 0 40px var(--color-surface) inset !important;
  transition: background-color 9999s ease 0s;
}
/* ─── Compact sign-in form: shorter boxes and button, smaller type, tighter gaps ─── */
.lg-form { gap: 10px; }
.lg-input { height: 46px; padding: 16px 42px 4px 40px; border-width: 1px; border-radius: 11px; font-size: 14px; }
.lg-label { top: 14px; left: 40px; font-size: 14px; }
.lg-input:focus + .lg-label,
.lg-input:not(:placeholder-shown) + .lg-label,
.lg-input:-webkit-autofill + .lg-label,
.lg-input:autofill + .lg-label { transform: translateY(-9px) scale(0.74); }
.lg-field-icon { left: 14px; font-size: 13px; }
.lg-eye { right: 6px; width: 32px; height: 32px; border-radius: 8px; font-size: 13px; }
.lg-caps { margin: -2px 0 0 2px; font-size: 11.5px; }
.lg-message span { padding: 8px 10px; border-radius: 10px; font-size: 12.5px; }
.lg-submit { height: 44px; margin-top: 4px; border-radius: 11px; font-size: 14px; gap: 8px; }
.lg-submit-arrow { font-size: 13px; }
.lg-foot { margin-top: 20px; font-size: 11.5px; }
.lg-card { width: min(100%, 360px); }
.lg-title { font-size: 28px; }
.lg-identity { margin-bottom: 24px; padding-bottom: 18px; }
.lg-sub { margin: 8px 0 22px; font-size: 13.5px; }
