/*
 * Valley Eats Dispatch sign-in (login.php).
 * House style from project-template's Login (dark pane, sharp 4px corners, accent bar,
 * brand green #79a763) with a full-bleed photo panel. No external fonts or assets.
 */

:root {
  --lg-primary: #79a763;
  --lg-primary-hover: #8cb977;
  --lg-primary-dark: #5f7d52;
  --lg-primary-soft: #b9d6aa;
  --lg-dark: #12100e;
  --lg-ink: #0f1a0a;
  --lg-text: rgba(255, 255, 255, 0.9);
  --lg-muted: rgba(255, 255, 255, 0.64);
  --lg-faint: rgba(255, 255, 255, 0.4);
  --lg-input-bg: rgb(25, 23, 21);
  --lg-input-bg-focus: rgb(33, 31, 28);
  --lg-border: rgba(255, 255, 255, 0.14);
  --lg-border-hover: rgba(255, 255, 255, 0.24);
  --lg-ring: rgba(121, 167, 99, 0.55);
  --lg-error: #ff8a80;
  --lg-error-bg: rgba(255, 77, 79, 0.12);
  --lg-info: #a9cbe0;
  --lg-info-bg: rgba(99, 143, 167, 0.16);
  --lg-success-bg: rgba(121, 167, 99, 0.16);
  --lg-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lg-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body.lg {
  margin: 0;
  background: var(--lg-dark);
  color: var(--lg-text);
  font: 15px/1.5 var(--lg-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.lg-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ PHOTO PANEL */

.lg-photo {
  position: relative;
  flex: 0 0 58%;
  max-width: 58%;
  overflow: hidden;
  background: #1c1a17;
  border-right: 1px solid rgba(121, 167, 99, 0.16);
}

.lg-photo__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 58%;
  animation: lg-settle 1400ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes lg-settle {
  from { transform: scale(1.06); opacity: 0.4; }
  to   { transform: scale(1); opacity: 1; }
}

.lg-photo__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 16, 14, 0.6) 0%, rgba(18, 16, 14, 0) 26%),
    linear-gradient(0deg, rgba(18, 16, 14, 0.94) 0%, rgba(18, 16, 14, 0.45) 42%, rgba(18, 16, 14, 0) 68%),
    linear-gradient(90deg, rgba(18, 16, 14, 0) 70%, rgba(18, 16, 14, 0.55) 100%),
    radial-gradient(110% 80% at 8% 100%, rgba(121, 167, 99, 0.32) 0%, rgba(121, 167, 99, 0) 55%);
}

.lg-photo__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 40px 48px 56px;
}

.lg-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.lg-lockup__logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.lg-lockup__name {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lg-lockup__tag {
  padding: 3px 8px;
  border: 1px solid rgba(121, 167, 99, 0.6);
  border-radius: 4px;
  background: rgba(18, 16, 14, 0.35);
  color: var(--lg-primary-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lg-hero {
  margin-top: auto;
  max-width: 600px;
}

.lg-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--lg-primary-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lg-hero__eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--lg-primary);
}

.lg-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(46px, 5.4vw, 80px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.4);
}

.lg-hero__title em {
  font-style: normal;
  color: var(--lg-primary);
}

