/* ==========================================================================
   SISTEMA DE DISEÑO LIQUID GLASS AUTÉNTICO & THEME ENGINE (PRODUCCIÓN)
   Inspirado en GlassKit, Apple VisionOS y Linear.
   Reflejo especular, refracción translúcida, fluid sliding pill y wallpapers.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Paleta de Acento Dinámica (Indigo por defecto) */
  --accent-color: #6366f1;
  --accent-color-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-subtle: rgba(99, 102, 241, 0.12);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   PALETAS DE ACENTO PERSONALIZABLES
   ========================================================================== */
html[data-accent="indigo"] {
  --accent-color: #6366f1;
  --accent-color-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-subtle: rgba(99, 102, 241, 0.12);
}

html[data-accent="emerald"] {
  --accent-color: #10b981;
  --accent-color-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.4);
  --accent-subtle: rgba(16, 185, 129, 0.12);
}

html[data-accent="violet"] {
  --accent-color: #8b5cf6;
  --accent-color-hover: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.4);
  --accent-subtle: rgba(139, 92, 246, 0.12);
}

html[data-accent="cyan"] {
  --accent-color: #06b6d4;
  --accent-color-hover: #0891b2;
  --accent-glow: rgba(6, 182, 212, 0.4);
  --accent-subtle: rgba(6, 182, 212, 0.12);
}

html[data-accent="amber"] {
  --accent-color: #f59e0b;
  --accent-color-hover: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --accent-subtle: rgba(245, 158, 11, 0.12);
}

html[data-accent="rose"] {
  --accent-color: #f43f5e;
  --accent-color-hover: #e11d48;
  --accent-glow: rgba(244, 63, 94, 0.4);
  --accent-subtle: rgba(244, 63, 94, 0.12);
}

/* ==========================================================================
   CAPA DE FONDO PERSONALIZABLE (WALLPAPER LAYER)
   ========================================================================== */
body {
  background-color: transparent !important;
}

#app-wallpaper-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none !important;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.35) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 50% 40%, rgba(139, 92, 246, 0.2) 0%, transparent 60%),
    linear-gradient(135deg, #06080e 0%, #0d121f 50%, #06080e 100%);
  transition: background-image 0.4s ease, opacity 0.4s ease;
}

/* Tinte de fondo para garantizar contraste absoluto */
#app-wallpaper-tint {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none !important;
  transition: background-color 0.3s ease;
}

html.dark #app-wallpaper-tint {
  background-color: rgba(9, 11, 17, 0.82);
}

html.light #app-wallpaper-tint {
  background-color: rgba(248, 250, 252, 0.85);
}

/* ==========================================================================
   ESPECIFICACIÓN AUTÉNTICA DE LIQUID GLASS (GLASSKIT SPEC)
   ========================================================================== */
.liquid-glass-card {
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo Oscuro: Obsidian Glass */
html.dark .liquid-glass-card {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-top: 1px solid rgba(255, 255, 255, 0.3); /* Reflejo especular superior */
  box-shadow: 
    0 20px 40px -15px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.18); /* Bisel interno */
}

html.dark .liquid-glass-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.45);
}

/* Modo Claro: Crystal Frost */
html.light .liquid-glass-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 16px 32px -10px rgba(0, 0, 0, 0.08),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.8);
}

html.light .liquid-glass-card:hover {
  border-color: rgba(203, 213, 225, 1);
}

/* ==========================================================================
   UTILIDADES DINÁMICAS DE COLOR DE ACENTO
   ========================================================================== */
