/* ==========================================================================
   PnG Capture — Admin Login Premium Styles (admin/assets/css/admin-login.css)
   ========================================================================== */

/* ---- Base reset for login page ---- */
.admin-login-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

/* ---- Split layout ---- */
.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* =====================================================================
   LEFT — Visual Branding Panel
   ===================================================================== */
.login-visual-panel {
  position: relative;
  background: linear-gradient(135deg, #1a1208 0%, #0f0b04 50%, #1d1507 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 60px 48px;
}

[data-theme="temple-gold"] .login-visual-panel {
  background: linear-gradient(145deg, #2c1e05, #1a1208 55%, #0f0b04);
}

/* Noise texture overlay */
.lvp-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

/* Glowing orbs */
.lvp-orbs { position: absolute; inset: 0; pointer-events: none; }
.lvp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.25;
  animation: orbFloat 8s ease-in-out infinite alternate;
}
.lvp-orb-1 { width: 320px; height: 320px; background: #b8863b; top: -60px; left: -80px; animation-duration: 9s; }
.lvp-orb-2 { width: 240px; height: 240px; background: #7a1f2b; bottom: -40px; right: -60px; animation-duration: 11s; animation-delay: -3s; }
.lvp-orb-3 { width: 180px; height: 180px; background: #d4a65a; bottom: 30%; left: 50%; animation-duration: 13s; animation-delay: -6s; }

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(20px, -30px) scale(1.08); }
}

/* Panel content */
.lvp-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #f3e9dd;
  max-width: 340px;
}
.lvp-logo {
  max-width: 140px;
  height: auto;
  object-fit: contain;
  filter: brightness(1.15) drop-shadow(0 0 20px rgba(184, 134, 59, 0.4));
  animation: logoBreathe 4s ease-in-out infinite;
}
@keyframes logoBreathe {
  0%, 100% { filter: brightness(1.15) drop-shadow(0 0 14px rgba(184,134,59,0.3)); }
  50%       { filter: brightness(1.25) drop-shadow(0 0 28px rgba(184,134,59,0.55)); }
}

.lvp-quote {
  margin: 36px 0 40px;
  border: 0;
  padding: 0;
}
.lvp-quote p {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.8vw, 20px);
  font-style: italic;
  line-height: 1.55;
  color: rgba(243, 233, 221, 0.85);
  margin: 0;
}
.lvp-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
  border-top: 1px solid rgba(243, 233, 221, 0.12);
  padding-top: 24px;
}
.lvp-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lvp-num { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #d4a65a; line-height: 1; }
.lvp-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(243, 233, 221, 0.6); }

/* =====================================================================
   RIGHT — Form Panel
   ===================================================================== */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 48px 32px;
  overflow-y: auto;
}
.login-form-wrap {
  width: 100%;
  max-width: 400px;
  animation: formSlideIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) both;
}
@keyframes formSlideIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-mobile-brand {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.login-mobile-logo { max-width: 100px; height: auto; object-fit: contain; }

.login-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.login-heading {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.15;
}
.login-subtext {
  font-size: 14px;
  color: var(--sandal);
  margin: 0 0 32px;
  line-height: 1.5;
}

/* Error banner */
.login-error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(179, 44, 30, 0.1);
  border: 1px solid rgba(179, 44, 30, 0.3);
  border-radius: var(--radius-sm);
  color: var(--status-danger);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  margin-bottom: 24px;
  animation: shakeError 0.4s ease;
}
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Form fields */
.login-form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lf-field { display: flex; flex-direction: column; gap: 8px; }
.lf-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sandal);
}
.lf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.lf-icon {
  position: absolute;
  left: 14px;
  color: var(--sandal);
  pointer-events: none;
  transition: color 200ms ease;
  flex-shrink: 0;
}
.lf-input {
  width: 100%;
  height: 50px;
  padding: 0 48px 0 42px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  outline: none;
  box-sizing: border-box;
}
.lf-input::placeholder { color: var(--sandal); opacity: 0.7; }
.lf-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 59, 0.15);
}
.lf-field:focus-within .lf-icon { color: var(--gold); }

