@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body.kbl-login {
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #070c16;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  background-position: center top;
  color: #f8fafc;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

/* Subtle ambient glows */
.kbl-login::before {
  content: '';
  position: fixed;
  top: 10%;
  left: 5%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(0, 229, 153, 0.05) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.kbl-login::after {
  content: '';
  position: fixed;
  top: 15%;
  right: 10%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(0, 229, 153, 0.06) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.kbl-login__shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   TOP ACTIONS (THEME SWITCHER)
   ========================================================================== */
.kbl-top-actions {
  position: absolute;
  top: 22px;
  right: 36px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kbl-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 21, 35, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  font-family: inherit;
}

.kbl-theme-toggle:hover {
  background: rgba(18, 28, 45, 0.95);
  border-color: rgba(0, 229, 153, 0.45);
  color: #00e599;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.kbl-theme-toggle:active {
  transform: translateY(0);
}

.kbl-theme-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.kbl-theme-icon--sun {
  display: block;
  color: #fbbf24;
}

.kbl-theme-icon--moon {
  display: none;
  color: #6366f1;
}

.kbl-theme-toggle__label {
  letter-spacing: 0.01em;
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */
.kbl-topbar {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 36px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kbl-topbar__gateway {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(13, 21, 35, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 4px 16px 4px 5px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.kbl-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 229, 153, 0.12);
  border: 1px solid rgba(0, 229, 153, 0.3);
  color: #00e599;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.kbl-live-dot {
  width: 7px;
  height: 7px;
  background: #00e599;
  border-radius: 50%;
  box-shadow: 0 0 8px #00e599;
  animation: kblPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes kblPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

.kbl-gateway-text {
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 500;
}

.kbl-topbar__status {
  display: flex;
  align-items: center;
  gap: 28px;
}

.kbl-status-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #94a3b8;
}

.kbl-status-item svg {
  flex-shrink: 0;
}

.kbl-status-item strong {
  color: #f1f5f9;
  font-weight: 700;
}

/* ==========================================================================
   MAIN CONTAINER (2 COLUMNS)
   ========================================================================== */
.kbl-main-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 36px 18px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ==========================================================================
   LEFT COLUMN (HERO & FEATURE CARDS)
   ========================================================================== */
.kbl-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kbl-hero-top-row {
  display: block;
}

.kbl-company-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(13, 21, 35, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9999px;
  padding: 4px 14px 4px 5px;
  margin-bottom: 20px;
  width: fit-content;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.kbl-company-pill__icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
  flex-shrink: 0;
}

.kbl-company-pill__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.kbl-company-pill__name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f8fafc;
  white-space: nowrap;
}

.kbl-company-pill__divider {
  color: #475569;
  font-size: 11px;
  flex-shrink: 0;
}

.kbl-company-pill__role {
  font-size: 11.5px;
  color: #00e599;
  font-weight: 500;
  white-space: nowrap;
}

.kbl-hero__dynamic {
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.kbl-hero__title {
  font-size: clamp(2.3rem, 3.8vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: #ffffff;
  margin-bottom: 16px;
}

.kbl-highlight-green {
  color: #00e599;
  display: inline-block;
}

.kbl-hero__desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 530px;
  margin-bottom: 24px;
}

/* Feature Cards */
.kbl-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 630px;
}

.kbl-feature-card {
  background: rgba(12, 19, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 15px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kbl-feature-card:hover {
  border-color: rgba(0, 229, 153, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.kbl-feature-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(0, 229, 153, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: #00e599;
}

.kbl-feature-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 5px;
  line-height: 1.3;
}

.kbl-feature-card__desc {
  font-size: 11px;
  line-height: 1.45;
  color: #8b9cb3;
}

/* ==========================================================================
   RIGHT COLUMN (LOGIN FORM CARD)
   ========================================================================== */
.kbl-login-card-wrapper {
  display: flex;
  justify-content: flex-end;
}

.kbl-login-card {
  width: 100%;
  max-width: 450px;
  background: #0d1522;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 26px 28px 22px;
  position: relative;
  overflow: visible;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.65), 0 0 35px rgba(0, 229, 153, 0.05);
}

/* Top glowing green edge matching mock up */
.kbl-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #00e599;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 0 16px #00e599, 0 0 30px rgba(0, 229, 153, 0.5);
}

/* White logo badge container */
.kbl-card-logo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.kbl-card-logo-badge {
  background: #ffffff;
  border-radius: 14px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 88px;
  max-width: 124px;
  height: 60px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kbl-card-logo-badge img {
  max-height: 44px;
  max-width: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease;
}

/* Card Titles */
.kbl-card-header {
  text-align: center;
  margin-bottom: 18px;
}

.kbl-card-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}

.kbl-card-subtitle {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.45;
}

/* Alerts / Warnings */
.kbl-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Layout */
.kbl-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.kbl-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kbl-form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kbl-form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #cbd5e1;
}

.kbl-entity-badge {
  background: rgba(6, 78, 59, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.kbl-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #080f1a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  height: 46px;
  padding: 0 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kbl-input-wrapper:focus-within {
  border-color: #00e599;
  box-shadow: 0 0 0 2px rgba(0, 229, 153, 0.2);
}

.kbl-input-wrapper.is-invalid {
  border-color: #ef4444;
}

.kbl-input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
  width: 20px;
}

.kbl-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  padding: 0 10px;
  width: 100%;
}

.kbl-input::placeholder {
  color: #475569;
  font-size: 13px;
}

.kbl-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
}

.kbl-select option {
  background-color: #0d1522;
  color: #ffffff;
  padding: 10px;
}

.kbl-select-chevron {
  position: absolute;
  right: 12px;
  pointer-events: none;
  color: #64748b;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   CUSTOM ENTITY DROPDOWN
   ========================================================================== */
.kbl-custom-select-group {
  position: relative;
}

.kbl-custom-select-wrapper {
  position: relative;
  width: 100%;
}

/* Hidden native select for form submit, validation & test compatibility */
.kbl-native-select-hidden {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  pointer-events: none !important;
}

/* Custom select trigger */
.kbl-custom-select-trigger {
  width: 100%;
  height: 46px;
  background: #080f1a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  user-select: none;
}

.kbl-custom-select-trigger:hover {
  border-color: rgba(0, 229, 153, 0.5);
  background: #0a1322;
}

.kbl-custom-select-trigger:focus,
.kbl-custom-select-wrapper.is-open .kbl-custom-select-trigger {
  border-color: #00e599;
  box-shadow: 0 0 0 2px rgba(0, 229, 153, 0.2);
  outline: none;
}

.kbl-custom-select-trigger.is-invalid {
  border-color: #ef4444;
}

.kbl-custom-select-label {
  flex: 1;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kbl-custom-select-chevron {
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.kbl-custom-select-wrapper.is-open .kbl-custom-select-chevron {
  transform: rotate(180deg);
  color: #00e599;
}

/* Custom Dropdown Menu Panel */
.kbl-custom-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0d1522;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 229, 153, 0.08);
  z-index: 999;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.kbl-custom-dropdown.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.kbl-dropdown-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 8px 10px 6px;
}

.kbl-dropdown-list {
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.kbl-dropdown-list::-webkit-scrollbar {
  width: 5px;
}
.kbl-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}
.kbl-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

.kbl-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #cbd5e1;
  text-decoration: none;
  user-select: none;
}

.kbl-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.kbl-dropdown-item.is-selected {
  background: rgba(0, 229, 153, 0.12);
  color: #00e599;
  font-weight: 600;
}

.kbl-dropdown-item__name {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.4;
}

.kbl-dropdown-item__name--hr {
  font-weight: 700;
  color: #00e599;
}

.kbl-dropdown-item__check {
  color: #00e599;
  display: none;
  flex-shrink: 0;
}

.kbl-dropdown-item.is-selected .kbl-dropdown-item__check {
  display: flex;
}

/* Divider */
.kbl-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 4px;
}

/* Dedicated HR KBL-CORE Portal Link Item */
.kbl-dropdown-item--hr {
  background: linear-gradient(135deg, rgba(0, 229, 153, 0.06) 0%, rgba(6, 182, 212, 0.06) 100%);
  border: 1px solid rgba(0, 229, 153, 0.2);
  margin-top: 4px;
  padding: 10px 14px;
}

.kbl-dropdown-item--hr:hover {
  background: linear-gradient(135deg, rgba(0, 229, 153, 0.14) 0%, rgba(6, 182, 212, 0.14) 100%);
  border-color: rgba(0, 229, 153, 0.45);
  transform: translateY(-1px);
}

.kbl-dropdown-item__hr-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(0, 229, 153, 0.15);
  color: #00e599;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kbl-dropdown-item__hr-arrow {
  color: #00e599;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kbl-icon-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}

.kbl-icon-btn:hover {
  color: #cbd5e1;
}

.kbl-form-error {
  color: #f87171;
  font-size: 11.5px;
  line-height: 1.35;
  margin-top: 2px;
}

/* Remember Session Checkbox */
.kbl-remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -2px;
}

.kbl-checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: #94a3b8;
}

