/* ==========================================================================
   Kafh / ERPNext Modern Split Login Theme (Wide Responsive Fix) — Corrected
   ==========================================================================
   Three things fixed vs. the version you were running:

   1. SCOPING BUG (the one that broke your Attendance dashboard Web Page):
      `header`, `footer`, `html`, `body`, `.page-container`, `.page-content`,
      `main` are the exact same elements/classes every website page uses —
      not just /login. This file loads sitewide via `web_include_css`, so
      the unscoped `height:100vh !important` + `overflow:hidden !important`
      + flex-centering rules were being forced onto EVERY website page,
      including any Web Page/doctype-embedded HTML. That's what killed
      scrolling and clipped content on the sides elsewhere on the site.
      Fixed by scoping every rule to `body[data-path="login"]` (the one
      reliable, class-free marker Frappe puts only on the real login page)
      or to `.for-login` (a section class that only ever exists on the
      login page's own markup).

   2. DEAD SELECTOR BUG: `.page_login` never matches anything in the real
      DOM (confirmed from the live page source — Frappe uses
      `id="page-login"` and `class="for-login"`, never `class="page_login"`).
      Every `.page_login ...` rule below was inert. Replaced with
      `.for-login ...` throughout.

   3. PER-SERVER OFF-SWITCH: the three blocks below that touch REAL,
      always-present Frappe elements (header/footer/navbar, html/body,
      .page-card/.page-container/.page-content/main) are additionally
      guarded with `html:not(.orbit-login-off)`. Everything else in this
      file only targets `.kafh-*` classes that the Kafh JS itself creates —
      if that JS is gated off (see orbit-login-theme-gate.js), those
      classes never appear in the DOM, so no extra guarding is needed
      there. This lets a server keep its own pre-existing custom login
      page untouched (via `bench set-config <site> orbit_login_theme 0`)
      while still getting the rest of the orbit_theme everywhere.
   ========================================================================== */

/* Hide Default ERPNext Website Header, Footer & Logos — login page only,
   and only when the login theme is on */