.btn-accent {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px -2px var(--accent-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-accent:hover {
  background-color: var(--accent-color-hover) !important;
  box-shadow: 0 6px 20px -2px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-accent:active {
  transform: translateY(1px) scale(0.99);
}

.text-accent {
  color: var(--accent-color) !important;
}

.border-accent {
  border-color: var(--accent-color) !important;
}

.bg-accent-subtle {
  background-color: var(--accent-subtle) !important;
}

/* ==========================================================================
   BOTONES DE OPCIÓN SELECCIONABLES (SELECTION CARDS PASO 2)
   Resuelven el bug de doble selección y se adaptan al acento personalizado.
   ========================================================================== */
.option-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(226, 232, 240, 0.85);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

html.dark .option-btn {
  background: rgba(24, 24, 27, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.option-btn:hover {
  border-color: rgba(203, 213, 225, 1);
  background: rgba(255, 255, 255, 0.7);
}

html.dark .option-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(39, 39, 42, 0.6);
}

/* Estado Seleccionado Único: Adopta 100% el color de acento dinámico */
.option-btn.active-option {
  border-color: var(--accent-color) !important;
  background-color: var(--accent-subtle) !important;
  box-shadow: 0 0 0 1px var(--accent-color), 0 4px 14px -2px var(--accent-glow) !important;
}

html.dark .option-btn.active-option {
  border-color: var(--accent-color) !important;
  background-color: var(--accent-subtle) !important;
  box-shadow: 0 0 0 1px var(--accent-color), 0 4px 16px -2px var(--accent-glow) !important;
}

/* ==========================================================================
   INDICADOR DESLIZANTE FLUIDO DE LA BARRA INFERIOR (FLUID SLIDING PILL)
   ========================================================================== */
.bottom-nav-container {
  overflow: hidden;
  background: rgba(14, 18, 30, 0.96) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.8), 0 0 24px rgba(99, 102, 241, 0.18) !important;
}

/* En Desktop/Laptop: Pestañas superiores limpias (Cero solapamiento con el formulario) */
@media (min-width: 641px) {
  .bottom-nav-container {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 auto 1.5rem auto !important;
    max-width: 540px !important;
    width: 100% !important;
    z-index: 20 !important;
  }
}

/* En Móvil: Barra flotante inferior ergonómica para pulgares */
@media (max-width: 640px) {
  .bottom-nav-container {
    position: fixed !important;
    bottom: 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 1.5rem) !important;
    max-width: 480px !important;
    z-index: 40 !important;
  }
}

#nav-active-pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 12px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: left 0.32s cubic-bezier(0.25, 1, 0.5, 1), width 0.32s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.2s ease, visibility 0.2s;
}

#nav-active-pill.pill-ready {
  opacity: 1;
  visibility: visible;
}

html.dark #nav-active-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

html.light #nav-active-pill {
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   MODALES DE COTIZACIÓN Y CHECKOUT YAPE (LIQUID GLASS)
   ========================================================================== */
#quote-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 8, 16, 0.82);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

#quote-modal-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: flex !important;
}

#quote-modal-backdrop:not(.active) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  display: none !important;
}

#yape-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 8, 16, 0.85);
  backdrop-filter: blur(26px) saturate(200%);
  -webkit-backdrop-filter: blur(26px) saturate(200%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

#yape-modal-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: flex !important;
}

#yape-modal-backdrop:not(.active) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  display: none !important;
}

.btn-accent:disabled,
#btn-open-quote-modal:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  filter: grayscale(20%) !important;
}

#quote-modal-backdrop .liquid-glass-card,
#yape-modal-backdrop .liquid-glass-card {
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#quote-modal-backdrop.active .liquid-glass-card,
#yape-modal-backdrop.active .liquid-glass-card {
  transform: scale(1) translateY(0);
}

/* Ocultar barra de depuración y popups flotantes de pruebas de Krypton/Izipay */
div[data-testid="toolbar"],
.kr-toolbar,
div[kr-debug-toolbar],
.kr-debug-bar,
.kr-popin-modal,
[class*="kr-toolbar"],
[class*="KryptonToolbar"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* Supresión de Cuotas y Pago Diferido: Cobro 100% Directo e Inmediato */
.kr-installment-number,
.kr-first-installment-delay,
div[kr-installment-number],
div[kr-first-installment-delay],
.kr-field-installment,
.kr-installment,
.kr-installments,
[class*="kr-installment"],
[class*="installment"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}


/* ==========================================================================
   ANIMACIÓN SUAVE DE PESTAÑAS (TABS)
   ========================================================================== */
@keyframes fluidFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-tab-pane {
  animation: fluidFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   SISTEMA DE DESPLAZAMIENTO FLUIDO (PC RUEDA & CELULAR 1 DEDO NATIVO)
   - html es el único contenedor de scroll de la ventana.
   - body tiene overflow-y: visible para jamás crear contenedores anidados.
   - touch-action: pan-y garantiza que en celular el arrastre con 1 dedo
     deslice fluidamente la pantalla sin requerir 2 dedos ni bloqueos.
   ========================================================================== */
html {
  overflow-x: hidden;
  overflow-y: auto !important;
  height: auto;
  min-height: 100%;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

body {
  overflow-x: hidden;
  overflow-y: visible !important;
  min-height: 100vh;
  touch-action: pan-y !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  overscroll-behavior-y: auto !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
}

/* Bloqueo estricto cuando no hay sesión iniciada o cuando un modal está abierto */
body.auth-locked,
body.modal-scroll-locked {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

html.auth-locked,
html.modal-scroll-locked {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

/* ==========================================================================
   ESPACIADO INFERIOR ADAPTATIVO EXACTO (AUTO-FIT BOTTOM CLEARANCE)
   Se adapta automáticamente a la altura exacta de la barra flotante inferior
   más un pequeño y elegante margen de separación (16px) sin huecos vacíos excesivos.
   ========================================================================== */
:root {
  --nav-bar-height: 56px;
  --nav-bar-offset: 16px;
  --nav-gap: 16px;
  --adaptive-bottom-clearance: calc(var(--nav-bar-height) + var(--nav-bar-offset) + var(--nav-gap) + env(safe-area-inset-bottom, 0px));
}

.pb-bottom-nav,
main#main-app-content {
  padding-bottom: max(var(--adaptive-bottom-clearance), 8.5rem) !important;
}

@media (max-width: 640px) {
  :root {
    --nav-bar-height: 58px;
    --nav-bar-offset: 14px;
    --nav-gap: 14px;
  }
}

/* ==========================================================================
   MODAL DE AUTENTICACIÓN INSTITUCIONAL UTP (LIQUID GLASS AUTH)
   Efecto Liquid Glass de alta gama, orbes de refracción, slider 60fps,
   protección estricta de iconos y pantalla de éxito satinada.
   ========================================================================== */
#auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 8, 16, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  overflow: hidden;
}

#auth-modal-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: flex !important;
}

#auth-modal-backdrop:not(.active) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  display: none !important;
}

/* Contenedor relativo para anclar los orbes de luz exactamente detrás del cristal */
.auth-card-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Orbes ambientales de luz líquida que refractan dentro del cristal */
.auth-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.auth-orb-primary {
  width: 270px;
  height: 270px;
  top: -30px;
  left: -25px;
  background: radial-gradient(circle, #6366f1 15%, #a855f7 55%, transparent 80%);
  animation: orbDriftPrimary 7s ease-in-out infinite alternate;
}

.auth-orb-secondary {
  width: 250px;
  height: 250px;
  bottom: -30px;
  right: -25px;
  background: radial-gradient(circle, #06b6d4 15%, #3b82f6 55%, transparent 80%);
  animation: orbDriftSecondary 8s ease-in-out infinite alternate;
}

@keyframes orbDriftPrimary {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(25px, 20px) scale(1.12); }
}

@keyframes orbDriftSecondary {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-20px, -20px) scale(1.15); }
}

