/**
 * SalesCloud Theme — password reveal (ojo)
 * Tema claro → icono oscuro; tema oscuro → icono claro.
 * Orden Joan 25-jul-2026.
 */

.sc-password-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.sc-password-wrap > input.form-control,
.sc-password-wrap > input[type="password"],
.sc-password-wrap > input[type="text"].sc-password-revealed {
  width: 100% !important;
  padding-right: 2.75rem !important;
  box-sizing: border-box !important;
}

/* Botón ojo (auth + forms sin input-group) */
button.sc-password-toggle,
a.sc-password-toggle {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  line-height: 1;
  text-decoration: none !important;
  /* fallback: muted del surface (ya adapta claro/oscuro) */
  color: var(--sc-surface-muted, #64748b) !important;
  opacity: 0.9;
  -webkit-appearance: none;
  appearance: none;
}

button.sc-password-toggle:hover,
button.sc-password-toggle:focus,
a.sc-password-toggle:hover,
a.sc-password-toggle:focus {
  color: var(--sc-surface-text, #0f172a) !important;
  opacity: 1;
  outline: none;
}

button.sc-password-toggle i,
a.sc-password-toggle i {
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
}

/* ── Tema claro: icono oscuro ── */
html body.sc-sidebar-light button.sc-password-toggle,
html body.sc-sidebar-light a.sc-password-toggle,
html body.admin.sc-sidebar-light button.sc-password-toggle,
html body.admin.sc-sidebar-light a.sc-password-toggle,
html body.customers:not(.sc-client-dark) button.sc-password-toggle,
html body.customers:not(.sc-client-dark) a.sc-password-toggle,
html body.perfex-auth-body.sc-sidebar-light button.sc-password-toggle {
  color: #0f172a !important;
}

html body.sc-sidebar-light button.sc-password-toggle:hover,
html body.admin.sc-sidebar-light button.sc-password-toggle:hover,
html body.customers:not(.sc-client-dark) button.sc-password-toggle:hover {
  color: #020617 !important;
}

/* ── Tema oscuro: icono claro ── */
html body.sc-sidebar-dark button.sc-password-toggle,
html body.sc-sidebar-dark a.sc-password-toggle,
html body.admin.sc-sidebar-dark button.sc-password-toggle,
html body.admin.sc-sidebar-dark a.sc-password-toggle,
html body.customers.sc-client-dark button.sc-password-toggle,
html body.customers.sc-client-dark a.sc-password-toggle,
html body.perfex-auth-body.sc-sidebar-dark button.sc-password-toggle {
  color: #e2e8f0 !important;
}

html body.sc-sidebar-dark button.sc-password-toggle:hover,
html body.admin.sc-sidebar-dark button.sc-password-toggle:hover,
html body.customers.sc-client-dark button.sc-password-toggle:hover {
  color: #f8fafc !important;
}

/* Sin clase en body: seguir variables de superficie */
html body.perfex-auth-body button.sc-password-toggle {
  color: var(--sc-surface-muted, var(--sc-surface-text, #94a3b8)) !important;
}
html body.perfex-auth-body button.sc-password-toggle:hover {
  color: var(--sc-surface-text, #f1f5f9) !important;
}

/* ── Addon nativo Perfex (input-group + show_password) ── */
.input-group-addon .show_password,
.input-group-addon a.show_password,
.input-group .show_password,
.input-group-addon .sc-password-toggle,
.input-group .sc-password-toggle {
  position: static;
  transform: none;
  width: auto;
  height: auto;
  color: var(--sc-surface-muted, #64748b) !important;
}

html body.sc-sidebar-light .input-group-addon .show_password,
html body.sc-sidebar-light .input-group-addon .show_password i,
html body.admin.sc-sidebar-light .input-group-addon .show_password,
html body.admin.sc-sidebar-light .input-group-addon .show_password i,
html body.customers:not(.sc-client-dark) .input-group-addon .show_password,
html body.customers:not(.sc-client-dark) .input-group-addon .show_password i {
  color: #0f172a !important;
}

html body.sc-sidebar-dark .input-group-addon .show_password,
html body.sc-sidebar-dark .input-group-addon .show_password i,
html body.admin.sc-sidebar-dark .input-group-addon .show_password,
html body.admin.sc-sidebar-dark .input-group-addon .show_password i,
html body.customers.sc-client-dark .input-group-addon .show_password,
html body.customers.sc-client-dark .input-group-addon .show_password i {
  color: #e2e8f0 !important;
}

/* Auth form: el wrap no debe romper layout del form-group */
.perfex-form-card .sc-password-wrap,
.perfex-split .sc-password-wrap,
body.perfex-auth-body .sc-password-wrap {
  margin: 0;
}
