/* QH LOGIN FIRST-PAINT GUARD */
/* Hide Frappe's original login form until the branded QH shell is ready. */
body:not(.qh-login-ready) .for-login,
body:not(.qh-login-ready) .for-forgot {
  visibility: hidden !important;
}

/* Reveal the active login/forgot section after qh_login.js finishes. */
body.qh-login-ready .for-login,
body.qh-login-ready .for-forgot {
  visibility: visible !important;
}

body.qh-login-page {
  min-height: 100vh;
  margin: 0 !important;
  overflow-x: hidden;

  color: #102033;

  background:
    radial-gradient(
      circle at 10% 10%,
      rgba(37, 99, 235, 0.08),
      transparent 28%
    ),
    radial-gradient(
      circle at 88% 14%,
      rgba(15, 118, 110, 0.08),
      transparent 24%
    ),
    #f4f7fb;
}

/* Hide original Frappe navigation/footer */
body.qh-login-page .navbar,
body.qh-login-page .web-footer {
  display: none !important;
}

/* Full viewport */
body.qh-login-page .page-content-wrapper,
body.qh-login-page main,
body.qh-login-page main.container,
body.qh-login-page main.container.my-4 {
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh !important;

  margin: 0 !important;
  padding: 0 !important;
}

body.qh-login-page .page_content {
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  margin: 0 !important;
  padding: 42px !important;
}

/* =========================================================
   MAIN SHELL
   ========================================================= */

body.qh-login-page .qh-login-shell {
  width:
    min(
      1180px,
      calc(100vw - 84px)
    ) !important;

  min-height: 700px;

  display: grid;

  grid-template-columns:
    1.18fr 0.82fr;

  margin: 0 auto !important;

  overflow: hidden;

  background: #ffffff;

  border:
    1px solid
    rgba(223, 228, 235, 0.95);

  border-radius: 28px;

  box-shadow:
    0 24px 60px
    rgba(22, 34, 51, 0.12);
}

/* =========================================================
   LEFT SIDE
   ========================================================= */

body.qh-login-page .qh-login-visual {
  position: relative;

  overflow: hidden;

  padding: 46px;

  background:
    linear-gradient(
      145deg,
      rgba(245, 250, 255, 0.96),
      rgba(235, 246, 248, 0.98)
    ),
    #eef7fb;
}

body.qh-login-page
.qh-login-visual::before {
  content: "";

  position: absolute;
  inset: 0;

  pointer-events: none;

  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(37, 99, 235, 0.16),
      transparent 34%
    ),
    radial-gradient(
      circle at 72% 85%,
      rgba(15, 118, 110, 0.18),
      transparent 34%
    );
}

body.qh-login-page
.qh-login-visual > * {
  position: relative;
  z-index: 2;
}

/* Brand */
body.qh-login-page .qh-brand {
  display: flex;
  align-items: center;

  gap: 14px;
}

body.qh-login-page .qh-brand-mark {
  width: 44px;
  height: 44px;

  flex: 0 0 auto;

  display: grid;
  place-items: center;

  border-radius: 12px;

  color: #ffffff;

  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;

  background:
    linear-gradient(
      135deg,
      #0f766e,
      #2563eb
    );

  box-shadow:
    0 10px 24px
    rgba(37, 99, 235, 0.18);
}