.kbl-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #080f1a;
  border: 1px solid #334155;
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kbl-checkbox:checked {
  background: #00e599;
  border-color: #00e599;
}

.kbl-checkbox:checked::before {
  content: "";
  width: 8px;
  height: 8px;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background-color: #042617;
}

/* Submit Button */
.kbl-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: none;
  background: #00e599;
  color: #042617;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 229, 153, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  margin-top: 4px;
}

.kbl-submit-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 24px rgba(0, 229, 153, 0.55);
  transform: translateY(-1px);
}

.kbl-submit-btn:active {
  transform: translateY(0);
}

.kbl-submit-btn svg {
  transition: transform 0.15s ease;
}

.kbl-submit-btn:hover svg {
  transform: translateX(3px);
}

/* Card Footer Metadata (Version Badge) */
.kbl-card-footer {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.kbl-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 4px 12px;
  user-select: none;
  transition: all 0.2s ease;
}

.kbl-version-badge:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}

.kbl-version-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  text-transform: uppercase;
}

.kbl-version-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  line-height: 1.25;
}

/* ==========================================================================
   PAGE FOOTER
   ========================================================================== */
.kbl-page-footer {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 36px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.kbl-page-footer__links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kbl-page-footer__link {
  color: #475569;
  text-decoration: none;
  transition: color 0.2s;
}

.kbl-page-footer__link:hover {
  color: #94a3b8;
}

/* Mobile specific elements hidden on desktop */
.kbl-mobile-logo-badge,
.kbl-mobile-chips,
.kbl-mobile-footer {
  display: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN (DESKTOP MEDIUM & TABLET LANDSCAPE)
   ========================================================================== */
@media (max-width: 1180px) and (min-width: 901px) {
  .kbl-main-container {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 32px;
    padding: 20px 24px 16px;
  }

  .kbl-hero__title {
    font-size: 2.2rem;
  }

  .kbl-features {
    gap: 10px;
  }

  .kbl-feature-card {
    padding: 12px 10px;
  }
}

/* ==========================================================================
   DESKTOP FIXED VIEWPORT (LOCKED: NO SCROLL DOWN/UP/LEFT/RIGHT, NO RUBBER-BAND)
   ========================================================================== */
@media (min-width: 901px) and (min-height: 641px) {
  html {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.kbl-login {
    height: 100vh;
    max-height: 100vh;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .kbl-login__shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .kbl-main-container {
    overflow: hidden;
  }
}

/* ==========================================================================
   MOBILE VIEWPORT (MATCHES MOBILE MOCK-UP EXACTLY, SMOOTH VERTICAL SCROLL)
   ========================================================================== */
@media (max-width: 900px) {
  html {
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.kbl-login {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    background-size: 28px 28px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .kbl-login__shell {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    justify-content: flex-start;
    overflow-y: visible !important;
    overflow-x: hidden !important;
  }

  .kbl-main-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 16px 28px;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    flex: initial;
    min-height: auto;
  }

  /* Mobile Top Row: Tagline Pill & Theme Toggle Side-by-Side */
  .kbl-hero-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    margin: 0 0 14px 0;
    box-sizing: border-box;
  }

  /* Mobile Theme Switcher */
  .kbl-top-actions {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .kbl-theme-toggle {
    padding: 0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .kbl-theme-toggle__label {
    display: none !important;
  }

  /* Hide Desktop specific elements on mobile */
  .kbl-features,
  .kbl-card-logo-wrapper,
  .kbl-card-footer,
  .kbl-page-footer,
  .kbl-label-extra,
  .kbl-subtitle-extra {
    display: none !important;
  }

  /* 1. Mobile Company Pill Tag (Fits cleanly with theme toggle button) */
  #heroCompanyPill {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 3px 8px 3px 3px;
    margin: 0 !important;
    min-width: 0;
    flex: 1 1 auto;
    max-width: calc(100% - 44px);
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    overflow: hidden;
  }

  #heroCompanyPill .kbl-company-pill__icon {
    width: 22px;
    height: 22px;
    padding: 2px;
    flex-shrink: 0;
  }

  #heroCompanyPill .kbl-company-pill__name {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  #heroCompanyPill .kbl-company-pill__divider {
    font-size: 9px;
    margin: 0 1px;
    flex-shrink: 0;
  }

  #heroCompanyPill .kbl-company-pill__role {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap !important;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 2. Mobile Logo Badge */
  .kbl-mobile-logo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 153, 0.1);
    margin: 12px auto 14px;
    padding: 10px;
  }

  .kbl-mobile-logo-badge img {
    max-height: 58px;
    max-width: 68px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.25s ease;
  }

  /* 3. Mobile Hero Typography */
  .kbl-hero {
    text-align: center;
    align-items: center;
    width: 100%;
  }

  .kbl-hero__title {
    font-size: 1.55rem;
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .kbl-hero__title br {
    display: none;
  }

  .kbl-hero__desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: #94a3b8;
    max-width: 330px;
    margin: 0 auto 14px;
  }

  /* 4. Mobile Pill Chips */
  .kbl-mobile-chips {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0 auto 18px;
  }

  .kbl-mobile-chips__row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .kbl-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 9999px;
    background: rgba(18, 28, 45, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
  }

  .kbl-chip--highlight {
    background: rgba(6, 78, 59, 0.65);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-weight: 600;
  }

  /* 5. Mobile Login Card */
  .kbl-login-card-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .kbl-login-card {
    padding: 22px 18px 20px;
    border-radius: 18px;
    width: 100%;
    max-width: 100%;
  }

  .kbl-card-header {
    margin-bottom: 16px;
  }

  .kbl-card-title {
    font-size: 19.5px;
  }

  .kbl-card-subtitle {
    font-size: 12px;
  }

  .kbl-form {
    gap: 15px;
  }

  .kbl-input-wrapper {
    height: 44px;
  }

  .kbl-input {
    font-size: 13px;
  }

  .kbl-submit-btn {
    height: 44px;
    font-size: 13.5px;
    border-radius: 9px;
  }

  /* 6. Mobile Footer Below Card */
  .kbl-mobile-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 32px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    font-size: 11.5px;
    color: #64748b;
  }

  .kbl-mobile-copyright {
    margin: 0;
    font-size: 11.5px;
    color: #64748b;
  }
}