/* Password toggle button */
.lf-pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sandal);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color 200ms ease, background 200ms ease;
  display: flex;
  align-items: center;
}
.lf-pw-toggle:hover { color: var(--gold); background: var(--surface-2); }

/* Submit button */
.lf-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  margin-top: 8px;
  transition: background 200ms ease, transform 150ms ease, box-shadow 200ms ease;
  box-shadow: 0 4px 20px rgba(184, 134, 59, 0.3);
  position: relative;
  overflow: hidden;
}
.lf-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.lf-submit:hover {
  background: #c9953e;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(184, 134, 59, 0.45);
}
.lf-submit:active { transform: translateY(0); }
.lf-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.lf-submit-arrow { transition: transform 200ms ease; }
.lf-submit:hover .lf-submit-arrow { transform: translateX(4px); }

/* Footer links */
.login-footnote {
  font-size: 12px;
  color: var(--sandal);
  text-align: center;
  margin: 24px 0 0;
}
.login-footnote code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.login-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.login-back-link {
  font-size: 13px;
  color: var(--sandal);
  text-decoration: none;
  transition: color 150ms ease;
}
.login-back-link:hover { color: var(--gold); }

.login-theme-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--sandal);
  font-size: 12px;
  font-family: var(--font-body);
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.login-theme-btn:hover { border-color: var(--gold); color: var(--gold); }

/* =====================================================================
   Responsive — collapse to single column on ≤900px
   ===================================================================== */
@media (max-width: 900px) {
  .login-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }
  /* Collapse visual panel to a compact top banner on mobile */
  .login-visual-panel {
    padding: 0 24px;
    min-height: 72px;
    height: 72px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
    overflow: hidden;
  }
  /* Keep orbs but reduce them for performance */
  .lvp-orb-1 { width: 160px; height: 160px; top: -60px; left: -40px; }
  .lvp-orb-2 { width: 120px; height: 120px; bottom: -50px; right: -30px; }
  .lvp-orb-3 { display: none; }
  /* In banner mode show only logo; hide quote+stats */
  .lvp-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    text-align: left;
  }
  .lvp-logo { max-width: 48px; }
  .lvp-quote,
  .lvp-stats { display: none; }
  /* Show a compact brand tagline */
  .lvp-content::after {
    content: 'PnG Capture Admin';
    font-family: var(--font-display, serif);
    font-size: 16px;
    font-weight: 700;
    color: rgba(243, 233, 221, 0.9);
    letter-spacing: 0.04em;
  }
  .login-form-panel {
    padding: 32px 20px;
    min-height: auto;
  }
  .login-mobile-brand { display: none; } /* banner already handles branding */
}
@media (max-width: 480px) {
  .login-form-wrap { max-width: 100%; }
  .login-heading { font-size: 28px; }
}

/* ---- Field-level error state ---- */
.lf-field.has-error .lf-input {
  border-color: #e05252;
  box-shadow: 0 0 0 3px rgba(224, 82, 82, 0.18);
  animation: lf-shake 350ms ease;
}
.lf-field.has-error .lf-icon { color: #e05252; }
.lf-field-error {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  font-family: var(--font-body);
  color: #e05252;
  letter-spacing: 0.02em;
}
@keyframes lf-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  40%       { transform: translateX(5px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ---- Caps Lock warning ---- */
.lf-caps-warn {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  font-family: var(--font-body);
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* ---- Submit spinner keyframe ---- */
@keyframes lf-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.lf-submit-spinner { flex-shrink: 0; }

/* ---- Screen-reader only helper (for visually-hidden h1) ---- */
.lf-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Mobile: prevent orbs from overflowing when panel is banner height ---- */
@media (max-width: 900px) {
  .lvp-orb-1, .lvp-orb-2 {
    opacity: 0.5; /* Dim orbs in compact mode to avoid distraction */
    filter: blur(32px) !important; /* Extra blur to soften overflow edges */
  }
}

/* ---- Reduced motion overrides ---- */
@media (prefers-reduced-motion: reduce) {
  .lf-input, .lf-submit, .lf-pw-toggle,
  .lf-submit-arrow, .lvp-orb,
  .lf-field.has-error .lf-input { animation: none; transition: none; }
}
