/* =========================================================
   OrderFlow — Shared Login Page
   Applies to: admin-new.html · factory-new.html · customers.html
   Requires: orderflow-design.css (tokens) loaded first
   ========================================================= */

/* ----------------------------------------------------------
   1. Page shell — flex-centres the card, paints the bg
   Works as a wrapper div (factory/customer) OR inside a
   position:fixed overlay (admin). Add class="lp" to the
   outermost container in each portal.
   ---------------------------------------------------------- */
.lp {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: var(--of-font);
  background-color: var(--of-page-bg);
  background-image:
    radial-gradient(ellipse 72% 55% at 16% 24%, rgba(61,78,232,.10) 0%, transparent 62%),
    radial-gradient(ellipse 55% 68% at 86% 78%, rgba(90,107,255,.08) 0%, transparent 60%),
    radial-gradient(ellipse 44% 44% at 52% 48%, rgba(61,78,232,.04) 0%, transparent 72%);
  position: relative;
  overflow: hidden;
}

/* Decorative accent blobs */
.lp::before,
.lp::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.lp::before {
  width: 640px;
  height: 640px;
  top: -270px;
  left: -200px;
  background: radial-gradient(circle, rgba(61,78,232,.07) 0%, transparent 66%);
}
.lp::after {
  width: 480px;
  height: 480px;
  bottom: -200px;
  right: -140px;
  background: radial-gradient(circle, rgba(90,107,255,.08) 0%, transparent 66%);
}

/* ----------------------------------------------------------
   2. Card wrapper — the gradient "border" effect
   ---------------------------------------------------------- */
.lp-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 452px;
  border-radius: 24px;
  padding: 2px;
  /* Shared tokens from orderflow-design.css :root — same treatment as every
     card container in the app. Values are identical to the originals. */
  background: var(--of-outline-grad);
  box-shadow: var(--of-shadow-outline);
}

/* ----------------------------------------------------------
   3. Card inner
   ---------------------------------------------------------- */
.lp-card {
  background: var(--of-app-bg);
  border-radius: 22px;
  padding: 48px 44px 40px;
}

/* ----------------------------------------------------------
   4. Brand area (logo + name)
   ---------------------------------------------------------- */
.lp-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

/* img#brand-login-logo — hidden via JS until src confirmed */
.lp-brand img {
  height: 52px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* span#brand-login-name — shown when no logo, or always as label */
.lp-brand-name {
  font-size: 21px;
  font-weight: 800;
  color: var(--of-ink);
  letter-spacing: -.5px;
  line-height: 1;
}

/* ----------------------------------------------------------
   5. Portal header (badge + title + subtitle)
   ---------------------------------------------------------- */
.lp-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--of-line);
}

.lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--of-accent);
  background: rgba(61,78,232,.08);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 13px;
}
.lp-badge svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.lp-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--of-ink);
  letter-spacing: -.4px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.lp-subtitle {
  font-size: 14px;
  color: var(--of-muted);
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

/* ----------------------------------------------------------
   6. Error message
   ---------------------------------------------------------- */
.lp-error {
  display: none;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,91,110,.06);
  border: 1px solid rgba(255,91,110,.22);
  border-radius: 11px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--of-red);
  font-weight: 500;
  line-height: 1.45;
}
.lp-error.show { display: flex; }
.lp-error svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  stroke: currentColor;
}

/* ----------------------------------------------------------
   7. Form fields
   ---------------------------------------------------------- */
.lp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--of-ink-2);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.lp-field input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  font-family: var(--of-font);
  font-size: 14.5px;
  font-weight: 400;
  color: var(--of-ink);
  background: var(--of-page-bg);
  border: 1.5px solid var(--of-line);
  border-radius: 11px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.lp-field input::placeholder {
  color: var(--of-muted);
  font-weight: 400;
}

.lp-field input:hover:not(:focus) {
  border-color: #c6c9dc;
}

.lp-field input:focus {
  border-color: var(--of-accent);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(61,78,232,.12);
}

/* ----------------------------------------------------------
   8. Sign In button
   ---------------------------------------------------------- */
.lp-btn-signin {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--of-font);
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  background: var(--of-accent-grad);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
  transition: opacity .16s ease, transform .15s ease, box-shadow .16s ease;
  box-shadow:
    0 6px 18px -4px rgba(61,78,232,.55),
    0 2px 5px  -2px rgba(61,78,232,.28);
}

/* Inner gloss sheen */
.lp-btn-signin::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.13) 0%, transparent 55%);
  pointer-events: none;
}

.lp-btn-signin:hover {
  opacity: .91;
  transform: translateY(-1px);
  box-shadow:
    0 10px 24px -4px rgba(61,78,232,.58),
    0 3px 8px  -2px rgba(61,78,232,.28);
}

.lp-btn-signin:active {
  transform: translateY(0);
  opacity: 1;
  box-shadow:
    0 4px 12px -4px rgba(61,78,232,.5),
    0 1px 3px  -1px rgba(61,78,232,.25);
}

.lp-btn-signin:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* Spinner inside button */
.lp-btn-signin .lp-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lp-spin .65s linear infinite;
  flex-shrink: 0;
}

.lp-btn-signin.loading .lp-spinner { display: block; }
.lp-btn-signin.loading .lp-btn-label { opacity: .72; }

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

/* ----------------------------------------------------------
   9. Dev bypass section
   ---------------------------------------------------------- */
.lp-dev {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.lp-dev-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--of-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.lp-dev-rule::before,
.lp-dev-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--of-line);
}

.lp-btn-dev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--of-font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--of-amber);
  background: rgba(245,166,35,.05);
  border: 1.5px dashed rgba(245,166,35,.45);
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .15s ease, border-color .15s ease;
}
.lp-btn-dev:hover {
  background: rgba(245,166,35,.11);
  border-color: var(--of-amber);
}
.lp-btn-dev:active {
  background: rgba(245,166,35,.16);
}

/* ----------------------------------------------------------
   10. Responsive
   ---------------------------------------------------------- */
@media (max-width: 500px) {
  .lp-card {
    padding: 36px 24px 28px;
  }
  .lp-wrap {
    max-width: 100%;
  }
  .lp-title {
    font-size: 20px;
  }
}

@media (max-width: 360px) {
  .lp-card {
    padding: 28px 18px 24px;
  }
}

/* ── OMS Hub product lockup — default factory-login brand when the instance
     has no company logo uploaded (mirrors the Hub's own login mark). ── */
.lp-hub-lockup{display:flex;align-items:center;gap:12px;justify-content:center}
.lp-hub-mark{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#6474FF,#3A3FD8);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 20px -6px rgba(100,116,255,.8);flex-shrink:0}
.lp-hub-mark svg{width:22px;height:22px;stroke:#fff;fill:none;stroke-width:2.1}
.lp-hub-name{font-size:17px;font-weight:800;letter-spacing:-.02em;color:var(--of-ink,#2A2E45);text-align:left}
.lp-hub-sub{font-size:10px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--of-muted,#9CA0B8);margin-top:2px;text-align:left}
