/* =========================================================================
   DFAMPC DIGITAL OPERATIONS PORTAL (/staff/login only)
   Scoped to body.staff-login-page. Full-viewport background (image or
   MP4) behind an HTML frosted-glass sign-in panel. Brand tokens from
   order.css (navy, forest/emerald green, muted gold, ivory).
   ========================================================================= */

body.staff-login-page {
  --sp-ink: var(--color-navy-deep, #10243a);
  --sp-green: var(--color-primary, #087f6d);
  --sp-green-dark: var(--color-primary-hover, #075b50);
  --sp-gold: #c9a45c;
  background: #f3ecdc;
}
/* The portal is its own focused screen: no category bar or site footer. */
body.staff-login-page .site-categories,
body.staff-login-page .site-footer { display: none; }
body.staff-login-page .site-header { background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
body.staff-login-page .site-main { max-width: none; padding: 0; }

/* ---- Background layer ------------------------------------------------------ */
.sp-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 20% 15%, rgba(8, 127, 109, 0.18), transparent 60%),
    radial-gradient(900px 500px at 85% 90%, rgba(201, 164, 92, 0.22), transparent 60%),
    linear-gradient(160deg, #f8f2e4, #efe5cf);
}
.sp-bg__image, .sp-bg__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center center;
}
.sp-bg__video { opacity: 0; transition: opacity 600ms ease; }
.sp-bg.is-playing .sp-bg__video { opacity: 1; }
/* Light, even veil so the panel and header stay readable on busy artwork. */
.sp-bg__overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(248, 244, 234, 0.08) 0%, rgba(16, 36, 58, 0.12) 100%);
}

/* ---- Layout ----------------------------------------------------------------- */
.sp {
  position: relative; z-index: 1;
  min-height: calc(100vh - var(--site-header-h, 72px));
  min-height: calc(100dvh - var(--site-header-h, 72px));
  display: grid; place-items: center;
  padding: clamp(var(--space-5), 6vh, 64px) max(var(--space-4), env(safe-area-inset-right))
           calc(clamp(var(--space-5), 6vh, 64px) + env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
}

/* ---- Frosted-glass panel ----------------------------------------------------- */
.sp-panel {
  position: relative;
  width: min(420px, 100%);
  padding: clamp(28px, 4vw, 40px) clamp(22px, 4vw, 38px) clamp(24px, 3vw, 32px);
  border-radius: 20px;
  background: rgba(255, 252, 245, 0.62);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 1px rgba(201, 164, 92, 0.38),
    0 18px 50px rgba(16, 39, 58, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: center;
  color: var(--sp-ink);
}
/* A fine emerald-to-gold line along the top edge. */
.sp-panel::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--sp-green) 25%, var(--sp-gold) 75%, transparent);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sp-panel { background: rgba(255, 252, 245, 0.94); }
}

.sp-logo { display: grid; place-items: center; margin: 0 auto 14px; }
.sp-logo__img {
  width: auto; height: auto; max-width: 96px; max-height: 96px; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(16, 36, 58, 0.18));
}
.sp-logo__fallback {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  color: var(--sp-green); background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(201, 164, 92, 0.5);
}
.sp-logo__fallback[hidden], .sp-logo__img[hidden] { display: none; }

.sp-label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sp-green);
}
.sp-label::before, .sp-label::after { content: ""; width: 18px; height: 1px; background: var(--sp-gold); }
.sp-title { margin: 0 0 24px; display: grid; gap: 4px; }
.sp-title__brand {
  font-family: var(--font-souvenir); font-weight: 800; font-size: clamp(30px, 6vw, 38px);
  letter-spacing: 0.04em; color: var(--sp-ink); line-height: 1.05;
}
.sp-title__sub {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: #8a6d33;
}

/* ---- Form ---------------------------------------------------------------------- */
.sp-form { display: grid; gap: 16px; text-align: left; }
.sp-field { display: grid; gap: 6px; }
.sp-field label { font-size: 13px; font-weight: 700; color: var(--sp-ink); }
.sp-field input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border-radius: 12px; border: 1px solid rgba(201, 164, 92, 0.55);
  background: rgba(255, 255, 255, 0.72); color: var(--sp-ink);
  font: inherit; font-size: 16px; /* 16px: no iOS focus zoom */
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.sp-field input:focus {
  outline: none; border-color: var(--sp-green); background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(8, 127, 109, 0.22);
}
.sp-password { position: relative; }
.sp-password input { padding-right: 52px; }
.sp-password__toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent;
  display: grid; place-items: center; color: #5b6b7a; cursor: pointer;
}
.sp-password__toggle:hover { color: var(--sp-green); }
.sp-password__toggle:focus-visible { outline: 3px solid var(--sp-gold); outline-offset: -2px; }
.sp-password__toggle .sp-eye-off { display: none; }
.sp-password__toggle[aria-pressed="true"] .sp-eye { display: none; }
.sp-password__toggle[aria-pressed="true"] .sp-eye-off { display: block; }

.sp-error { margin: 0; min-height: 0; color: #a3221a; font-size: 13.5px; font-weight: 600; text-align: center; }
.sp-error:empty { display: none; }
.sp-submit {
  min-height: 50px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, #0a8f7a, var(--sp-green));
  color: #fff; font: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(8, 127, 109, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.sp-submit:focus-visible { outline: 3px solid var(--sp-gold); outline-offset: 3px; }
.sp-submit:disabled { opacity: 0.7; cursor: progress; }
@media (hover: hover) {
  .sp-submit:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--sp-green), var(--sp-green-dark));
    box-shadow: 0 10px 26px rgba(8, 127, 109, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
  }
}
.sp-foot { margin: 18px 0 0; font-size: 13px; color: #4b5b6b; }
.sp-foot a { color: var(--sp-green); font-weight: 700; }

/* ---- Phones ------------------------------------------------------------------------ */
@media (max-width: 600px) {
  .sp { place-items: start center; padding-top: var(--space-5); }
  .sp-panel { border-radius: 18px; }
  .sp-bg__image, .sp-bg__video { object-position: 50% 40%; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-bg__video { display: none; }
}

/* Video background without a still frame yet: plain dark backdrop that the
   video fades in over - no other picture is ever shown first. */
.sp-bg--nostill { background: #10243a; }
.sp-bg--video .sp-bg__video { transition: opacity 400ms ease; }