.lg-hero__sub {
  max-width: 440px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

.lg-credit {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.lg-credit a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 2px;
}

.lg-credit a:hover { color: #fff; }

/* -------------------------------------------------------------------- FORM PANEL */

.lg-panel {
  position: relative;
  flex: 1 1 42%;
  display: flex;
  overflow-y: auto;
  padding: 48px 32px;
  background:
    radial-gradient(80% 50% at 100% 0%, rgba(121, 167, 99, 0.09) 0%, rgba(121, 167, 99, 0) 60%),
    var(--lg-dark);
}

.lg-card {
  width: 100%;
  max-width: 380px;
  margin: auto;
  animation: lg-rise 260ms ease-out both;
}

@keyframes lg-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lg-accent {
  display: block;
  width: 36px;
  height: 3px;
  margin-bottom: 20px;
  background: var(--lg-primary);
}

.lg-title {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lg-sub {
  margin: 8px 0 24px;
  color: var(--lg-muted);
  font-size: 14px;
}

.lg-who {
  color: var(--lg-text);
  font-weight: 600;
  word-break: break-all;
}

/* Banners */
.lg-banner {
  display: flex;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 3px solid currentColor;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.45;
}

.lg-banner::before {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--lg-tone);
  color: var(--lg-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.lg-banner--error   { --lg-tone: var(--lg-error); color: var(--lg-tone); background: var(--lg-error-bg); }
.lg-banner--info    { --lg-tone: var(--lg-info); color: var(--lg-tone); background: var(--lg-info-bg); }
.lg-banner--success { --lg-tone: var(--lg-primary-soft); color: var(--lg-tone); background: var(--lg-success-bg); }
.lg-banner--error::before   { content: "!"; }
.lg-banner--info::before    { content: "i"; }
.lg-banner--success::before { content: "\2713"; }

/* Fields */
.lg-form { display: flex; flex-direction: column; gap: 20px; }
.lg-form--tight { gap: 12px; margin-top: 10px; }
.lg-field { display: flex; flex-direction: column; gap: 8px; }

.lg-field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.lg-label {
  color: var(--lg-text);
  font-size: 13px;
  font-weight: 500;
}

.lg-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--lg-border);
  border-radius: 4px;
  background: var(--lg-input-bg);
  color: #fff;
  font: inherit;
  font-size: 15px;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.lg-input::placeholder { color: var(--lg-faint); }
.lg-input:hover { border-color: var(--lg-border-hover); }

.lg-input:focus {
  outline: none;
  border-color: var(--lg-primary);
  background: var(--lg-input-bg-focus);
  box-shadow: 0 0 0 3px var(--lg-ring);
}

.lg-input[aria-invalid="true"] { border-color: var(--lg-error); }

/* Keep autofilled fields dark. */
.lg-input:-webkit-autofill,
.lg-input:-webkit-autofill:hover,
.lg-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px var(--lg-input-bg) inset;
  caret-color: #fff;
  transition: background-color 600000s 0s, color 600000s 0s;
}

.lg-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--lg-input-bg-focus) inset, 0 0 0 3px var(--lg-ring);
}

.lg-input-wrap { position: relative; }
.lg-input--reveal { padding-right: 72px; }

.lg-reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--lg-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.lg-reveal:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.lg-code {
  height: 60px;
  font-family: var(--lg-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5em;
  text-align: center;
  padding-left: calc(14px + 0.5em);
}

.lg-code::placeholder { letter-spacing: 0.5em; color: rgba(255, 255, 255, 0.16); }

.lg-hint {
  margin: 0;
  color: var(--lg-muted);
  font-size: 13px;
}

/* Primary button: dark ink on brand green keeps AA contrast. */
.lg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: var(--lg-primary);
  color: var(--lg-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 120ms ease, transform 80ms ease;
}

.lg-btn:hover { background: var(--lg-primary-hover); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn__arrow { display: inline-block; transition: transform 140ms ease; }
.lg-btn:hover .lg-btn__arrow { transform: translateX(3px); }

.lg-btn[aria-busy="true"],
.lg-btn:disabled {
  cursor: progress;
  background: var(--lg-primary-dark);
  color: rgba(255, 255, 255, 0.92);
}

.lg-btn[aria-busy="true"]::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lg-spin 700ms linear infinite;
}

@keyframes lg-spin { to { transform: rotate(360deg); } }

/* Links */
.lg-link {
  color: var(--lg-primary-soft);
  text-decoration: none;
  border-radius: 2px;
}

.lg-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lg-link--small { font-size: 13px; }

.lg-link--button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.lg-back {
  display: inline-block;
  margin-top: 22px;
  color: var(--lg-muted);
  font-size: 13px;
  text-decoration: none;
}

.lg-back:hover { color: #fff; }

.lg-alt {
  margin: 22px 0 0;
  color: var(--lg-muted);
  font-size: 13px;
}

.lg-resend {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 18px;
}

.lg-foot {
  margin: 40px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--lg-faint);
  font-size: 12px;
}

/* Keyboard focus everywhere */
.lg-btn:focus-visible,
.lg-reveal:focus-visible,
.lg-copy:focus-visible,
.lg-link:focus-visible,
.lg-back:focus-visible,
.lg-credit a:focus-visible,
.lg-manual__toggle:focus-visible {
  outline: 2px solid var(--lg-primary);
  outline-offset: 2px;
}

/* Challenge countdown */
.lg-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--lg-muted);
  font-size: 12px;
}

