/* Auth UI polish — loaded after auth.css */

html {
  overflow-x: hidden !important;
}

body.login.zibasho-auth {
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif !important;
  overflow-x: hidden !important;
}

body.login.zibasho-auth a,
body.login.zibasho-auth a:active {
  color: var(--zb-mute) !important;
}
body.login.zibasho-auth a:hover {
  color: var(--zb-rose) !important;
}

body.login.zibasho-auth .zb-auth-desktop-head h2,
body.login.zibasho-auth .zb-auth-mobile-title,
body.login.zibasho-auth .zb-auth-headline {
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--zb-ink) !important;
}

body.login.zibasho-auth .zb-hp {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

/*
 * Desktop layout fix:
 * - Main = full-height centering tray (no fake inner scroll)
 * - Stage = content-sized unit (card + back), vertically centered
 * - Never flex:1 stage with justify-center (clips top + invents bottom scroll)
 */
@media (min-width: 1024px) {
  body.login.zibasho-auth {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.login.zibasho-auth #login {
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .zb-auth-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    min-height: 100vh !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: visible !important;
  }
  .zb-auth-brand {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    overflow: hidden !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    height: auto !important;
    padding: 2rem 2.25rem !important;
  }
  .zb-auth-main {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    min-width: 0 !important;
    overflow: visible !important;
    padding: 1.25rem !important;
    box-sizing: border-box !important;
  }
  .zb-auth-mobile-hero {
    display: none !important;
  }
  .zb-auth-stage {
    flex: 0 1 auto !important;
    width: min(100%, 28rem) !important;
    max-width: 28rem !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
    box-sizing: border-box !important;
  }
  .zb-auth-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    border: 1px solid var(--zb-line);
    background: #fff;
    border-radius: 1.5rem;
    padding: 24px 28px !important;
    box-shadow: var(--zb-lift);
    box-sizing: border-box !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    align-self: center !important;
  }
  body.login.zibasho-auth #login,
  body.login.zibasho-auth #loginform,
  body.login.zibasho-auth #registerform,
  body.login.zibasho-auth #lostpasswordform {
    min-height: 0 !important;
    height: auto !important;
    justify-content: flex-start !important;
  }
  body.login.zibasho-auth #nav {
    margin-top: 12px !important;
    margin-bottom: 0 !important;
  }
  body.login.zibasho-auth .zb-auth-back {
    margin-top: 12px !important;
  }
  body.login.zibasho-auth--login .zb-auth-desktop-head {
    display: none !important;
  }
  .zb-auth-desktop-head {
    margin-bottom: 0.65rem !important;
  }
  .zb-auth-desktop-head h2 {
    font-size: 1.3rem !important;
  }
  .zb-auth-tabs {
    margin-bottom: 0.65rem !important;
  }
  .zb-auth-tab {
    padding: 0.55rem 0.45rem !important;
    font-size: 0.8rem !important;
  }
  .zb-auth-method-tabs {
    margin-bottom: 0.65rem !important;
  }
  .zb-auth-method {
    padding: 0.5rem 0.35rem !important;
    font-size: 0.72rem !important;
    min-height: 2.25rem !important;
  }
  body.login.zibasho-auth input[type="text"],
  body.login.zibasho-auth input[type="email"],
  body.login.zibasho-auth input[type="password"],
  body.login.zibasho-auth input[type="tel"],
  body.login.zibasho-auth select {
    min-height: 2.55rem !important;
    padding: 0.5rem 0.85rem !important;
    font-size: 0.88rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  body.login.zibasho-auth #loginform > p,
  body.login.zibasho-auth #registerform > p,
  body.login.zibasho-auth #lostpasswordform > p {
    margin: 0 0 0.5rem !important;
  }
  body.login.zibasho-auth .forgetmenot {
    margin: 0.1rem 0 0.55rem !important;
  }
  body.login.zibasho-auth .button-primary,
  body.login.zibasho-auth #wp-submit {
    min-height: 2.65rem !important;
  }
  body.login.zibasho-auth .zb-math-captcha {
    margin: 0.15rem 0 0.55rem !important;
    padding: 0.55rem 0.7rem !important;
  }
  .zb-math-captcha__head { margin-bottom: 0.4rem !important; }
  .zb-math-captcha__sum,
  body.login.zibasho-auth .zb-math-captcha input[type="number"] {
    height: 2.25rem !important;
    min-height: 2.25rem !important;
  }
  body.login.zibasho-auth #nav {
    margin-top: 0.45rem !important;
    margin-bottom: 0 !important;
  }
  .zb-auth-back {
    margin: 0.85rem 0 0 !important;
    font-size: 0.75rem !important;
  }
}

