/* BusinessAI Custom Branding — Full-Page 50/50 Split Login (Light & Dark Mode) */

@media (min-width: 901px) {
  body:has(form input[type="password"]) {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  /* Left 50% full-height executive hero panel + BIG bold headline */
  body:has(form input[type="password"])::before {
    content: "BUSINESSAI\A AI Built for\A Small Business." !important;
    white-space: pre-line !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 50vw !important;
    height: 100vh !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 0 4.5rem 7.5rem 4.5rem !important;
    box-sizing: border-box !important;
    background:
      linear-gradient(160deg, rgba(15, 23, 42, 0.3) 0%, rgba(7, 11, 20, 0.94) 100%),
      url("./login-bg.svg") center / cover no-repeat !important;
    color: #ffffff !important;
    font-size: clamp(2.4rem, 3.6vw, 3.5rem) !important;
    line-height: 1.12 !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    border-right: 1px solid rgba(148, 163, 184, 0.14) !important;
  }

  body:has(form input[type="password"])::before::first-line {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.16em !important;
    color: #38bdf8 !important;
    line-height: 3 !important;
  }

  /* Left 50% crisp subtitle right below the headline */
  body:has(form input[type="password"])::after {
    content: "Draft emails, build SOPs, plan marketing, and make faster decisions — all in one private workspace." !important;
    position: fixed !important;
    top: calc(50% + 2.25rem) !important;
    left: 0 !important;
    width: 50vw !important;
    z-index: 11 !important;
    padding: 0 4.5rem !important;
    box-sizing: border-box !important;
    color: #cbd5e1 !important;
    font-size: 1.15rem !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
    pointer-events: none !important;
  }

  /* Right 50% full-height login panel */
  body:has(form input[type="password"]) #root {
    margin-left: 50vw !important;
    width: 50vw !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

/* Mobile: single column */
@media (max-width: 900px) {
  body:has(form input[type="password"]) #root {
    min-height: 100vh !important;
  }
}

/* =========================================================
   LIGHT MODE (default)
   ========================================================= */
html:not(.dark) body:has(form input[type="password"]),
html:not(.dark) body:has(form input[type="password"]) #root {
  background: #ffffff !important;
}

html:not(.dark) body:has(form input[type="password"]) #root h1,
html:not(.dark) body:has(form input[type="password"]) #root h2,
html:not(.dark) body:has(form input[type="password"]) #root p,
html:not(.dark) body:has(form input[type="password"]) #root span {
  color: #0f172a !important;
}

html:not(.dark) body:has(form input[type="password"]) #root label {
  background: transparent !important;
  background-color: transparent !important;
  color: #475569 !important;
}

html:not(.dark) body:has(form input[type="password"]) #root a {
  color: #2563eb !important;
  font-weight: 500 !important;
}

html:not(.dark) body:has(form input[type="password"]) #root input[type="email"],
html:not(.dark) body:has(form input[type="password"]) #root input[type="text"],
html:not(.dark) body:has(form input[type="password"]) #root input[type="password"] {
  color-scheme: light !important;
  background-color: #f8fafc !important;
  background: #f8fafc !important;
  -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
  box-shadow: 0 0 0 1000px #f8fafc inset !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html:not(.dark) body:has(form input[type="password"]) #root input:focus {
  background-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
  box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
  border-color: #2563eb !important;
}

html:not(.dark) body:has(form input[type="password"]) #root button:not([type="submit"]) svg {
  color: #475569 !important;
}

/* =========================================================
   DARK MODE (html.dark)
   ========================================================= */
html.dark body:has(form input[type="password"]),
html.dark body:has(form input[type="password"]) #root {
  background: #0b1120 !important;
}

html.dark body:has(form input[type="password"]) #root h1,
html.dark body:has(form input[type="password"]) #root h2,
html.dark body:has(form input[type="password"]) #root p,
html.dark body:has(form input[type="password"]) #root span {
  color: #f8fafc !important;
}

html.dark body:has(form input[type="password"]) #root label {
  background: transparent !important;
  background-color: transparent !important;
  color: #94a3b8 !important;
}

html.dark body:has(form input[type="password"]) #root a {
  color: #38bdf8 !important;
  font-weight: 500 !important;
}

html.dark body:has(form input[type="password"]) #root input[type="email"],
html.dark body:has(form input[type="password"]) #root input[type="text"],
html.dark body:has(form input[type="password"]) #root input[type="password"] {
  color-scheme: dark !important;
  background-color: #111827 !important;
  background: #111827 !important;
  -webkit-box-shadow: 0 0 0 1000px #111827 inset !important;
  box-shadow: 0 0 0 1000px #111827 inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
}

html.dark body:has(form input[type="password"]) #root input:focus {
  background-color: #0f172a !important;
  -webkit-box-shadow: 0 0 0 1000px #0f172a inset, 0 0 0 3px rgba(56, 189, 248, 0.22) !important;
  box-shadow: 0 0 0 1000px #0f172a inset, 0 0 0 3px rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
}

html.dark body:has(form input[type="password"]) #root button:not([type="submit"]) svg {
  color: #94a3b8 !important;
}

/* =========================================================
   SHARED FORM & LOGO POLISH
   ========================================================= */
body:has(form input[type="password"]) #root > div,
body:has(form input[type="password"]) main,
body:has(form input[type="password"]) #root div:has(> form input[type="password"]) {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

body:has(form input[type="password"]) #root div:has(> form input[type="password"]) {
  max-width: 440px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Larger, clearer heading & inputs */
body:has(form input[type="password"]) #root h1 {
  font-size: 2rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 1.5rem !important;
}

body:has(form input[type="password"]) #root input[type="email"],
body:has(form input[type="password"]) #root input[type="text"],
body:has(form input[type="password"]) #root input[type="password"] {
  border-radius: 10px !important;
  min-height: 48px !important;
  font-size: 1rem !important;
}

/* Center top logo inside the right 50% panel */
body:has(form input[type="password"]) #root > div > div:first-child:has(img[src*="logo"]),
body:has(form input[type="password"]) #root div:has(> img[src*="logo"]) {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
}

body:has(form input[type="password"]) #root img[src*="logo"] {
  width: 56px !important;
  height: 56px !important;
  margin: 0 auto !important;
}

/* Primary submit button */
body:has(form input[type="password"]) #root button[type="submit"] {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  min-height: 48px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  transition: transform 0.15s ease, filter 0.15s ease !important;
}

body:has(form input[type="password"]) #root button[type="submit"] span {
  color: #ffffff !important;
}

body:has(form input[type="password"]) #root button[type="submit"]:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-1px) !important;
}
