/* ==============================================================================
   DEVCONTABLE - Core CSS (Design Tokens, Dark/Light Theme & Utilities)
   Optimizado para 100/100 en Google PageSpeed y Web Vitals
   ============================================================================== */

/* Autoalojamiento de Fuentes Locales (OFL 1.1 - Cero peticiones externas) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/public/assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/public/assets/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/public/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/public/assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Tema Claro (Editorial Minimalista - Marca C) */
  --bg-base: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --border-color: #E4E4E7;
  --text-main: #111111;
  --text-muted: #52525B;
  --accent-gold: #1D4ED8;
  --accent-gold-dark: #1E40AF;
  --accent-emerald: #059669;
  --accent-emerald-light: #10B981;
  --shadow-card: 0 4px 20px -2px rgba(17, 17, 17, 0.05);
}

.dark {
  /* Tema Oscuro (Editorial Minimalista - Marca C) */
  --bg-base: #121214;
  --bg-surface: #18181B;
  --bg-surface-elevated: #27272A;
  --border-color: #27272A;
  --text-main: #FAFAFA;
  --text-muted: #A1A1AA;
  --accent-gold: #60A5FA;
  --accent-gold-dark: #3B82F6;
  --accent-emerald: #10B981;
  --accent-emerald-light: #34D399;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light dark;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  max-width: 100vw;
}

svg.w-2, .w-2 { width: 0.5rem; }
svg.w-3, .w-3 { width: 0.75rem; }
svg.w-3\.5, .w-3\.5 { width: 0.875rem !important; }
svg.h-3\.5, .h-3\.5 { height: 0.875rem !important; }
svg.w-4, .w-4 { width: 1rem; }
svg.h-4, .h-4 { height: 1rem; }
svg.w-5, .w-5 { width: 1.25rem; }
svg.h-5, .h-5 { height: 1.25rem; }
svg.w-6, .w-6 { width: 1.5rem; }
svg.h-6, .h-6 { height: 1.5rem; }
svg.w-7, .w-7 { width: 1.75rem; }
svg.h-7, .h-7 { height: 1.75rem; }
svg.w-8, .w-8 { width: 2rem; }
svg.h-8, .h-8 { height: 2rem; }
svg.w-10, .w-10 { width: 2.5rem; }
svg.h-10, .h-10 { height: 2.5rem; }
svg.w-12, .w-12 { width: 3rem; }
svg.h-12, .h-12 { height: 3rem; }
svg.w-14, .w-14 { width: 3.5rem; }
svg.h-14, .h-14 { height: 3.5rem; }
svg.w-16, .w-16 { width: 4rem; }
svg.h-16, .h-16 { height: 4rem; }

/* Tipografía y Números Financieros */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Contenedores */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) { .container { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-left: 2rem; padding-right: 2rem; } }

/* Utilidades de Scroll Personalizadas */
.overflow-x-auto {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* DEVCONTABLE Chat Widget & Mobile Viewport Rules */
#devcontable-chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
}

#btn-chat-burbuja {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#devcontable-chat-window {
  z-index: 99999;
  background-color: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
}

.dark #devcontable-chat-window {
  background-color: #0b1329 !important;
  color: #f8fafc !important;
  border-color: #1e293b !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8) !important;
}

#chat-header {
  background-color: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.dark #chat-header {
  background-color: #0f172a !important;
  border-bottom: 1px solid #1e293b !important;
}

#chat-messages {
  background-color: #ffffff !important;
}

.dark #chat-messages {
  background-color: #020617 !important;
}

#chat-form-container {
  background-color: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

.dark #chat-form-container {
  background-color: #0f172a !important;
  border-top: 1px solid #1e293b !important;
}

@media (max-width: 639px) {
  #devcontable-chat-window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
}

@media (min-width: 640px) {
  #devcontable-chat-window {
    position: fixed !important;
    bottom: 84px !important;
    right: 20px !important;
    width: 380px !important;
    max-width: calc(100vw - 40px) !important;
    height: 560px !important;
    max-height: calc(100vh - 100px) !important;
    border-radius: 1.25rem !important;
  }
}

#chat-send-btn, #chat-close-btn {
  min-width: 44px;
  min-height: 44px;
}

/* Accesibilidad WCAG 2.2: Foco Visible y Respeto a Movimiento Reducido */
:focus-visible {
  outline: 2px solid #f59e0b !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }

.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-xl { max-width: 36rem; width: 100%; }
.max-w-2xl { max-width: 42rem; width: 100%; }
.max-w-3xl { max-width: 48rem; width: 100%; }
.max-w-4xl { max-width: 56rem; width: 100%; }
.max-w-5xl { max-width: 64rem; width: 100%; }
.max-w-7xl { max-width: 80rem; width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Espaciados */
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* Bordes y Bordes Redondeados */
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; border-style: solid; border-color: var(--border-color); }
.border-t { border-top-width: 1px; border-style: solid; border-color: var(--border-color); }
.border-b { border-bottom-width: 1px; border-style: solid; border-color: var(--border-color); }

/* Gradientes Especiales */
.bg-gradient-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 40%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tarjetas y Componentes */
.card-dev {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-dev:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 12px 30px -5px rgba(245, 158, 11, 0.12);
}

/* Botones */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #020617;
  text-decoration: none;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(245, 158, 11, 0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--text-muted);
}

/* Switch Theme Button */
.theme-switch-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-switch-btn:hover {
  background-color: var(--bg-surface);
  border-color: var(--accent-gold);
}

/* Badges */
.badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-emerald {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Animaciones Suaves */
@keyframes sweep {
  0% { transform: translateX(-100%) skewX(-20deg); }
  100% { transform: translateX(200%) skewX(-20deg); }
}

.animate-sweep {
  animation: sweep 4s ease-in-out infinite;
}

/* DEVCONTABLE - Botón Mostrar / Ocultar Contraseña Accesible */
.btn-mostrar-clave {
  position: absolute !important;
  right: 0.375rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  -webkit-transform: translateY(-50%) !important;
  width: 2.75rem !important;
  height: 2.75rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  z-index: 10 !important;
  padding: 0 !important;
  margin: 0 !important;
}



