/* Login / auth — layout centrado, tarjeta y fondo decorativo (paleta POS). */

:root {
  --auth-accent: #3a9b94;
  --auth-accent-soft: rgba(58, 155, 148, 0.22);
  --auth-input-surface: #e8eaef;
  --auth-input-text: #1a1d2e;
  --auth-input-border: rgba(0, 0, 0, 0.08);
}

/* Fondo cósmico: login (auth-body) y aplicación autenticada (pos-cosmic-shell) */
.auth-body,
body.pos-cosmic-shell {
  font-family: var(--font-family-base, "Poppins", sans-serif);
  margin: 0;
  min-height: 100vh;
  background-color: #0a0612;
  background-image: radial-gradient(
      ellipse 100% 70% at 0% 0%,
      rgba(69, 43, 144, 0.35),
      transparent 55%
    ),
    radial-gradient(
      ellipse 80% 55% at 100% 100%,
      rgba(45, 28, 82, 0.45),
      transparent 50%
    ),
    radial-gradient(
      ellipse 50% 40% at 15% 85%,
      rgba(25, 16, 48, 0.6),
      transparent 45%
    ),
    linear-gradient(165deg, #07050e 0%, #100a1c 38%, #0c0815 100%);
}

/* Preloader alineado con la base del fondo cósmico */
body.pos-cosmic-shell #preloader {
  background-color: #0a0612;
}

.auth-wrap {
  position: relative;
  isolation: isolate;
}

/* Fondo abstracto: índigo/púrpura, bandas, órbita, trazo y grano */
.auth-bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-bg-decor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 50% 50%,
      rgba(88, 70, 140, 0.08),
      transparent 62%
    ),
    linear-gradient(
      205deg,
      rgba(8, 5, 14, 0.95) 0%,
      transparent 35%,
      transparent 65%,
      rgba(5, 3, 12, 0.85) 100%
    );
}

.auth-bg-decor::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.auth-bg-bands {
  position: absolute;
  inset: 0;
}

.auth-bg-band {
  position: absolute;
  border-radius: 999px;
  transform: rotate(-38deg);
  transform-origin: center;
}

.auth-bg-band--1 {
  width: 135%;
  height: clamp(56px, 8vw, 88px);
  left: -28%;
  top: 8%;
  background: linear-gradient(
    90deg,
    rgba(130, 100, 190, 0.06),
    rgba(95, 72, 150, 0.28) 45%,
    rgba(70, 50, 120, 0.12)
  );
  box-shadow: 0 0 40px rgba(60, 40, 100, 0.15);
}

.auth-bg-band--2 {
  width: 130%;
  height: clamp(48px, 7vw, 76px);
  left: -22%;
  top: 38%;
  opacity: 0.85;
  background: linear-gradient(
    90deg,
    rgba(75, 55, 125, 0.08),
    rgba(110, 85, 165, 0.22) 50%,
    rgba(55, 40, 95, 0.1)
  );
}

.auth-bg-band--3 {
  width: 125%;
  height: clamp(40px, 5.5vw, 64px);
  left: -18%;
  bottom: 6%;
  opacity: 0.75;
  background: linear-gradient(
    90deg,
    rgba(45, 32, 85, 0.15),
    rgba(100, 78, 150, 0.18) 55%,
    rgba(35, 24, 65, 0.08)
  );
}

.auth-bg-orb {
  position: absolute;
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  left: -6%;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #2a1f45 0%,
    #151022 55%,
    #0c0818 100%
  );
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    -12px -8px 40px rgba(69, 43, 144, 0.12);
}

.auth-bg-squiggle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  min-width: 900px;
  height: 100%;
  min-height: 600px;
  transform: translate(-48%, -50%);
  opacity: 0.92;
}

.auth-bg-squiggle__path {
  stroke: rgba(16, 10, 32, 0.88);
  stroke-width: 26;
}

@media (max-width: 576px) {
  .auth-bg-squiggle__path {
    stroke-width: 18;
  }

  .auth-bg-orb {
    width: min(58vw, 240px);
    height: min(58vw, 240px);
    left: -18%;
    opacity: 0.95;
  }
}

.auth-bg-fleck {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(200, 190, 230, 0.22);
  line-height: 1;
  user-select: none;
}

.auth-bg-fleck--1 {
  top: 12%;
  right: 14%;
  font-size: 1rem;
}

.auth-bg-fleck--2 {
  bottom: 26%;
  left: 10%;
  font-size: 1.15rem;
  opacity: 0.85;
}

.auth-bg-fleck--3 {
  top: 48%;
  right: 22%;
  font-size: 0.75rem;
  opacity: 0.7;
}

