
/*
  MakonBook Auth Nav + Password Toggle Final Fix
  Target pages: login, register, forgot-password, reset-password.
  Fixes:
  1) System/Login/Register buttons alignment in auth header.
  2) Show password button alignment inside password inputs.
  Load as the last auth override CSS.
*/

/* ===== AUTH HEADER DESKTOP/TABLET ===== */

body.auth-page .auth-shell {
  width: min(1180px, calc(100% - 48px)) !important;
  margin-inline: auto !important;
  padding-top: 28px !important;
  overflow: visible !important;
}

body.auth-page .auth-nav {
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto clamp(22px, 2.5vw, 32px) !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  justify-content: initial !important;
  gap: 18px !important;

  position: relative !important;
  z-index: 9000 !important;
}

body.auth-page .auth-brand {
  grid-column: 1 !important;
  justify-self: start !important;

  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;

  min-width: 0 !important;
  max-width: 100% !important;
  color: #fff !important;
  text-decoration: none !important;
}

body.auth-page .auth-brand img {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  border-radius: 18px !important;
  object-fit: contain !important;
}

body.auth-page .auth-brand span {
  display: inline-block !important;
  max-width: min(360px, 48vw) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;

  color: #fff !important;
  font-size: clamp(1.45rem, 2.1vw, 2.05rem) !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  letter-spacing: -0.055em !important;
}

body.auth-page .auth-nav-actions {
  grid-column: 2 !important;
  justify-self: end !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;

  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.auth-page .auth-nav-actions > * {
  flex: 0 0 auto !important;
}

body.auth-page .auth-nav-actions .theme-switcher {
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
  z-index: 9010 !important;
}

body.auth-page .auth-nav-actions .theme-toggle,
body.auth-page .auth-link-pill {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border-radius: 999px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  transform: none !important;
}

body.auth-page .auth-nav-actions .theme-toggle {
  width: auto !important;
  min-width: 112px !important;
  padding: 0 16px !important;
  gap: 9px !important;
}

body.auth-page .auth-nav-actions .theme-toggle-icon {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  line-height: 1 !important;
}

body.auth-page .auth-nav-actions .theme-toggle-label {
  display: inline-block !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

body.auth-page .auth-link-pill {
  min-width: 96px !important;
  padding: 0 22px !important;
  font-size: 0.96rem !important;
  font-weight: 900 !important;
}

/* Keep dropdown aligned to the theme button, not page center */
body.auth-page .auth-nav-actions .theme-menu {
  right: 0 !important;
  left: auto !important;
  top: calc(100% + 10px) !important;
  z-index: 9020 !important;
}

/* Auth grid should start below header cleanly */
body.auth-page .auth-grid {
  width: 100% !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
  align-items: start !important;
}

/* ===== PASSWORD SHOW BUTTON ===== */

body.auth-page .password-wrap {
  position: relative !important;
}

body.auth-page .password-wrap input[type="password"],
body.auth-page .password-wrap input[type="text"] {
  padding-right: 76px !important;
}

body.auth-page .password-wrap .password-toggle,
body.auth-page .password-wrap .field-icon {
  position: absolute !important;
  right: 10px !important;

  /*
    Form-group contains label + input.
    This anchors the button to the vertical center of the input itself.
  */
  top: calc(100% - 28px) !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;

  width: auto !important;
  min-width: 54px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;

  padding: 0 12px !important;
  margin: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.76) !important;

  font-size: 0.76rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
  line-height: 1 !important;

  box-shadow: none !important;
  float: none !important;
  cursor: pointer !important;
  z-index: 4 !important;
}

body.auth-page .password-wrap .password-toggle:hover,
body.auth-page .password-wrap .field-icon:hover,
body.auth-page .password-wrap .password-toggle.is-visible,
body.auth-page .password-wrap .field-icon.is-visible {
  color: #fff !important;
  border-color: rgba(53, 214, 255, 0.42) !important;
  background: rgba(53, 214, 255, 0.12) !important;
}

/* Fix the odd border line through forgot password area */
body.auth-page .auth-card-footer.compact-footer {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

body.auth-page .auth-card-footer.compact-footer[style] {
  justify-content: flex-end !important;
}

/* ===== SMALL LAPTOPS ===== */

@media (max-width: 1180px) and (min-width: 769px) {
  body.auth-page .auth-shell {
    width: min(100% - 36px, 1180px) !important;
  }

  body.auth-page .auth-nav {
    gap: 14px !important;
  }

  body.auth-page .auth-brand img {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
  }

  body.auth-page .auth-brand span {
    font-size: 1.55rem !important;
  }

  body.auth-page .auth-nav-actions .theme-toggle {
    width: 48px !important;
    min-width: 48px !important;
    padding: 0 !important;
  }

  body.auth-page .auth-nav-actions .theme-toggle-label {
    display: none !important;
  }

  body.auth-page .auth-link-pill {
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 18px !important;
  }
}

/* ===== PHONES ===== */

@media (max-width: 768px) {
  body.auth-page .auth-shell {
    width: min(100% - 18px, 1180px) !important;
    padding-top: 14px !important;
  }

  body.auth-page .auth-nav {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }

  body.auth-page .auth-brand {
    width: 100% !important;
  }

  body.auth-page .auth-brand img {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 14px !important;
  }

  body.auth-page .auth-brand span {
    font-size: 1.5rem !important;
    max-width: calc(100vw - 82px) !important;
  }

  body.auth-page .auth-nav-actions {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  body.auth-page .auth-nav-actions .theme-toggle {
    width: 48px !important;
    min-width: 48px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 !important;
  }

  body.auth-page .auth-nav-actions .theme-toggle-label {
    display: none !important;
  }

  body.auth-page .auth-link-pill {
    height: 46px !important;
    min-height: 46px !important;
    min-width: 118px !important;
    padding: 0 14px !important;
    font-size: 0.88rem !important;
  }

  body.auth-page .auth-nav-actions .theme-menu {
    position: fixed !important;
    top: 74px !important;
    right: 10px !important;
    left: auto !important;
    width: min(176px, calc(100vw - 20px)) !important;
  }

  body.auth-page .password-wrap input[type="password"],
  body.auth-page .password-wrap input[type="text"] {
    padding-right: 70px !important;
  }

  body.auth-page .password-wrap .password-toggle,
  body.auth-page .password-wrap .field-icon {
    right: 9px !important;
    min-width: 50px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 10px !important;
  }
}

@media (max-width: 390px) {
  body.auth-page .auth-brand span {
    font-size: 1.35rem !important;
  }

  body.auth-page .auth-link-pill {
    min-width: auto !important;
    padding: 0 12px !important;
    font-size: 0.82rem !important;
  }
}