body.qh-login-page .qh-brand-name {
  color: #102033;

  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

body.qh-login-page .qh-brand-sub {
  margin-top: 3px;

  color: #7b8798;

  font-size: 11px;
  line-height: 1.4;
}

/* Badge */
body.qh-login-page .qh-hero-badge {
  display: inline-flex;
  align-items: center;

  gap: 8px;

  margin-top: 38px;

  padding: 8px 12px;

  border-radius: 999px;

  color: #0f5f58;

  background:
    rgba(15, 118, 110, 0.09);

  font-size: 12px;
  font-weight: 700;
}

body.qh-login-page
.qh-hero-badge::before {
  content: "";

  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #16a34a;

  box-shadow:
    0 0 0 4px
    rgba(22, 163, 74, 0.12);
}

body.qh-login-page .qh-hero-title {
  max-width: 540px;

  margin:
    18px 0 12px;

  color: #102033;

  font-size: 40px;
  line-height: 1.16;
  font-weight: 700;

  letter-spacing: -0.6px;
}

body.qh-login-page .qh-hero-copy {
  max-width: 500px;

  margin: 0;

  color: #667386;

  font-size: 15px;
  line-height: 1.75;
}

/* =========================================================
   LEFT DECORATION
   ========================================================= */

body.qh-login-page
.qh-visual-stage {
  position: absolute;

  left: 34px;
  right: 24px;
  bottom: 4px;

  height: 306px;
}

body.qh-login-page
.qh-stage-shadow {
  position: absolute;

  left: 30px;
  right: 20px;
  bottom: 12px;

  height: 90px;

  border:
    1px solid
    rgba(169, 207, 217, 0.45);

  border-radius: 50%;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.7),
      rgba(220, 238, 243, 0.88)
    );

  transform:
    perspective(400px)
    rotateX(62deg);
}

/* Floating cards */

body.qh-login-page .qh-stat-card,
body.qh-login-page .qh-mini-card {
  position: absolute;

  z-index: 3;

  border:
    1px solid
    rgba(180, 201, 214, 0.55);

  border-radius: 18px;

  background:
    rgba(255, 255, 255, 0.88);

  box-shadow:
    0 16px 30px
    rgba(40, 84, 107, 0.12);

  backdrop-filter: blur(10px);
}

body.qh-login-page .qh-stat-card {
  top: 8px;
  left: 42px;

  width: 136px;
  height: 72px;

  padding: 14px;
}

body.qh-login-page .qh-mini-card {
  top: 36px;
  right: 48px;

  width: 150px;
  height: 92px;

  padding: 16px;
}

body.qh-login-page .qh-small-label {
  color: #7b8798;

  font-size: 11px;
}

body.qh-login-page .qh-big-value {
  margin-top: 4px;

  color: #102033;

  font-size: 22px;
  font-weight: 700;
}

/* Device */

body.qh-login-page .qh-device-wrap {
  position: absolute;

  left: 0;
  right: 0;
  bottom: 0;

  height: 250px;
}

body.qh-login-page .qh-device-main {
  position: absolute;

  left: 120px;
  bottom: 56px;

  width: 180px;
  height: 190px;

  border:
    1px solid
    rgba(119, 174, 189, 0.35);

  border-radius: 30px;

  background:
    linear-gradient(
      145deg,
      #dff4f3,
      #ffffff 45%,
      #d9eef7
    );

  box-shadow:
    0 24px 40px
    rgba(55, 104, 124, 0.16),
    inset 0 0 0 1px
    rgba(255, 255, 255, 0.9);

  transform:
    rotate(-5deg);
}

body.qh-login-page
.qh-device-main::before {
  content: "96%";

  position: absolute;

  left: 28px;
  right: 28px;
  top: 38px;

  height: 72px;

  display: flex;
  align-items: center;

  padding-left: 14px;

  border-radius: 16px;

  color: #ffffff;

  font-size: 28px;
  font-weight: 700;

  background:
    linear-gradient(
      135deg,
      #0f766e,
      #2563eb
    );
}

body.qh-login-page
.qh-device-bars {
  position: absolute;

  left: 30px;
  right: 30px;
  bottom: 26px;

  height: 42px;

  display: flex;
  align-items: flex-end;

  gap: 8px;
}

body.qh-login-page
.qh-device-bars span {
  flex: 1;

  border-radius:
    4px 4px 2px 2px;

  background:
    linear-gradient(
      180deg,
      #7dd3fc,
      #3b82f6
    );
}

body.qh-login-page
.qh-device-bars
span:nth-child(1) {
  height: 42%;
}

body.qh-login-page
.qh-device-bars
span:nth-child(2) {
  height: 72%;
}

body.qh-login-page
.qh-device-bars
span:nth-child(3) {
  height: 58%;
}

body.qh-login-page
.qh-device-bars
span:nth-child(4) {
  height: 92%;
}