/* Tabs always visible in OTP mode */
body.login.zibasho-auth .zb-auth-tabs,
body.login.zibasho-auth.zb-auth-otp-mode .zb-auth-tabs,
body.login.zibasho-auth .zb-auth-method-tabs,
body.login.zibasho-auth.zb-auth-otp-mode .zb-auth-method-tabs {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* OTP stacked */
body.login.zibasho-auth .zb-otp-panel,
body.login.zibasho-auth .zb-otp-box {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.login.zibasho-auth .zb-otp-email-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
body.login.zibasho-auth .zb-otp-email-row input,
body.login.zibasho-auth #zb-otp-email {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
body.login.zibasho-auth .zb-otp-send,
body.login.zibasho-auth #zb-otp-send {
  width: 100% !important;
  justify-content: center !important;
}
body.login.zibasho-auth .zb-otp-verify {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Rose logos on auth panels */
.zb-auth-brand-logo img,
.zb-auth-mobile-top img {
  filter: brightness(0) saturate(100%) invert(58%) sepia(24%) saturate(780%) hue-rotate(300deg) brightness(95%) contrast(90%) !important;
  -webkit-filter: brightness(0) saturate(100%) invert(58%) sepia(24%) saturate(780%) hue-rotate(300deg) brightness(95%) contrast(90%) !important;
}
.zb-auth-brand-logo img { height: 4.25rem !important; }
.zb-auth-mobile-top img { height: 2.65rem !important; }

/* Kill WP blue focus */
body.login.zibasho-auth a:focus,
body.login.zibasho-auth a:focus-visible,
body.login.zibasho-auth button:focus,
body.login.zibasho-auth button:focus-visible,
body.login.zibasho-auth .zb-auth-brand-logo:focus,
body.login.zibasho-auth .zb-auth-brand-logo:focus-visible,
body.login.zibasho-auth .zb-auth-tab:focus,
body.login.zibasho-auth .zb-auth-tab:focus-visible,
body.login.zibasho-auth .zb-auth-method:focus,
body.login.zibasho-auth .zb-auth-method:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
body.login.zibasho-auth a:focus-visible,
body.login.zibasho-auth button:focus-visible,
body.login.zibasho-auth .zb-auth-brand-logo:focus-visible,
body.login.zibasho-auth .zb-auth-tab:focus-visible,
body.login.zibasho-auth .zb-auth-method:focus-visible {
  outline: 2px solid rgba(212, 122, 143, 0.55) !important;
  outline-offset: 3px !important;
  box-shadow: none !important;
}
body.login.zibasho-auth .zb-auth-brand-logo {
  border-radius: 0.5rem;
  display: inline-flex;
  text-decoration: none !important;
}

body.login.zibasho-auth .zb-auth-tab {
  color: var(--zb-mute) !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
body.login.zibasho-auth .zb-auth-tab:hover,
body.login.zibasho-auth .zb-auth-tab:focus {
  color: var(--zb-rose) !important;
  background: var(--zb-rose-soft) !important;
  box-shadow: none !important;
}
body.login.zibasho-auth .zb-auth-tab.is-active,
body.login.zibasho-auth .zb-auth-tab.is-active:hover,
body.login.zibasho-auth .zb-auth-tab.is-active:focus {
  background: var(--zb-rose) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body.login.zibasho-auth .zb-auth-method:hover { color: var(--zb-rose) !important; }
body.login.zibasho-auth .zb-auth-method.is-active:hover { color: var(--zb-lav-ink) !important; }

body.login.zibasho-auth input[type="checkbox"] {
  accent-color: var(--zb-rose) !important;
  width: 1rem;
  height: 1rem;
  border-radius: 0.3rem;
}

body.login.zibasho-auth #loginform > p,
body.login.zibasho-auth #registerform > p,
body.login.zibasho-auth #lostpasswordform > p {
  margin: 0 0 0.85rem !important;
}
body.login.zibasho-auth label {
  margin: 0 !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: rgba(45, 49, 66, 0.78) !important;
}
body.login.zibasho-auth label .input,
body.login.zibasho-auth input[type="text"],
body.login.zibasho-auth input[type="email"],
body.login.zibasho-auth input[type="password"],
body.login.zibasho-auth input[type="number"] {
  margin-top: 0.4rem !important;
}

body.login.zibasho-auth--register #login > .message,
body.login.zibasho-auth--register .message:empty {
  display: none !important;
}

body.login.zibasho-auth .wp-pwd {
  position: relative !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
}
body.login.zibasho-auth .user-pass-wrap input#user_pass,
body.login.zibasho-auth .wp-pwd input[type="password"],
body.login.zibasho-auth .wp-pwd input[type="text"] {
  direction: ltr !important;
  text-align: left !important;
  padding: 10px 4px !important;
  padding-inline: 4px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.login.zibasho-auth .button.wp-hide-pw {
  position: static !important;
  transform: none !important;
  inset: auto !important;
  width: 32px !important;
  height: 32px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #8E929F !important;
  box-shadow: none !important;
  z-index: 1 !important;
  flex: 0 0 32px !important;
}
body.login.zibasho-auth .button.wp-hide-pw:hover,
body.login.zibasho-auth .button.wp-hide-pw:focus {
  color: var(--zb-rose) !important;
  background: var(--zb-rose-soft) !important;
  box-shadow: none !important;
  outline: none !important;
}
body.login.zibasho-auth .button.wp-hide-pw .dashicons {
  width: 1.15rem;
  height: 1.15rem;
  font-size: 1.15rem;
}

/* Math: LTR with English ? */
body.login.zibasho-auth .zb-math-captcha {
  margin: 0.35rem 0 1rem !important;
  padding: 0.9rem 1rem !important;
  border-radius: 1.15rem !important;
  border: 1px solid #F0D4DA !important;
  background: linear-gradient(180deg, #FFF8F9 0%, #FCEEEF 100%) !important;
  box-shadow: none !important;
}
.zb-math-captcha__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.zb-math-captcha__badge {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--zb-rose);
  font-size: 0.8rem;
  flex-shrink: 0;
  border: 1px solid #F0D4DA;
}
.zb-math-captcha__head strong {
  display: block;
  font-size: 0.8rem;
  color: var(--zb-ink);
}
.zb-math-captcha__head p {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  color: var(--zb-mute);
  line-height: 1.45;
}
.zb-math-captcha__row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  direction: ltr;
  justify-content: flex-start;
}
.zb-math-captcha__sum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  height: 2.75rem;
  padding: 0 0.85rem;
  border-radius: 0.85rem;
  background: #fff;
  border: 1px solid #F0D4DA;
  font-weight: 800;
  font-size: 1rem;
  color: var(--zb-lav-ink);
  font-variant-numeric: tabular-nums;
}
.zb-math-captcha__eq { font-weight: 800; color: var(--zb-mute); }
body.login.zibasho-auth .zb-math-captcha input[type="number"] {
  width: 4.5rem !important;
  min-height: 2.75rem !important;
  margin: 0 !important;
  text-align: center !important;
  font-weight: 800 !important;
  background: #fff !important;
  border-radius: 0.85rem !important;
  direction: ltr !important;
  font-family: Consolas, Menlo, Monaco, monospace !important;
}

body.login.zibasho-auth #nav {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  margin-top: 1.1rem !important;
  font-size: 0.78rem !important;
}
body.login.zibasho-auth--login #nav a[href*="action=register"] {
  display: none !important;
}
body.login.zibasho-auth #nav a {
  color: var(--zb-mute) !important;
  font-weight: 600 !important;
}
body.login.zibasho-auth #nav a:hover,
body.login.zibasho-auth #nav a:focus {
  color: var(--zb-rose) !important;
  box-shadow: none !important;
  outline: none !important;
}
body.login.zibasho-auth #nav a[href*="lostpassword"] {
  color: var(--zb-rose) !important;
  font-weight: 700 !important;
}
body.login.zibasho-auth .zb-auth-back a:hover,
body.login.zibasho-auth .zb-auth-back a:focus {
  color: var(--zb-rose) !important;
  box-shadow: none !important;
  outline: none !important;
}