.auth-bg-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(180, 165, 220, 0.35);
}

.auth-bg-dot--1 {
  top: 22%;
  left: 28%;
}

.auth-bg-dot--2 {
  bottom: 18%;
  right: 30%;
  width: 4px;
  height: 4px;
  opacity: 0.8;
}

.auth-bg-dot--3 {
  top: 62%;
  left: 55%;
  width: 3px;
  height: 3px;
  opacity: 0.6;
}

.auth-bg-sparkle {
  position: absolute;
  bottom: 12%;
  right: 8%;
  font-size: 1rem;
  line-height: 1;
  color: rgba(200, 185, 235, 0.35);
  user-select: none;
  transform: rotate(12deg);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-brand {
  margin: 0 0 1.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f4f0ff;
  text-align: center;
  text-shadow: 0 0 36px rgba(120, 90, 180, 0.35),
    0 0 20px rgba(58, 155, 148, 0.15);
}

.auth-wrap .auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card, #182237);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 0.75rem;
  padding: 2rem;
  color: var(--text-dark, #fff);
}

.auth-card--login {
  border-radius: 1.1rem;
  padding: 2rem 2rem 2.1rem;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  background: linear-gradient(
    165deg,
    #1e2a42 0%,
    var(--card, #182237) 48%,
    #141c2e 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 3px solid var(--auth-accent);
}

.auth-card--login .alert {
  margin-bottom: 1.25rem;
  border-radius: 0.55rem;
  text-align: left;
  font-size: 0.875rem;
  border: 1px solid rgba(255, 80, 80, 0.25);
  background: rgba(180, 40, 40, 0.18);
  color: #ffc9c9;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-field {
  margin-bottom: 1.15rem;
}

.auth-field:last-of-type {
  margin-bottom: 1.5rem;
}

.auth-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(179, 179, 179, 0.95);
}

/* Login: campos claros sobre tarjeta oscura (contraste, sin bloques extra) */
.auth-card--login .auth-input.form-control {
  width: 100%;
  margin-top: 0;
  padding: 0.78rem 1rem;
  font-size: 0.9rem;
  color: var(--auth-input-text) !important;
  background: var(--auth-input-surface) !important;
  border: 1px solid var(--auth-input-border) !important;
  border-radius: 0.65rem;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card--login .auth-input.form-control::placeholder {
  color: #6b7280;
  opacity: 1;
}

.auth-card--login .auth-input.form-control:focus {
  outline: 0;
  border-color: rgba(58, 155, 148, 0.55) !important;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35),
    0 0 0 3px var(--auth-accent-soft);
}

/* Registro u otras vistas auth: inputs oscuros */
.auth-input.form-control {
  width: 100%;
  margin-top: 0;
  padding: 0.7rem 0.95rem;
  font-size: 0.9rem;
  color: var(--text-dark, #fff) !important;
  background: rgba(21, 28, 44, 0.85) !important;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12)) !important;
  border-radius: 0.65rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auth-input.form-control::placeholder {
  color: var(--text, #828690);
  opacity: 1;
}

.auth-input.form-control:focus {
  outline: 0;
  border-color: var(--rgba-primary-5, rgba(69, 43, 144, 0.5)) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15),
    0 0 0 2px var(--rgba-primary-2, rgba(69, 43, 144, 0.25));
}

.auth-btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0;
  padding: 0.88rem 1.2rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #42a89f 0%, var(--auth-accent) 100%);
  color: #0a121f !important;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(58, 155, 148, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-btn-login:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 24px rgba(58, 155, 148, 0.48);
  color: #0a121f !important;
}

.auth-btn-login:active {
  transform: scale(0.99);
}

.auth-btn-login:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.auth-btn-login-text {
  flex: 1;
  text-align: center;
  padding-left: 1.75rem;
}

.auth-btn-login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(10, 18, 31, 0.14);
  color: #0a121f !important;
  flex-shrink: 0;
}

.auth-btn-login-icon .material-icons {
  font-size: 1.1rem;
  line-height: 1;
}

.auth-wrap .auth-card h2 {
  color: var(--text-dark, #fff);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.auth-wrap .auth-card input:not(.auth-input),
.auth-wrap .auth-card select {
  width: 100%;
  margin-top: 0.75rem;
}

.auth-wrap .auth-card button:not(.auth-btn-login) {
  width: 100%;
  margin-top: 1rem;
}

.auth-wrap .msg {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 0.5rem;
  background: rgba(58, 155, 148, 0.2);
  color: #bbe6e3;
}

.auth-wrap .msg.error {
  background: rgba(255, 94, 94, 0.15);
  color: #ffdede;
}