/* Solar */

body.qh-login-page
.qh-panel-board {
  position: absolute;

  left: 330px;
  bottom: 58px;

  width: 190px;
  height: 108px;

  border:
    6px solid
    rgba(255, 255, 255, 0.85);

  border-radius: 16px;

  background:
    linear-gradient(
      rgba(255, 255, 255, 0.28)
      1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.28)
      1px,
      transparent 1px
    ),
    linear-gradient(
      135deg,
      #1d4ed8,
      #0f766e
    );

  background-size:
    32px 32px,
    32px 32px,
    100% 100%;

  box-shadow:
    0 20px 32px
    rgba(37, 99, 235, 0.13);

  transform:
    skewY(-7deg)
    rotate(2deg);
}

/* =========================================================
   RIGHT SIDE
   ========================================================= */

body.qh-login-page
.qh-login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 56px 64px;

  background: #ffffff;
}

body.qh-login-page
.qh-login-form-wrap > section {
  width: 100%;
  max-width: 360px;

  margin: 0 !important;
  padding: 0 !important;
}

/* Header */

body.qh-login-page
.qh-login-form-wrap
.page-card-head {
  margin:
    0 0 30px;

  text-align: left !important;
}

body.qh-login-page
.qh-login-form-wrap
.page-card-head
.app-logo {
  display: none !important;
}

body.qh-login-page
.qh-login-form-wrap
.page-card-head h4 {
  margin: 0;

  color: #102033;

  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;

  letter-spacing: -0.3px;

  text-align: left !important;
}

body.qh-login-page
.qh-login-subtitle {
  margin-top: 10px;

  color: #7b8798;

  font-size: 14px;
  line-height: 1.5;

  text-align: left !important;
}

/* Remove original card */

body.qh-login-page
.qh-login-form-wrap
.page-card,
body.qh-login-page
.qh-login-form-wrap
.login-content.page-card {
  width: 100%;

  margin: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  border-radius: 0 !important;

  background:
    transparent !important;

  box-shadow:
    none !important;
}

body.qh-login-page
.qh-login-form-wrap
.page-card-body {
  padding: 0 !important;
}

body.qh-login-page
.qh-login-form-wrap
.form-group {
  margin-bottom:
    16px !important;
}

/* =========================================================
   INPUTS
   ========================================================= */

body.qh-login-page
.qh-login-form-wrap
.email-field,
body.qh-login-page
.qh-login-form-wrap
.password-field {
  position:
    relative !important;

  display:
    block !important;
}

body.qh-login-page
.qh-login-form-wrap
.form-control {
  width: 100%;

  height: 50px !important;
  min-height: 50px !important;

  padding:
    0 52px 0 44px !important;

  border:
    1px solid
    #e5eaf0 !important;

  border-radius:
    12px !important;

  background:
    #fbfcfe !important;

  color:
    #102033 !important;

  font-size:
    14px !important;

  line-height:
    normal !important;

  box-shadow:
    none !important;
}

body.qh-login-page
.qh-login-form-wrap
.form-control:focus {
  border-color:
    #7eb2e8 !important;

  background:
    #ffffff !important;

  box-shadow:
    0 0 0 4px
    rgba(37, 99, 235, 0.08)
    !important;
}

/*
   Important:
   Icon uses exact half of the
   50px input height.
*/
body.qh-login-page
.qh-login-form-wrap
.field-icon {
  position:
    absolute !important;

  top: 25px !important;
  left: 15px !important;

  width: 16px !important;
  height: 16px !important;

  margin: 0 !important;

  transform:
    translateY(-50%) !important;

  z-index: 2;

  pointer-events: none;
}

body.qh-login-page
.qh-login-form-wrap
.toggle-password {
  position:
    absolute !important;

  top: 25px !important;
  right: 14px !important;

  margin: 0 !important;

  transform:
    translateY(-50%) !important;

  color:
    #7b8798 !important;

  font-size:
    12px !important;

  line-height: 1 !important;
}

/* =========================================================
   FORGOT PASSWORD LINK
   ========================================================= */

