/* ── Login page — standalone, no app shell ── */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  margin: 0; padding: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.nvr-login-page {
  margin: 0; padding: 0;
  height: 100%; min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Theme tokens ── */
body.nvr-login-page.theme-dark {
  --lpanel-from: #0a1628;
  --lpanel-to:   #0d1f3c;
  --lbg:         #0d1117;
  --lcard-bg:    #161d2b;
  --lcard-border: rgba(255,255,255,0.07);
  --lcard-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 24px 60px rgba(0,0,0,0.5);
  --ltext:        #e2e8f0;
  --lmuted:       #64748b;
  --linput-bg:    #0d1117;
  --linput-border:#2a3a50;
  --laccent:      #3b82f6;
  --laccent-glow: rgba(59,130,246,0.22);
  --ltoggle-bg:   rgba(15,23,42,0.9);
  --ltoggle-bd:   rgba(148,163,184,0.15);
  --ltoggle-c:    #94a3b8;
  --ldivider:     rgba(255,255,255,0.07);
}

body.nvr-login-page.theme-light {
  --lpanel-from: #1a2f4e;
  --lpanel-to:   #112240;
  --lbg:         #f0f4f8;
  --lcard-bg:    #ffffff;
  --lcard-border: rgba(0,0,0,0.06);
  --lcard-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 20px 48px rgba(0,0,0,0.1);
  --ltext:        #0f172a;
  --lmuted:       #64748b;
  --linput-bg:    #f8fafc;
  --linput-border:#cbd5e1;
  --laccent:      #2563eb;
  --laccent-glow: rgba(37,99,235,0.18);
  --ltoggle-bg:   rgba(255,255,255,0.95);
  --ltoggle-bd:   rgba(0,0,0,0.1);
  --ltoggle-c:    #475569;
  --ldivider:     rgba(0,0,0,0.08);
}

/* ── Two-column shell ── */
.nvr-login-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* ── Left brand panel ── */
.nvr-login-panel {
  flex: 0 0 40%;
  background: linear-gradient(160deg, var(--lpanel-from) 0%, var(--lpanel-to) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
}

/* Decorative grid overlay */
.nvr-login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Bottom glow blob */
.nvr-login-panel::after {
  content: "";
  position: absolute;
  bottom: -100px; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(59,130,246,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.nvr-login-panel-inner {
  position: relative;
  z-index: 1;
  max-width: 340px;
  width: 100%;
}

.nvr-login-panel-logo {
  width: 76px; height: 76px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
}

.nvr-login-panel-logo img {
  width: 100%; height: 100%; object-fit: contain;
}

.nvr-login-panel-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.03em;
  margin: 0 0 0.45rem;
}

.nvr-login-panel-tagline {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.nvr-login-panel-divider {
  height: 1px;
  margin: 2rem 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), transparent);
}

/* Feature list */
.nvr-login-features {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 1.25rem;
}

.nvr-login-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.nvr-login-feature-icon {
  flex-shrink: 0;
  width: 2.1rem; height: 2.1rem;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #60a5fa;
  font-size: 1.05rem;
}

.nvr-login-features li .nvr-feat-text {
  display: flex; flex-direction: column; gap: 0.15rem;
}

.nvr-login-features li strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
  display: block;
}

.nvr-login-features li span {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

.nvr-login-panel-footer {
  margin-top: 2.5rem;
  font-size: 0.775rem;
  color: rgba(148,163,184,0.55);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Right form side ── */
.nvr-login-form-side {
  flex: 1;
  background: var(--lbg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

/* ── Form card ── */
.nvr-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--lcard-bg);
  border: 1px solid var(--lcard-border);
  border-radius: 20px;
  box-shadow: var(--lcard-shadow);
  padding: 0 2.25rem 2rem;
  animation: nvr-login-in 0.4s ease-out;
}

@keyframes nvr-login-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Animated top accent stripe */
.nvr-login-card-accent {
  height: 3px;
  margin: 0 -2.25rem 2rem;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--laccent), #8b5cf6, var(--laccent));
  background-size: 200% 100%;
  animation: nvr-shimmer 3s ease-in-out infinite;
}

@keyframes nvr-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Mobile-only logo */
.nvr-login-mobile-brand {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ltext);
}

.nvr-login-mobile-brand img {
  width: 38px; height: 38px; object-fit: contain;
}

.nvr-login-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ltext);
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
}