.lg-timer__value { color: var(--lg-text); font-family: var(--lg-mono); font-weight: 600; }

.lg-timer__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lg-primary);
  animation: lg-pulse 1.6s ease-in-out infinite;
}

.lg-timer.is-low { color: var(--lg-error); border-color: rgba(255, 138, 128, 0.35); }
.lg-timer.is-low .lg-timer__dot { background: var(--lg-error); }
.lg-timer + .lg-banner { margin-top: 14px; }

@keyframes lg-pulse { 50% { opacity: 0.35; } }

/* MFA setup steps */
.lg-steps {
  counter-reset: lg-step;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.lg-steps__item {
  position: relative;
  padding: 0 0 22px 40px;
  counter-increment: lg-step;
}

.lg-steps__item::before {
  content: counter(lg-step);
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(121, 167, 99, 0.6);
  border-radius: 50%;
  color: var(--lg-primary-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.lg-steps__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 4px;
  left: 13px;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.lg-steps__title { display: block; color: #fff; font-weight: 600; line-height: 26px; }
.lg-steps__text { display: block; color: var(--lg-muted); font-size: 13px; }

.lg-qr {
  display: inline-flex;
  margin: 12px 0 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(121, 167, 99, 0.25);
}

.lg-qr__canvas { display: block; width: 176px; height: 176px; image-rendering: pixelated; }

.lg-manual { margin-top: 4px; }

.lg-manual__toggle {
  color: var(--lg-primary-soft);
  font-size: 13px;
  cursor: pointer;
}

.lg-manual[open] .lg-hint { margin-top: 10px; }

.lg-secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.lg-secret {
  flex: 1 1 auto;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: var(--lg-input-bg);
  color: #fff;
  font-family: var(--lg-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  user-select: all;
}

.lg-copy {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--lg-border);
  border-radius: 4px;
  background: transparent;
  color: var(--lg-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lg-copy:hover { border-color: var(--lg-primary); }

/* Password rules */
.lg-rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--lg-muted);
}

.lg-rules__item { display: flex; align-items: center; gap: 8px; }

.lg-rules__item::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--lg-dark);
  font-size: 10px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
}

.lg-rules__item.is-met { color: var(--lg-primary-soft); }

.lg-rules__item.is-met::before {
  content: "\2713";
  border-color: var(--lg-primary);
  background: var(--lg-primary);
}

/* -------------------------------------------------------------------- RESPONSIVE */

@media (max-width: 900px) {
  .lg-shell { flex-direction: column; }

  .lg-photo {
    flex: 0 0 auto;
    max-width: 100%;
    height: clamp(170px, 34vw, 240px);
    border-right: 0;
    border-bottom: 1px solid rgba(121, 167, 99, 0.16);
  }

  .lg-photo__img { object-position: 42% 74%; }
  .lg-photo__content { justify-content: flex-end; padding: 20px 24px; }
  .lg-hero { display: none; }
  .lg-credit { top: 10px; right: 12px; bottom: auto; font-size: 10px; }
  .lg-panel { flex: 1 0 auto; overflow: visible; padding: 32px 20px 40px; }
  .lg-card { margin: 0 auto; }

  /* 16px inputs stop iOS zooming on focus. */
  .lg-input { font-size: 16px; }
  .lg-code { font-size: 26px; }
}

@media (max-height: 640px) and (min-width: 901px) {
  .lg-photo__content { padding-bottom: 40px; }
  .lg-hero__title { font-size: clamp(40px, 4.4vw, 60px); }
}

@media (prefers-reduced-motion: reduce) {
  .lg-photo__img, .lg-card, .lg-timer__dot { animation: none; }
  .lg-btn, .lg-btn__arrow, .lg-input { transition: none; }
  .lg-btn[aria-busy="true"]::before { animation-duration: 2s; }
}

@media (forced-colors: active) {
  .lg-btn, .lg-input, .lg-banner { border: 1px solid CanvasText; }
}
