/* SalesCloud Theme — Admin & client authentication */
.perfex-split {
  position: fixed;
  inset: 0;
  display: flex;
  z-index: 999999;
  background: var(--sc-surface-dark, #020617);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
/* Panel de marca: color plano del preset con una profundidad muy suave (deep del
   primary arriba, accent apuntando abajo) y viñeta. Sin texturas: el fondo es el
   escenario de las partículas, no el protagonista. */
.perfex-left {
  flex: 1 1 44%;
  min-height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Color de marca del tenant, como el panel morado de Plesk. --sc-panel-* los calcula
     salescloud_theme_variables_style() sobre el PRIMARY (no sobre la superficie), y de
     ahí sale también el color del texto: en un preset claro tipo "honey" la superficie
     es crema pero el panel es mostaza, y ahí el texto va en blanco. */
  background:
    radial-gradient(115% 90% at 25% 20%, var(--sc-panel-mid, #14b8a6) 0%, var(--sc-panel-deep, #020617) 70%),
    radial-gradient(80% 70% at 85% 90%, color-mix(in srgb, var(--sc-panel-glow, #0ea5e9) 55%, transparent) 0%, transparent 65%),
    var(--sc-panel-deep, #020617);
  color: var(--sc-panel-text, #fff);
  padding: 2rem;
}
/* Viñeta: oscurece los bordes y centra la mirada en el logo, como el panel de Plesk. */
.perfex-left::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(115% 90% at 50% 45%, transparent 45%, rgb(0 0 0 / 0.18) 100%);
}
.perfex-right {
  flex: 1 1 56%;
  min-height: 100%;
  background: var(--sc-surface-dark, #020617);
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: auto;
}
/* Cáusticas = DEGRADADOS de luz en movimiento (Joan 13/07/2026), no una textura: la
   máscara de feTurbulence daba un patrón moteado. Cuatro manchas radiales del color del
   preset, muy desenfocadas, en "screen" y derivando a distintas velocidades: al cruzarse
   se refuerzan y se apagan, que es lo que da la sensación de luz sobre agua. */
.perfex-caustic {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* screen sobre panel oscuro, multiply sobre panel claro: un blend fijo deja la cáustica
     invisible en el extremo de luminosidad contrario. Lo calcula el helper según el PRIMARY. */
  mix-blend-mode: var(--sc-caustic-blend, screen);
  opacity: var(--sc-caustic-opacity, 1);
  will-change: transform;
}
.perfex-caustic.c1 {
  background:
    radial-gradient(ellipse 58% 48% at 24% 28%, color-mix(in srgb, var(--sc-panel-glow, #2dd4bf) 55%, transparent) 0%, transparent 66%),
    radial-gradient(ellipse 50% 55% at 76% 70%, color-mix(in srgb, var(--sc-accent, #14b8a6) 42%, transparent) 0%, transparent 70%);
  filter: blur(55px);
  opacity: 0.3;
  animation: scCaustic1 22s ease-in-out infinite;
}
.perfex-caustic.c2 {
  background:
    radial-gradient(ellipse 62% 42% at 70% 26%, color-mix(in srgb, var(--sc-panel-glow, #2dd4bf) 42%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 46% 58% at 22% 76%, color-mix(in srgb, var(--sc-accent, #14b8a6) 34%, transparent) 0%, transparent 68%);
  filter: blur(65px);
  opacity: 0.26;
  animation: scCaustic2 30s ease-in-out infinite;
}
.perfex-caustic.c3 {
  background: radial-gradient(ellipse 70% 55% at 48% 52%, color-mix(in srgb, var(--sc-panel-glow, #2dd4bf) 38%, transparent) 0%, transparent 72%);
  filter: blur(50px);
  opacity: 0.24;
  animation: scCaustic3 18s ease-in-out infinite;
}
.perfex-caustic.c4 {
  background: radial-gradient(ellipse 52% 40% at 55% 8%, color-mix(in srgb, var(--sc-accent, #14b8a6) 36%, transparent) 0%, transparent 70%);
  filter: blur(60px);
  opacity: 0.2;
  animation: scCaustic4 26s ease-in-out infinite reverse;
}
@keyframes scCaustic1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8%, -6%) scale(1.12); }
}
@keyframes scCaustic2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-7%, 9%) scale(1.14); }
}
@keyframes scCaustic3 {
  0%, 100% { transform: translate(0, 0) scale(1.05); }
  50% { transform: translate(6%, 5%) scale(0.94); }
}
@keyframes scCaustic4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5%, 7%) scale(1.1); }
}
#perfex-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 1;
}
.perfex-branding {
  position: relative;
  z-index: 10;
  max-width: 360px;
  text-align: left;
}
.perfex-branding .logo {
  max-height: 110px;
  width: auto;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}
.perfex-branding .main-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.6rem;
  color: var(--sc-panel-text, #fff);
}
.perfex-branding p {
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.82;
  margin: 0 0 0.7rem;
}
.perfex-branding .features {
  font-size: 0.82rem;
  line-height: 1.55;
  margin-bottom: 0.7rem;
  opacity: 0.9;
}
.perfex-branding .features div {
  margin: 2px 0;
}
.perfex-branding .tag {
  font-size: 0.82rem;
  opacity: 0.65;
  margin-top: 0.4rem;
  display: block;
  font-weight: 500;
}
.perfex-form-card {
  width: 100%;
  max-width: 420px;
  background: color-mix(in srgb, var(--sc-surface-dark, #020617) 78%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgb(0 0 0 / 0.3), 0 0 0 1px color-mix(in srgb, var(--sc-accent, #2ab9ad) 12%, transparent);
  border: 1px solid var(--sc-surface-border, #1e2937);
  padding: 2.1rem 2rem 1.85rem;
}
.perfex-form-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sc-surface-text, #f1f5f9);
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}
.perfex-form-card .subtitle {
  color: var(--sc-surface-muted, #94a3b8);
  font-size: 0.97rem;
  margin-bottom: 1.35rem;
}
.perfex-form-card .form-group {
  margin-bottom: 1rem;
}
.perfex-form-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sc-surface-label, #e2e8f0);
  margin-bottom: 0.35rem;
}
/* Input colours track the surface: a white input inherits the light text of a dark theme
   (white-on-white), and a dark input looks wrong on a cream preset. */
.perfex-form-card .form-control,
body.perfex-auth-body .perfex-form-card input.form-control,
body.perfex-auth-body .perfex-form-card .form-control {
  width: 100%;
  height: auto;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--sc-input-border, #334155) !important;
  border-radius: 12px;
  font-size: 0.96rem;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  background: var(--sc-input-bg, #0b1220) !important;
  background-color: var(--sc-input-bg, #0b1220) !important;
  color: var(--sc-input-text, #f1f5f9) !important;
  -webkit-text-fill-color: var(--sc-input-text, #f1f5f9) !important;
  caret-color: var(--sc-accent, #2dd4bf);
}
.perfex-form-card .form-control::placeholder,
body.perfex-auth-body .perfex-form-card .form-control::placeholder {
  color: var(--sc-surface-muted, #64748b) !important;
  opacity: 1;
}
.perfex-form-card .form-control:focus,
body.perfex-auth-body .perfex-form-card input.form-control:focus,
body.perfex-auth-body .perfex-form-card .form-control:focus {
  border-color: var(--sc-accent, #2dd4bf) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc-accent, #2dd4bf) 15%, transparent) !important;
  outline: none;
  background: var(--sc-input-bg-focus, #0f1a2e) !important;
  background-color: var(--sc-input-bg-focus, #0f1a2e) !important;
  color: var(--sc-input-text, #f8fafc) !important;
  -webkit-text-fill-color: var(--sc-input-text, #f8fafc) !important;
}
/* Password managers repaint the field on autofill; the inset shadow is the only way to hold the colour. */
body.perfex-auth-body .perfex-split input:-webkit-autofill,
body.perfex-auth-body .perfex-split input:-webkit-autofill:hover,
body.perfex-auth-body .perfex-split input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--sc-input-text, #f1f5f9) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--sc-input-bg, #0b1220) inset !important;
  box-shadow: 0 0 0 1000px var(--sc-input-bg, #0b1220) inset !important;
  caret-color: var(--sc-accent, #2dd4bf);
}

/* Auth oscuro: inputs SIEMPRE fondo blanco + texto oscuro (nada de blanco sobre blanco) */
body.customers .perfex-split .form-control,
body.customers_login .perfex-split .form-control,
body.customers.register .perfex-split .form-control,
body.customers .perfex-form-card .form-control,
body.customers_login .perfex-form-card .form-control,
body.customers.register .perfex-form-card .form-control,
body.customers .perfex-form-card input.form-control,
body.customers .perfex-form-card select.form-control,
body.customers .perfex-form-card textarea.form-control {
  background-color: #fff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
}

body.customers .perfex-split .form-control:focus,
body.customers_login .perfex-split .form-control:focus,
body.customers.register .perfex-split .form-control:focus,
body.customers .perfex-form-card .form-control:focus,
body.customers_login .perfex-form-card .form-control:focus,
body.customers.register .perfex-form-card .form-control:focus {
  background-color: #fff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

body.customers .perfex-form-card .form-control::placeholder,
body.customers.register .perfex-form-card .form-control::placeholder {
  color: #64748b !important;
  opacity: 1;
}

body.customers .perfex-form-card .control-label,
body.customers .perfex-form-card label {
  color: var(--sc-surface-label, #e2e8f0) !important;
}

body.customers .perfex-form-card input.form-control:-webkit-autofill,
body.customers .perfex-form-card input.form-control:-webkit-autofill:hover,
body.customers .perfex-form-card input.form-control:-webkit-autofill:focus,
body.customers.register .perfex-form-card input.form-control:-webkit-autofill,
body.customers.register .perfex-form-card input.form-control:-webkit-autofill:hover,
body.customers.register .perfex-form-card input.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  transition: background-color 99999s ease-out;
}
.perfex-form-card .btn-primary,
.perfex-form-card button.btn-primary {
  background: linear-gradient(135deg, var(--sc-primary, #14b8a6) 0%, var(--sc-accent, #0ea5e9) 100%) !important;
  border: none;
  color: #fff !important;
  padding: 0.8rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  width: 100%;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 25px -10px rgba(var(--sc-primary-rgb, 20, 184, 166), 0.65);
  transition: transform 0.05s ease, box-shadow 0.2s, filter 0.2s;
}
.perfex-form-card .btn-primary:hover,
.perfex-form-card button.btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -10px rgba(var(--sc-primary-rgb, 20, 184, 166), 0.8);
}
.perfex-form-card .btn-primary:active {
  transform: translateY(0);
}
.perfex-form-card a {
  color: var(--sc-surface-muted, #94a3b8);
  text-decoration: none;
}
.perfex-form-card a:hover {
  color: var(--sc-accent, #14b8a6);
}
@media (max-width: 820px) {
  .perfex-split { flex-direction: column; }
  .perfex-left { flex: 0 0 auto; min-height: 36vh; padding: 1rem; }
  .perfex-right { flex: 1; padding: 1.1rem; }
  .perfex-branding { max-width: 100%; text-align: center; }
  .perfex-branding .logo { margin: 0 auto 0.5rem; max-height: 80px; width: auto; }
  .perfex-branding .main-title { font-size: 1.45rem; text-align: center; }
  .perfex-branding p { text-align: center; }
  .perfex-branding .features { text-align: left; margin: 0 auto 0.6rem; max-width: 260px; }
}
/* Movimiento reducido = quieto, NO invisible. Ocultarlo dejaba el panel de marca
   desnudo (sin cáusticas ni partículas) a quien tuviera la preferencia del sistema. */
@media (prefers-reduced-motion: reduce) {
  .perfex-caustic {
    animation: none !important;
  }
}