html:not(.orbit-login-off) body[data-path="login"] header,
html:not(.orbit-login-off) body[data-path="login"] footer,
html:not(.orbit-login-off) body[data-path="login"] .web-header,
html:not(.orbit-login-off) body[data-path="login"] .web-footer,
html:not(.orbit-login-off) body[data-path="login"] .navbar,
html:not(.orbit-login-off) body[data-path="login"] #footer,
html:not(.orbit-login-off) body[data-path="login"] .page-footer,
html:not(.orbit-login-off) body[data-path="login"] .page-head,
html:not(.orbit-login-off) body[data-path="login"] .app-logo,
html:not(.orbit-login-off) body[data-path="login"] .page-card-head {
  display: none !important;
}
/* FULLSCREEN BACKGROUND & CENTERING — login page only, theme-on only */
html:not(.orbit-login-off):has(body[data-path="login"]),
html:not(.orbit-login-off) body[data-path="login"] {
  height: 100vh !important;
  width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #f5f4ed !important; /* Soft Cream / Off-white background */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}
/* CRITICAL FIX: OVERRIDE ERPNEXT NARROW WIDTH CONSTRAINTS — login page
   only, theme-on only */
html:not(.orbit-login-off) .for-login .page-card,
html:not(.orbit-login-off) .for-login,
html:not(.orbit-login-off) body[data-path="login"] .login-content,
html:not(.orbit-login-off) body[data-path="login"] .page-container,
html:not(.orbit-login-off) body[data-path="login"] .page-content,
html:not(.orbit-login-off) body[data-path="login"] main {
  max-width: none !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
/* MAIN CARD CONTAINER (WIDE & ROOMY SPLIT LAYOUT)
   No guard needed below — .kafh-* classes only exist if the Kafh JS built
   them, and that JS itself checks the same off-switch before running. */
.kafh-split-card {
  width: 85vw !important;
  max-width: 1100px !important;
  min-width: 780px !important; /* Prevents text squishing on desktop */
  height: 620px !important;
  min-height: 580px !important;
  background: #ffffff !important;
  border-radius: 24px !important;
  border: 2px solid #0f3d2e !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12) !important;
  display: flex !important;
  position: relative !important;
  overflow: hidden !important;
  margin: auto !important;
}
/* LEFT COLUMN - FORM AREA */
.kafh-left-col {
  width: 50% !important;
  height: 100% !important;
  padding: 2.8rem 3.5rem !important; /* Generous padding so text breathes */
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: #ffffff !important;
  z-index: 2 !important;
}
/* Dynamic Brand Header Top Left */
.kafh-brand-logo {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #1a1638 !important;
  margin-bottom: 0.5rem !important;
}
.kafh-brand-icon {
  width: 28px !important;
  height: 28px !important;
  background: linear-gradient(135deg, #0d6b63, #f5b800) !important;
  border-radius: 6px !important;
  display: inline-block !important;
}
/* Welcome Titles */
.kafh-title-box h2 {
  font-size: 2.3rem !important;
  font-weight: 800 !important;
  color: #1a1638 !important;
  margin: 0 0 0.3rem 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}
.kafh-title-box p {
  font-size: 0.95rem !important;
  color: #72728a !important;
  margin: 0 0 1.2rem 0 !important;
}
/* Inputs Styling & Form Cleanup */
.kafh-left-col .form-signin {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  margin: 0 !important;
  padding: 0 !important;
}
.kafh-left-col .form-group {
  margin: 0 !important;
  width: 100% !important;
  position: relative !important;
}
.kafh-left-col .form-control {
  width: 100% !important;
  padding: 0.85rem 1.2rem !important;
  border: 1px solid #dcdce6 !important;
  border-radius: 12px !important;
  font-size: 0.95rem !important;
  background: #ffffff !important;
  color: #1a1638 !important;
  box-sizing: border-box !important;
  outline: none !important;
  height: 48px !important;
}
.kafh-left-col .form-control:focus {
  border-color: #0d6b63 !important;
  box-shadow: 0 0 0 3px rgba(13, 107, 99, 0.15) !important;
}
/* Remember Me & Forgot Password Row (Wide Layout) */
.kafh-options-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  font-size: 0.88rem !important;
  margin-top: 0.2rem !important;
  margin-bottom: 0.4rem !important;
}
.kafh-remember-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #1a1638 !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin: 0 !important;
}
.kafh-forgot-link, .for-login a {
  color: #ff4d4d !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  white-space: nowrap !important;
}
.kafh-forgot-link:hover {
  text-decoration: underline !important;
}
/* Buttons Row */
.kafh-action-buttons {
  display: flex !important;
  gap: 1rem !important;
  width: 100% !important;
  margin-top: 0.4rem !important;
}
.kafh-btn-main, .for-login .btn-primary, .for-login .btn-login {
  flex: 1 !important;
  width: 100% !important;
  background: #0d6b63 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0.85rem !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
  box-shadow: none !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.kafh-btn-main:hover, .for-login .btn-primary:hover {
  background: #094e48 !important;
}
.kafh-btn-sub, .for-login .btn-secondary, .for-login .btn-default {
  width: 100% !important;
  background: #ffffff !important;
  color: #1a1638 !important;
  border: 1px solid #dcdce6 !important;
  padding: 0.75rem !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  text-align: center !important;
  margin-top: 0.6rem !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.kafh-btn-sub:hover {
  background: #f8f8fc !important;
}
/* Policy Note Bottom */
.kafh-policy-note {
  font-size: 0.75rem !important;
  color: #9a9ab0 !important;
  line-height: 1.4 !important;
}
/* RIGHT COLUMN - ROTATING SLIDESHOW AREA */
.kafh-right-col {
  width: 50% !important;
  height: 100% !important;
  position: relative !important;
  background-size: cover !important;
  background-position: center !important;
  transition: background-image 0.8s ease-in-out !important;
}
/* Floating Yellow Play Badge in Center Line */
.kafh-play-badge {
  position: absolute !important;
  top: 50% !important;
  left: 0 !important;
  transform: translate(-50%, -50%) !important;
  width: 44px !important;
  height: 44px !important;
  background: #f5b800 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 14px rgba(245, 184, 0, 0.45) !important;
  z-index: 10 !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
}
/* Slide Counter Box Bottom Right */
.kafh-slide-counter {
  position: absolute !important;
  bottom: 24px !important;
  right: 24px !important;
  background: #ffffff !important;
  border-radius: 10px !important;
  padding: 6px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: #1a1638 !important;
}
.kafh-arrow-btn {
  cursor: pointer !important;
  color: #8c8ca0 !important;
  user-select: none !important;
  transition: color 0.2s !important;
}
.kafh-arrow-btn:hover {
  color: #1a1638 !important;
}
/* Responsive adjustments for Tablets/Mobiles */
@media (max-width: 820px) {
  .kafh-split-card {
    width: 95vw !important;
    min-width: 0 !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
  .kafh-left-col, .kafh-right-col {
    width: 100% !important;
  }
  .kafh-left-col {
    padding: 2rem 1.5rem !important;
  }
  .kafh-right-col {
    height: 220px !important;
  }
  .kafh-play-badge {
    top: 0 !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
}