/* ==========================================================================
   LIGHT MODE DESIGN
   ========================================================================== */
html[data-theme="light"],
body.kbl-login[data-theme="light"] {
  background-color: #f8fafc;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  color: #0f172a;
}

body.kbl-login[data-theme="light"]::before {
  background: radial-gradient(circle, rgba(0, 229, 153, 0.12) 0%, transparent 68%);
}

body.kbl-login[data-theme="light"]::after {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 68%);
}

/* Light Mode Toggle Button */
body.kbl-login[data-theme="light"] .kbl-theme-toggle {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

body.kbl-login[data-theme="light"] .kbl-theme-toggle:hover {
  background: #f1f5f9;
  border-color: #059669;
  color: #059669;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

body.kbl-login[data-theme="light"] .kbl-theme-icon--sun {
  display: none;
}

body.kbl-login[data-theme="light"] .kbl-theme-icon--moon {
  display: block;
  color: #4f46e5;
}

/* Light Mode Company Pill */
html[data-theme="light"] .kbl-company-pill,
html[data-theme="light"] #heroCompanyPill,
body.kbl-login[data-theme="light"] .kbl-company-pill,
body.kbl-login[data-theme="light"] #heroCompanyPill {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .kbl-company-pill__icon,
body.kbl-login[data-theme="light"] .kbl-company-pill__icon {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .kbl-company-pill__name,
body.kbl-login[data-theme="light"] .kbl-company-pill__name {
  color: #0f172a !important;
}

html[data-theme="light"] .kbl-company-pill__divider,
body.kbl-login[data-theme="light"] .kbl-company-pill__divider {
  color: #94a3b8 !important;
}

html[data-theme="light"] .kbl-company-pill__role,
body.kbl-login[data-theme="light"] .kbl-company-pill__role {
  color: #059669 !important;
}

/* Light Mode Hero */
body.kbl-login[data-theme="light"] .kbl-hero__title {
  color: #0f172a;
}

body.kbl-login[data-theme="light"] .kbl-highlight-green {
  color: #059669;
}

body.kbl-login[data-theme="light"] .kbl-hero__desc {
  color: #475569;
}

/* Light Mode Feature Cards */
body.kbl-login[data-theme="light"] .kbl-feature-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

body.kbl-login[data-theme="light"] .kbl-feature-card:hover {
  border-color: rgba(5, 150, 105, 0.4);
  box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.08);
}

body.kbl-login[data-theme="light"] .kbl-feature-card__icon {
  background: rgba(5, 150, 105, 0.08);
  color: #059669;
}

body.kbl-login[data-theme="light"] .kbl-feature-card__title {
  color: #0f172a;
}

body.kbl-login[data-theme="light"] .kbl-feature-card__desc {
  color: #64748b;
}

/* Light Mode Login Card */
body.kbl-login[data-theme="light"] .kbl-login-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.08), 0 0 25px rgba(5, 150, 105, 0.05);
}

