/* Novalieri Group identity for the existing Frappe login and CRM SPA. */

/* Frappe login: preserve the current route and form while adding the dark logo backing. */
body[data-path='login'] {
  background-color: #050505 !important;
  color: #e0e0e0;
}

body[data-path='login'] .for-login .page-card-head {
  box-sizing: border-box;
  width: calc(100% - 24px);
  max-width: 400px;
  margin-bottom: 0;
  margin-left: auto;
  margin-right: auto;
  padding: 22px 24px 16px;
  border: 1px solid #303030;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #050505;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body[data-path='login'] .for-login .page-card-head h4 {
  margin: 12px 0 0;
  color: #e0e0e0;
}

body[data-path='login'] .for-login .page-card-head .app-logo {
  display: block;
  width: min(176px, 100%);
  height: 34px;
  max-height: 34px;
  object-fit: contain;
}

body[data-path='login'] .for-login .login-content.page-card {
  box-sizing: border-box;
  width: calc(100% - 24px);
  max-width: 400px;
  margin-top: 0;
  border: 1px solid #303030;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #111111;
  color: #e0e0e0;
  box-shadow: 0 20px 56px rgb(0 0 0 / 28%);
}

body[data-path='login'] .navbar.navbar-light {
  border-bottom: 1px solid #303030;
  background-color: #050505;
}

body[data-path='login'] .navbar.navbar-light .navbar-brand,
body[data-path='login'] .navbar.navbar-light .navbar-nav .nav-link {
  color: #e0e0e0;
}

body[data-path='login'] .navbar.navbar-light .navbar-toggler {
  border-color: #4a4a4a;
  color: #e0e0e0;
}

body[data-path='login'] .for-login .btn-login-option.btn-login-with-email-link {
  border: 1px solid #484848;
  background-color: #222222;
  color: #e0e0e0;
}

body[data-path='login'] .for-login .btn-login-option.btn-login-with-email-link:hover {
  background-color: #303030;
  color: #ffffff;
}

body[data-path='login'] .for-login .forgot-password-message a,
body[data-path='login'] .for-login .sign-up-message a {
  color: #8eafff;
}

body[data-path='login'] .for-login .btn-login {
  border-color: #3b62ac !important;
  background-color: #3b62ac !important;
  color: #ffffff !important;
}

body[data-path='login'] .for-login .btn-login:hover {
  border-color: #315493 !important;
  background-color: #315493 !important;
}

body[data-path='login'] .for-login .btn-login:focus-visible,
body[data-path='login'] .for-login input:focus-visible {
  outline: 2px solid #4a76cf;
  outline-offset: 2px;
}

/* The same UserDropdown/BrandLogo is used in desktop and native mobile navigation. */
body.novalieri-crm-branding img[src$='/files/novalieri-brand-v1/emblem.png'] {
  width: 32px !important;
  height: 32px !important;
  padding: 4px;
  border-radius: 7px;
  background: #3b62ac;
  object-fit: contain !important;
}

/* Brand the active CRM navigation item without changing semantic/status colors. */
body.novalieri-crm-branding [data-slot='sidebar-item'][data-state='active'] {
  background-color: #3b62ac !important;
  color: #ffffff !important;
  box-shadow: inset 3px 0 #4a76cf !important;
}

body.novalieri-crm-branding
  [data-slot='sidebar-item'][data-state='active']
  .text-ink-gray-7,
body.novalieri-crm-branding
  [data-slot='sidebar-item'][data-state='active']
  .text-ink-gray-8 {
  color: #ffffff !important;
}

/* Apply the brand primary to solid action buttons only; neutral secondary and semantic buttons stay native. */
body.novalieri-crm-branding button.bg-surface-blue-6 {
  background-color: #3b62ac !important;
  color: #ffffff !important;
}

body.novalieri-crm-branding button.bg-surface-blue-6:hover {
  background-color: #315493 !important;
}

body.novalieri-crm-branding
  button[class~='bg-surface-gray-10'][class~='text-ink-base'][class~='hover:bg-surface-gray-9'][class~='active:bg-surface-gray-8'] {
  background-color: #3b62ac !important;
  color: #ffffff !important;
}

body.novalieri-crm-branding
  button[class~='bg-surface-gray-10'][class~='text-ink-base'][class~='hover:bg-surface-gray-9'][class~='active:bg-surface-gray-8']:hover:not(:disabled) {
  background-color: #315493 !important;
}

body.novalieri-crm-branding
  button[class~='bg-surface-gray-10'][class~='text-ink-base'][class~='hover:bg-surface-gray-9'][class~='active:bg-surface-gray-8']:active:not(:disabled) {
  background-color: #284477 !important;
}

body.novalieri-crm-branding button:focus-visible,
body.novalieri-crm-branding a:focus-visible {
  outline: 2px solid #4a76cf;
  outline-offset: 2px;
}

/* Keep the framework permission response intact; brand only this CRM login action. */
body[data-path='message']
  a.btn.btn-primary[href^='/login?redirect-to=%2Fcrm'] {
  border-color: #3b62ac !important;
  background-color: #3b62ac !important;
  color: #ffffff !important;
}

body[data-path='message']
  a.btn.btn-primary[href^='/login?redirect-to=%2Fcrm']:hover {
  border-color: #315493 !important;
  background-color: #315493 !important;
}
