/* ==================================================
   sun_staff/assets/css/portal.css
   Staff portal — Blue/Navy theme matching login page
   ================================================== */

:root {
  /* ── Sidebar — matches login left panel gradient ── */
  --sidebar-bg-rk: #0f2044;
  /* dark navy — same as login panel dark start */
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-color: #c8d8ee;
  /* cool blue-white — readable on dark navy */
  --sidebar-muted-color: #7a9bbf;
  /* muted blue-grey for headings/dots */
  --sidebar-hover-bg: rgba(26, 115, 232, 0.15);
  /* subtle blue hover */
  --sidebar-active-bg: rgba(74, 158, 218, 0.20);
  /* highlight tinted active */
  --sidebar-active-color: #4a9eda;
  /* bright sky blue — matches login accent */

  /* ── Accent & buttons ── */
  --portal-accent: #1a73e8;
  --captcha-color-a: #1557b0;
  --captcha-color-b: #1a73e8;

  /* ── Legacy vars (kept for backward compat) ── */
  --portal-sidebar-bg: #0f2044;
  --portal-sidebar-text: #c8d8ee;
  --portal-sidebar-active: #4a9eda;
}

/* Login page brand panel */
.auth-split-brand {
  background: linear-gradient(150deg, #0f2044 0%, #1a73e8 60%, #4a9eda 100%);
}

.auth-split-form {
  background: #f5f8ff;
}

.btn-primary {
  background: linear-gradient(135deg, #1557b0, #1a73e8);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f4592, #1557b0);
}

/* Active nav icon tint — blue instead of purple */
.sidebar .nav-item>.nav-link.active .nav-icon {
  background: rgba(74, 158, 218, 0.18);
}

/* Sidebar logo icon background */
.sidebar-logo-icon {
  background: rgba(74, 158, 218, 0.18);
}

/* Active left-edge accent bar color */
.sidebar .nav-item>.nav-link.active::before {
  background: #4a9eda;
}


/* ── Sidebar logo — full vs collapsed ───────────────────────────────────────
   .logo-full      : full wide logo — visible when expanded, hidden when collapsed
   .logo-collapsed : small square icon — hidden when expanded, visible when collapsed
   ─────────────────────────────────────────────────────────────────────────── */

/* Reset the default sidebar-logo-icon wrapper (not used with image logo) */
.sidebar-logo-icon {
  display: none !important;
}

/* Full logo sizing */
.sidebar-logo .logo-full {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

/* Collapsed icon sizing */
.sidebar-logo .logo-collapsed {
  height: 42px;
  width: 42px;
  object-fit: contain;
  display: none;
  /* hidden by default (expanded state) */
  transition: opacity 0.2s ease;
}

/* When sidebar IS collapsed — hide full logo, show icon only */
.sidebar-collapsed .sidebar-logo .logo-full {
  display: none;
}

.sidebar-collapsed .sidebar-logo .logo-collapsed {
  display: block;
}

/* Centre the icon in collapsed state */
.sidebar-collapsed .sidebar-logo {
  justify-content: center;
  width: 100%;
}


/* ── Sidebar footer — force contrast text on dark background ────────────────
   The footer uses Bootstrap .small / .fw-500 / .text-muted classes which
   don't inherit the dark sidebar palette. Override them explicitly.          */

.sidebar-footer .fw-500 {
  color: #e8f0fe !important;
  /* bright blue-white — readable on #0f2044 */
}

.sidebar-footer .text-muted {
  color: #7a9bbf !important;
  /* muted blue-grey — matches --sidebar-muted-color */
}

.sidebar-footer a.text-muted {
  color: #7a9bbf !important;
  transition: color 0.15s;
}

.sidebar-footer a.text-muted:hover {
  color: #4a9eda !important;
  /* active blue on hover */
}


/* ── Collapsed sidebar scrolling fix ────────────────────────────────────────
   The sidebar uses flex column layout — .sidebar-nav has flex:1 so it already
   fills exactly the space between header and footer. The only problem is
   main.css sets overflow:visible on .sidebar-nav when collapsed, which kills
   scrolling. Simply restore overflow-y:auto — no max-height needed.
   .sidebar keeps overflow:visible so flyout submenus can escape the box.    */

.sidebar-collapsed .sidebar-nav {
  overflow-y: auto !important;
  overflow-x: visible !important;
  /* must be visible so flyout submenus escape horizontally */
}

/* Flyout submenu background must match sidebar theme */
/* Flyout: CSS :hover + JS .flyout-open class for bridge */
.sidebar-collapsed .sidebar .nav-item.has-submenu:hover>.nav-submenu,
.sidebar-collapsed .sidebar .nav-item.has-submenu.flyout-open>.nav-submenu {
  display: block !important;
  background: var(--sidebar-bg-rk) !important;
  border-color: var(--sidebar-border) !important;
}


/* ==================================================
   Auth split-panel layout (shared across all portals)
   ================================================== */

html,
body {
  height: 100%;
  margin: 0;
}

.auth-split {
  display: flex;
  min-height: 100vh;
}

.auth-split-brand {
  flex: 0 0 44%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.auth-split-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.auth-split-brand-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 360px;
}

.logo-wipe {
  overflow: hidden;
  display: inline-block;
  margin-bottom: 28px;
}

.auth-brand-logo img.logo-slide {
  height: 40px;
  width: auto;
  filter: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
  transform: translateX(-120px);
  animation: logoSlideIn 0.6s ease-out 0.2s forwards;
}

@keyframes logoSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-120px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-brand-text {
  margin-bottom: 32px;
}

.auth-brand-heading {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.auth-brand-desc {
  font-size: 13.5px;
  opacity: .82;
  line-height: 1.65;
  margin: 0;
}

.auth-brand-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  opacity: .92;
}

.auth-brand-feature i {
  font-size: 17px;
  background: rgba(255, 255, 255, .15);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-split-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, .08);
}

.auth-card-header {
  margin-bottom: 24px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: #8898aa;
  margin: 0;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.auth-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  color: #6b7280;
}

.auth-tab.active {
  background: var(--portal-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.auth-tab:not(.active):hover {
  color: var(--portal-accent);
}

.forgot-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--portal-accent);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.form-control:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
}

.footer-centered {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin-top: 16px;
}

.footer-centered a {
  color: #888;
  text-decoration: none;
}

.footer-centered a:hover {
  color: var(--portal-accent);
}

.footer-copyright,
.credits {
  line-height: 1.8;
}

@media (max-width: 768px) {
  .auth-split {
    flex-direction: column;
  }

  .auth-split-brand {
    flex: none;
    padding: 28px 24px;
    min-height: 200px;
  }

  .auth-brand-desc,
  .auth-brand-features {
    display: none;
  }

  .auth-split-form {
    padding: 28px 20px;
    background: #fff !important;
  }
}

/* Captcha question display box */
.captcha-question-box {
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  font-family: monospace;
  color: #fff;
  background: linear-gradient(135deg, var(--captcha-color-a, #1557b0), var(--captcha-color-b, #1a73e8));
  user-select: none;
  white-space: nowrap;
  min-width: 100px;
  text-align: center;
}

/* Captcha refresh button */
.captcha-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid #dee2e6;
  background: #f8f9fa;
  color: #6c757d;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.captcha-refresh-btn:hover {
  border-color: var(--portal-accent);
  color: var(--portal-accent);
  background: color-mix(in srgb, var(--portal-accent) 8%, white);
}

/* Spin animation for refresh icon */
.spin {
  animation: spinOnce .4s linear;
}

@keyframes spinOnce {
  to {
    transform: rotate(360deg);
  }
}