/* Tarjeta Liquid Glass Auténtica (Apple VisionOS / GlassKit standard) */
.liquid-glass-auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  background: rgba(18, 24, 38, 0.68);
  backdrop-filter: blur(36px) saturate(210%);
  -webkit-backdrop-filter: blur(36px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 1.5px solid rgba(255, 255, 255, 0.55); /* Reflejo especular superior */
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 32px 64px -16px rgba(0, 0, 0, 0.85),
    0 0 45px -10px var(--accent-glow),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  overflow: hidden;
  transform: scale(0.93) translateY(12px);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

html.light .liquid-glass-auth-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-top: 1.5px solid #ffffff;
  box-shadow: 
    0 32px 64px -16px rgba(99, 102, 241, 0.2),
    0 4px 24px -4px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px 0 #ffffff;
}

#auth-modal-backdrop.active .liquid-glass-auth-card {
  transform: scale(1) translateY(0);
}

/* Brillo especular diagonal sobre el cristal */
.glass-glare-effect {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 45%, transparent 65%);
  pointer-events: none;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

html.light .glass-glare-effect {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.1) 45%, transparent 65%);
}

/* Botón cerrar modal con estilo de cristal esmerilado */
.auth-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: rotate(90deg) scale(1.05);
}

html.light .auth-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #64748b;
}

html.light .auth-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

/* Badge con icono institucional */
.auth-badge-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  transition: transform 0.25s ease;
}

.auth-badge-icon:hover {
  transform: scale(1.06);
}

html.light .auth-badge-icon {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 18px -4px rgba(99, 102, 241, 0.2);
}

/* Selector de pestañas conmutables */
.auth-tab-container {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 4px;
  backdrop-filter: blur(10px);
}

html.light .auth-tab-container {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.07);
}

.auth-tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--accent-color);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
  box-shadow: 0 4px 18px -2px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-top: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 11px;
  transition: transform 0.38s cubic-bezier(0.34, 1.38, 0.64, 1), box-shadow 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.auth-tab-pill.tab-register-active {
  transform: translateX(100%);
}

.auth-tab-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 9px 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  border-radius: 11px;
  transition: color 0.25s ease, transform 0.15s ease;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.auth-tab-btn:hover {
  color: #f1f5f9;
}

.auth-tab-btn:active {
  transform: scale(0.96);
}