body.kbl-login[data-theme="light"] .kbl-login-card::before {
  background: #00e599;
  box-shadow: 0 0 16px #00e599, 0 0 20px rgba(0, 229, 153, 0.3);
}

body.kbl-login[data-theme="light"] .kbl-card-logo-badge {
  background: #ffffff;
  border: 1px solid #edf2f7;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

body.kbl-login[data-theme="light"] .kbl-card-logo-badge img,
body.kbl-login[data-theme="light"] .kbl-mobile-logo-badge img {
  mix-blend-mode: multiply;
  background-color: transparent;
}

body.kbl-login[data-theme="light"] .kbl-card-title {
  color: #0f172a;
}

body.kbl-login[data-theme="light"] .kbl-card-subtitle {
  color: #64748b;
}

body.kbl-login[data-theme="light"] .kbl-form-label {
  color: #334155;
}

body.kbl-login[data-theme="light"] .kbl-entity-badge {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

body.kbl-login[data-theme="light"] .kbl-input-wrapper {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.kbl-login[data-theme="light"] .kbl-input-wrapper:focus-within {
  background: #ffffff;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

body.kbl-login[data-theme="light"] .kbl-input {
  color: #0f172a;
}

body.kbl-login[data-theme="light"] .kbl-input::placeholder {
  color: #94a3b8;
}

body.kbl-login[data-theme="light"] .kbl-input-icon {
  color: #94a3b8;
}

body.kbl-login[data-theme="light"] .kbl-select-chevron {
  color: #94a3b8;
}

body.kbl-login[data-theme="light"] .kbl-select option {
  background: #ffffff;
  color: #0f172a;
}

/* Custom Select in Light Theme */
body.kbl-login[data-theme="light"] .kbl-custom-select-trigger {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.kbl-login[data-theme="light"] .kbl-custom-select-trigger:hover {
  background: #ffffff;
  border-color: #059669;
}

body.kbl-login[data-theme="light"] .kbl-custom-select-trigger:focus,
body.kbl-login[data-theme="light"] .kbl-custom-select-wrapper.is-open .kbl-custom-select-trigger {
  background: #ffffff;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

body.kbl-login[data-theme="light"] .kbl-custom-select-label {
  color: #0f172a;
}

body.kbl-login[data-theme="light"] .kbl-custom-select-chevron {
  color: #94a3b8;
}

body.kbl-login[data-theme="light"] .kbl-custom-select-wrapper.is-open .kbl-custom-select-chevron {
  color: #059669;
}

body.kbl-login[data-theme="light"] .kbl-custom-dropdown {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.15), 0 4px 14px rgba(15, 23, 42, 0.05);
}

body.kbl-login[data-theme="light"] .kbl-dropdown-header {
  color: #64748b;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item {
  color: #334155;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item.is-selected {
  background: #ecfdf5;
  color: #047857;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item__check {
  color: #059669;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item__name--hr {
  color: #047857;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-divider {
  background: #e2e8f0;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item--hr {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border-color: #a7f3d0;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item--hr:hover {
  background: linear-gradient(135deg, #dcfce7 0%, #cffafe 100%);
  border-color: #34d399;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item__hr-icon {
  background: #d1fae5;
  color: #047857;
}

body.kbl-login[data-theme="light"] .kbl-dropdown-item__hr-arrow {
  color: #047857;
}

body.kbl-login[data-theme="light"] .kbl-icon-btn {
  color: #94a3b8;
}

body.kbl-login[data-theme="light"] .kbl-icon-btn:hover {
  color: #0f172a;
}

body.kbl-login[data-theme="light"] .kbl-checkbox-label {
  color: #475569;
}

body.kbl-login[data-theme="light"] .kbl-checkbox {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.kbl-login[data-theme="light"] .kbl-checkbox:checked {
  background-color: #059669;
  border-color: #059669;
}

body.kbl-login[data-theme="light"] .kbl-card-footer {
  color: #64748b;
}

body.kbl-login[data-theme="light"] .kbl-version-badge {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

body.kbl-login[data-theme="light"] .kbl-version-badge:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

body.kbl-login[data-theme="light"] .kbl-version-name {
  color: #64748b;
}

body.kbl-login[data-theme="light"] .kbl-version-pill {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

body.kbl-login[data-theme="light"] .kbl-page-footer {
  border-top-color: #e2e8f0;
  color: #64748b;
}

body.kbl-login[data-theme="light"] .kbl-page-footer__link {
  color: #64748b;
}

body.kbl-login[data-theme="light"] .kbl-page-footer__link:hover {
  color: #0f172a;
}

/* Light Mode Mobile Elements */
body.kbl-login[data-theme="light"] .kbl-mobile-logo-badge {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.kbl-login[data-theme="light"] .kbl-chip {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

body.kbl-login[data-theme="light"] .kbl-chip--highlight {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

body.kbl-login[data-theme="light"] .kbl-mobile-footer {
  color: #64748b;
}
