/* ==========================================================================
   GRUPO LOSIGO (losigo.pro) - DESIGN TOKENS & SYSTEM FOUNDATION
   Modo Oscuro Ejecutivo · Paleta Obsidiana, Ámbar Fénix y Bronce Champán
   ========================================================================== */

:root {
  /* Paleta Principal - Modo Oscuro Ejecutivo */
  --bg-black: #000000;
  --bg-obsidian: #080502;
  --bg-surface: rgba(22, 13, 5, 0.78);
  --bg-surface-elevated: rgba(32, 19, 8, 0.88);
  --bg-surface-hover: rgba(45, 27, 12, 0.92);

  /* Acentos Fénix y Bronce */
  --fenix-orange: #ff7e00;
  --fenix-amber: #ff9a2e;
  --bronze-champagne: #f2b469;
  --champagne-light: #f3dcb0;
  --gold-warm: #c98a45;
  --copper-deep: #8c5828;

  /* Bordes y Reflejos */
  --border-subtle: rgba(242, 180, 105, 0.18);
  --border-card: rgba(242, 180, 105, 0.26);
  --border-focus: rgba(255, 154, 46, 0.65);
  --border-gold: rgba(243, 220, 176, 0.45);

  /* Resplandores y Sombras */
  --glow-orange: 0 0 35px rgba(255, 126, 0, 0.28);
  --glow-orange-lg: 0 0 65px rgba(255, 126, 0, 0.38);
  --glow-amber: 0 0 25px rgba(242, 180, 105, 0.22);
  --shadow-elevation: 0 16px 40px -10px rgba(0, 0, 0, 0.85);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.6);

  /* Tipografías */
  --font-editorial: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Jerarquía de Texto (WCAG AA High Contrast) */
  --text-white: #ffffff;
  --text-champagne: #f3dcb0;
  --text-muted: rgba(255, 255, 255, 0.84);
  --text-dim: rgba(255, 255, 255, 0.65);
  --text-accent: #ff9a2e;

  /* Tipografía Fluida con clamp() - Zero Information Loss */
  --text-xs: clamp(0.72rem, 0.8vw, 0.85rem);
  --text-sm: clamp(0.85rem, 1vw, 0.95rem);
  --text-base: clamp(0.98rem, 1.2vw, 1.12rem);
  --text-md: clamp(1.12rem, 1.5vw, 1.3rem);
  --text-lg: clamp(1.3rem, 2vw, 1.65rem);
  --text-xl: clamp(1.65rem, 2.8vw, 2.25rem);
  --text-2xl: clamp(2.1rem, 3.8vw, 3.1rem);
  --text-hero: clamp(2.3rem, 4.8vw, 4.2rem);

  /* Espaciado Fluido */
  --space-2xs: clamp(4px, 0.4vw, 6px);
  --space-xs: clamp(8px, 0.8vw, 12px);
  --space-sm: clamp(12px, 1.2vw, 18px);
  --space-md: clamp(18px, 2vw, 28px);
  --space-lg: clamp(28px, 3.2vw, 48px);
  --space-xl: clamp(44px, 5vw, 76px);
  --space-2xl: clamp(64px, 7vw, 110px);

  /* Layout y Contenedores */
  --container-max: 1280px;
  --container-padding: clamp(18px, 4vw, 36px);
  --header-height: clamp(68px, 7vw, 82px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 9999px;

  /* Transiciones */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   PALETA OFICIAL MODO CLARO ("MARFIL EDITORIAL & BRONCE EJECUTIVO")
   html[data-theme="light"]
   ========================================================================== */
html[data-theme="light"] {
  /* Fondos Principales */
  --bg-black: #FAF7F2;
  --bg-obsidian: #FAF7F2;
  --bg-surface: #F2ECE1;
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-hover: #EAE2D3;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(250, 247, 242, 0.88);

  /* Textos (Alto Contraste WCAG AA) */
  --text-white: #18120B;
  --text-primary: #18120B;
  --text-secondary: #43392F;
  --text-muted: #43392F;
  --text-dim: #6E5F50;
  --text-champagne: #7A4E1D;
  --champagne-light: #7A4E1D;
  --text-accent: #A84300;

  /* Acentos y Bordes (WCAG AA Contraste > 5.2:1 sobre fondo claro) */
  --fenix-orange: #A84300;
  --fenix-amber: #8F4900;
  --bronze-champagne: #8F4900;
  --gold-warm: #8F4900;
  --copper-deep: #5C320E;
  --border-subtle: rgba(143, 73, 0, 0.2);
  --border-card: rgba(143, 73, 0, 0.25);
  --border-focus: rgba(168, 67, 0, 0.7);
  --border-gold: rgba(168, 67, 0, 0.4);

  /* Sombras Ejecutivas de Alta Calidad */
  --glow-orange: 0 4px 20px rgba(217, 95, 0, 0.18);
  --glow-orange-lg: 0 8px 32px rgba(217, 95, 0, 0.25);
  --glow-amber: 0 4px 18px rgba(184, 107, 17, 0.15);
  --shadow-elevation: 0 12px 32px rgba(24, 18, 11, 0.08);
  --shadow-card: 0 12px 32px rgba(24, 18, 11, 0.06);
}

html[data-theme="light"] ::-webkit-scrollbar-track {
  background: #F2ECE1;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(184, 107, 17, 0.35);
  border: 2px solid #F2ECE1;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 95, 0, 0.6);
}

/* Botón Conmutador de Tema (Theme Toggle) */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 14px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.theme-toggle-btn:hover {
  background: rgba(255, 126, 0, 0.15);
  border-color: var(--fenix-orange);
  color: var(--fenix-amber);
}

.theme-toggle-btn .theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-theme="light"] .theme-toggle-btn {
  background: rgba(184, 107, 17, 0.09);
  border-color: rgba(184, 107, 17, 0.28);
  color: #18120B;
}

html[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(217, 95, 0, 0.14);
  border-color: var(--fenix-orange);
  color: var(--fenix-orange);
}

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

html {
  overflow-x: hidden;
  max-width: 100vw;
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg-black);
  color: var(--text-muted);
  font-family: var(--font-ui);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Selección de Texto con Estilo de Marca */
::selection {
  background: rgba(255, 126, 0, 0.4);
  color: var(--text-champagne);
}

/* Barra de Desplazamiento Personalizada */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #050302;
}
::-webkit-scrollbar-thumb {
  background: rgba(242, 180, 105, 0.28);
  border-radius: 5px;
  border: 2px solid #050302;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 154, 46, 0.55);
}

/* Enlaces y Botones Base */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Regla Estricta: Áreas Táctiles Mínimas de 48px */
button, .btn, a.btn, input, select, textarea {
  min-height: 48px;
}

/* Utilidad Contenedor General */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}