.auth-tab-btn.active {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html.light .auth-tab-btn {
  color: #64748b;
}

html.light .auth-tab-btn:hover {
  color: #0f172a;
}

html.light .auth-tab-btn.active {
  color: #ffffff !important;
}

/* Transición de Paneles 60fps con Morphing de Altura y Profundidad Cinemática */
.auth-panes-viewport {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 100%;
  align-items: start;
  transition: height 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.auth-pane-slide {
  grid-area: 1 / 1;
  width: 100%;
  box-sizing: border-box;
  padding: 2px 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(24px) scale(0.97);
  filter: blur(4px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.3s ease,
              visibility 0.34s;
  will-change: transform, opacity, filter;
}

.auth-pane-slide.active-pane {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  filter: blur(0px);
}

.auth-pane-slide.exit-left {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-24px) scale(0.97);
  filter: blur(4px);
}

.auth-pane-slide.exit-right {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(24px) scale(0.97);
  filter: blur(4px);
}

/* Micro-cascada fluida para campos de entrada al conmutar pestañas */
@keyframes authFieldCascade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-pane-slide.active-pane form > * {
  animation: authFieldCascade 0.32s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.auth-pane-slide.active-pane form > *:nth-child(1) { animation-delay: 0.02s; }
.auth-pane-slide.active-pane form > *:nth-child(2) { animation-delay: 0.05s; }
.auth-pane-slide.active-pane form > *:nth-child(3) { animation-delay: 0.08s; }
.auth-pane-slide.active-pane form > *:nth-child(4) { animation-delay: 0.11s; }
.auth-pane-slide.active-pane form > *:nth-child(5) { animation-delay: 0.14s; }
.auth-pane-slide.active-pane form > *:nth-child(6) { animation-delay: 0.17s; }
.auth-pane-slide.active-pane form > *:nth-child(7) { animation-delay: 0.20s; }

/* Inputs de autenticación */
.auth-input-group {
  position: relative;
}

.auth-input-field {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 13px !important;
  padding: 11px 15px !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  color: inherit !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

html.light .auth-input-field {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(203, 213, 225, 0.9) !important;
  color: #0f172a !important;
}

.auth-input-field:focus {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

html.light .auth-input-field:focus {
  background: #ffffff !important;
  border-color: var(--accent-color) !important;
}

/* Iconos de input con anclaje absoluto EXACTO */
.auth-input-icon-left {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  pointer-events: none;
  z-index: 3;
  width: 18px;
  height: 18px;
}

.auth-input-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  z-index: 3;
  padding: 4px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-input-icon-right:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.1);
}

html.light .auth-input-icon-right:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.06);
}

/* Padding estricto para evitar 100% la colisión de iconos con texto o placeholders */
.auth-input-field.auth-input-with-icon-left {
  padding-left: 42px !important;
}

.auth-input-field.auth-input-with-icon-right {
  padding-right: 42px !important;
}

.auth-input-field.auth-input-with-icon-left.auth-input-with-icon-right {
  padding-left: 42px !important;
  padding-right: 42px !important;
}

/* Botón primario de autenticación */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent-color);
  box-shadow: 0 8px 22px -4px var(--accent-glow);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-top: 1.5px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, background-color 0.2s;
}

.auth-submit-btn:hover {
  background: var(--accent-color-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 12px 28px -4px var(--accent-glow);
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   PANTALLA DE ANIMACIÓN DE ÉXITO Y CONFIRMACIÓN FLUIDA (OVERLAY SATINADO)
   Cero sangrado del formulario inferior. Superficie pulida y ondas sonar.
   ========================================================================== */
#auth-success-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.75rem;
  background: linear-gradient(165deg, #111624 0%, #0c0f1a 100%);
  border-radius: 28px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

html.light #auth-success-screen {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

#auth-success-screen.active {
  display: flex;
  animation: authSuccessFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authSuccessFade {
  from { 
    opacity: 0; 
    transform: scale(0.94); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

/* Checkmark animado con ondas sonar concéntricas */
.success-checkmark-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.success-glow-halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
  opacity: 0.5;
  animation: haloPulse 2s ease-in-out infinite alternate;
}

@keyframes haloPulse {
  from { transform: scale(0.85); opacity: 0.35; }
  to { transform: scale(1.2); opacity: 0.7; }
}

.success-sonar-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  opacity: 0.8;
  animation: sonarWave 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  pointer-events: none;
}

.success-sonar-wave.wave-delayed {
  animation-delay: 0.7s;
}

@keyframes sonarWave {
  0% {
    transform: scale(0.7);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.success-badge-container {
  position: relative;
  z-index: 2;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-color) 0%, #1e1b4b 100%);
  box-shadow: 0 10px 25px -4px var(--accent-glow), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkmarkPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.checkmark-svg {
  width: 54px;
  height: 54px;
  display: block;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
  stroke: rgba(255, 255, 255, 0.4);
  fill: none;
  animation: strokeCircle 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 4;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  animation: strokeCheck 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.35s forwards;
}

@keyframes strokeCircle {
  100% { stroke-dashoffset: 0; }
}

@keyframes strokeCheck {
  100% { stroke-dashoffset: 0; }
}

@keyframes checkmarkPop {
  0% { transform: scale(0); opacity: 0; }
  65% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}