/*
   Password input bottom
   ↓ 20px
   Forgot Password
   ↓ 20px
   Login button
*/

body.qh-login-page
.qh-login-form-wrap
.forgot-password-message {
  margin:
    20px 0 !important;

  padding: 0 !important;

  line-height:
    1.4 !important;

  text-align:
    right !important;
}

body.qh-login-page
.qh-login-form-wrap
.forgot-password-message a {
  color:
    #1d4ed8 !important;

  font-size:
    13px !important;

  font-weight:
    600 !important;

  text-decoration:
    none !important;

  cursor: pointer;
}

body.qh-login-page
.qh-login-form-wrap
.forgot-password-message
a:hover {
  color:
    #1e40af !important;

  text-decoration:
    underline !important;

  text-underline-offset:
    2px;
}

/* =========================================================
   BUTTON
   ========================================================= */

body.qh-login-page
.qh-login-form-wrap
.page-card-actions {
  margin: 0 !important;
  padding: 0 !important;
}

body.qh-login-page
.qh-login-form-wrap
.btn-login,
body.qh-login-page
.qh-login-form-wrap
.page-card-actions .btn,
body.qh-login-page
.qh-login-form-wrap
.page-card-actions
.btn-primary {
  width: 100%;

  min-height: 50px;

  border: 0 !important;

  border-radius:
    12px !important;

  color:
    #ffffff !important;

  font-size:
    15px !important;

  font-weight:
    700 !important;

  background:
    linear-gradient(
      135deg,
      #0f766e,
      #2563eb
    ) !important;

  box-shadow:
    0 12px 22px
    rgba(37, 99, 235, 0.16);
}

body.qh-login-page
.qh-login-form-wrap
.social-logins,
body.qh-login-page
.qh-login-form-wrap
.login-with-email-link {
  display: none !important;
}

/* =========================================================
   FORGOT PASSWORD PAGE
   ========================================================= */

body.qh-login-page
.for-forgot
.page-card-head {
  margin-bottom:
    30px !important;
}

body.qh-login-page
.for-forgot
.page-card-actions {
  margin-top:
    20px !important;
}

body.qh-login-page
.for-forgot
a[href="#login"],
body.qh-login-page
.for-forgot
.back-to-login {
  display: inline-block;

  margin-top:
    20px;

  color:
    #1d4ed8 !important;

  font-size:
    13px;

  font-weight:
    600;

  text-decoration:
    none !important;
}

body.qh-login-page
.for-forgot
a[href="#login"]:hover,
body.qh-login-page
.for-forgot
.back-to-login:hover {
  color:
    #1e40af !important;

  text-decoration:
    underline !important;
}

/* =========================================================
   FOOTER
   ========================================================= */

body.qh-login-page
.qh-login-footnote {
  margin-top: 28px;

  padding-top: 22px;

  border-top:
    1px solid #edf0f4;
}

body.qh-login-page
.qh-login-footnote-copy {
  text-align: center;
}

body.qh-login-page
.qh-login-footnote-title {
  color: #8b96a7;

  font-size: 12px;
  font-weight: 600;
}

body.qh-login-page
.qh-login-footnote-subtitle {
  margin-top: 3px;

  color: #97a1af;

  font-size: 12px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {
  body.qh-login-page
  .page_content {
    padding: 18px !important;
  }

  body.qh-login-page
  .qh-login-shell {
    width: 100% !important;

    min-height: auto;

    grid-template-columns:
      1fr;

    border-radius: 22px;
  }

  body.qh-login-page
  .qh-login-visual {
    display: none;
  }

  body.qh-login-page
  .qh-login-form-wrap {
    min-height:
      calc(100vh - 36px);

    padding:
      54px 28px;
  }

  body.qh-login-page
  .qh-login-form-wrap
  > section {
    max-width: 420px;
  }

  body.qh-login-page
  .qh-login-form-wrap
  .page-card-head h4 {
    font-size: 26px;
  }
}

/* QH SPLASH LOGO SIZE */
.splash img {
  width: 220px !important;
  max-width: 60vw !important;
  height: auto !important;
}