.nvr-login-subheading {
  font-size: 0.875rem;
  color: var(--lmuted);
  margin: 0 0 1.75rem;
}

/* Form labels */
.nvr-login-page .form-label {
  color: var(--lmuted);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

/* Input with left icon using input-group pattern */
.nvr-input-group {
  display: flex;
  align-items: center;
  background: var(--linput-bg);
  border: 1px solid var(--linput-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nvr-input-group:focus-within {
  border-color: var(--laccent);
  box-shadow: 0 0 0 3px var(--laccent-glow);
}

.nvr-input-group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  color: var(--lmuted);
  font-size: 1rem;
  flex-shrink: 0;
  pointer-events: none;
}

.nvr-input-group input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--ltext) !important;
  padding: 0.65rem 0.75rem 0.65rem 0 !important;
  font-size: 0.9375rem;
  min-height: 2.75rem;
}

.nvr-input-group input::placeholder {
  color: var(--lmuted);
  opacity: 0.7;
}

.nvr-pw-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--lmuted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  height: 100%;
  transition: color 0.15s;
}

.nvr-pw-toggle:hover { color: var(--laccent); }

/* Forgot link */
.nvr-login-forgot-wrap {
  text-align: right;
  margin-top: 0.4rem;
}

.nvr-login-forgot-link {
  font-size: 0.8125rem !important;
  padding: 0 !important;
  color: var(--laccent) !important;
  text-decoration: none;
  font-weight: 500;
}

.nvr-login-forgot-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Submit */
.nvr-login-submit {
  background: linear-gradient(135deg, var(--laccent) 0%, #1d4ed8 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  min-height: 2.75rem;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px var(--laccent-glow) !important;
  transition: opacity 0.15s, transform 0.15s !important;
}

.nvr-login-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.nvr-login-submit:disabled { opacity: 0.65; }

/* Card footer */
.nvr-login-card-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ldivider);
  font-size: 0.775rem;
  color: var(--lmuted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

/* Theme toggle button */
.nvr-login-theme-bar {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 100;
}

.nvr-theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--ltoggle-bd);
  background: var(--ltoggle-bg);
  color: var(--ltoggle-c);
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.15s;
}

.nvr-theme-btn:hover { transform: scale(1.1); }

/* Reset modal */
.nvr-reset-modal .modal-content {
  background: var(--lcard-bg);
  border-color: var(--lcard-border);
  color: var(--ltext);
  border-radius: 16px;
}

.nvr-reset-modal .modal-header {
  border-bottom: 1px solid var(--ldivider);
}

.nvr-forgot-password-status {
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.nvr-forgot-password-status.success {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.28);
  color: #10b981;
}

.nvr-forgot-password-status.error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.28);
  color: #ef4444;
}

.nvr-email-validation-error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

/* ── Reset password page (single centered card) ── */
body.nvr-reset-password-page {
  background: var(--lbg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.nvr-reset-shell {
  width: 100%;
  max-width: 440px;
  padding: 5rem 1.25rem 2rem;
}

.nvr-reset-card {
  width: 100%;
  background: var(--lcard-bg);
  border: 1px solid var(--lcard-border);
  box-shadow: var(--lcard-shadow);
  border-radius: 20px;
  padding: 0 2rem 2rem;
  position: relative;
}

/* ── Mobile: hide left panel, stack form ── */
@media (max-width: 800px) {
  .nvr-login-panel { display: none; }

  .nvr-login-form-side {
    align-items: flex-start;
    padding-top: max(4.5rem, env(safe-area-inset-top, 1rem));
  }

  .nvr-login-mobile-brand { display: flex; }

  .nvr-login-card { padding: 0 1.5rem 1.5rem; border-radius: 16px; }
  .nvr-login-card-accent { margin: 0 -1.5rem 1.75rem; }
}
