/* ========================================
   REFUGIO - DESIGN TOKENS
   Sistema de diseño completo y consistente
   ======================================== */

:root {
  /* ===== COLORES PRIMARIOS ===== */
  --color-primary: #0B2E44;           /* Azul oscuro principal */
  --color-primary-light: #1A4A6B;     /* Azul medio */
  --color-primary-dark: #061B29;      /* Azul muy oscuro */

  --color-secondary: #D4B06A;         /* Albero dorado */
  --color-secondary-light: #E6C48B;   /* Albero claro */
  --color-secondary-dark: #C8A14A;    /* Albero oscuro */

  /* ===== COLORES DE SUPERFICIE ===== */
  --color-background: #F9F2E6;        /* Crema de fondo */
  --color-surface: #FFFFFF;           /* Blanco para cards */
  --color-surface-alt: #FFF9F0;       /* Blanco cálido alternativo */
  --color-overlay: rgba(11, 46, 68, 0.8); /* Overlay oscuro */

  /* ===== COLORES DE TEXTO ===== */
  --color-text-primary: #0B2E44;      /* Texto principal */
  --color-text-secondary: #666666;    /* Texto secundario */
  --color-text-tertiary: #757575;     /* Texto terciario (WCAG AA compliant) */
  --color-text-inverse: #FFFFFF;      /* Texto sobre fondo oscuro */
  --color-text-muted: #2C2416;        /* Texto suave marrón */

  /* ===== COLORES SEMÁNTICOS ===== */
  --color-success: #4CAF50;           /* Verde éxito */
  --color-success-light: #E8F5E9;     /* Verde claro */
  --color-warning: #FFA726;           /* Naranja advertencia */
  --color-warning-light: #FFF3E0;     /* Naranja claro */
  --color-error: #FF4444;             /* Rojo error */
  --color-error-light: #FFEBEE;       /* Rojo claro */
  --color-info: #2196F3;              /* Azul información */
  --color-info-light: #E3F2FD;        /* Azul claro */

  /* ===== COLORES DE ACENTO ===== */
  --color-gold: #FFD700;              /* Dorado logros */
  --color-gold-dark: #FFA500;         /* Dorado oscuro */
  --color-chat-bubble: #E8D4B0;       /* Beige chat */
  --color-liturgical: #E6B85C;        /* Albero litúrgico */
  --color-purple: #3E2758;            /* Morado especial */

  /* ===== GRADIENTES ===== */
  --gradient-hero: linear-gradient(135deg, #0B2E44 0%, #1A4A6B 100%);
  --gradient-hero-premium: linear-gradient(145deg, #0B2E44 0%, #1A4A6B 40%, #2D5F80 100%);
  --gradient-warm: linear-gradient(135deg, #FFFFFF 0%, #FFF9F0 100%);
  --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  --gradient-completed: linear-gradient(135deg, #FFFFFF 0%, #FFF9F0 100%);
  --gradient-prayer-bg: linear-gradient(135deg, rgba(11, 46, 68, 0.98) 0%, rgba(26, 58, 92, 0.95) 50%, rgba(11, 46, 68, 0.98) 100%);
  --gradient-card-hover: linear-gradient(145deg, rgba(212, 176, 106, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);

  /* ===== TIPOGRAFÍA ===== */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-sacred: 'Lora', Georgia, 'Times New Roman', serif;

  /* Tamaños de fuente */
  --font-size-xs: 11px;               /* Extra pequeño */
  --font-size-sm: 12px;               /* Pequeño */
  --font-size-base: 13px;             /* Base */
  --font-size-md: 15px;               /* Mediano */
  --font-size-lg: 16px;               /* Grande */
  --font-size-xl: 18px;               /* Extra grande */
  --font-size-2xl: 20px;              /* 2X grande */
  --font-size-3xl: 24px;              /* 3X grande */
  --font-size-4xl: 28px;              /* 4X grande */
  --font-size-hero: 32px;             /* Hero títulos */
  --font-size-display: 36px;          /* Display grande */

  /* Pesos de fuente */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 800;           /* Títulos impactantes */

  /* Alturas de línea */
  --line-height-tight: 1.2;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.6;

  /* ===== ESPACIADO ===== */
  /* Sistema de 4px */
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-7: 28px;
  --spacing-8: 32px;
  --spacing-10: 40px;
  --spacing-12: 48px;
  --spacing-16: 64px;

  /* Espaciado premium para secciones */
  --spacing-section: 48px;            /* Entre secciones */
  --spacing-card-gap: 20px;           /* Gap entre cards */
  --spacing-hero-padding: 32px;       /* Padding del hero */

  /* ===== BORDES ===== */
  --border-radius-sm: 8px;            /* Pequeño */
  --border-radius-md: 12px;           /* Mediano */
  --border-radius-lg: 16px;           /* Grande */
  --border-radius-xl: 20px;           /* Extra grande */
  --border-radius-2xl: 24px;          /* Premium cards */
  --border-radius-3xl: 32px;          /* Hero sections */
  --border-radius-full: 50%;          /* Círculo completo */

  --border-width-thin: 1px;
  --border-width-medium: 2px;
  --border-width-thick: 3px;

  --border-color: #E0E0E0;
  --border-color-light: #F0F0F0;
  --border-color-dark: #CCCCCC;

  /* ===== SOMBRAS ===== */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.10);
  --shadow-2xl: 0 16px 48px rgba(0, 0, 0, 0.12);

  /* Sombras atmosféricas premium */
  --shadow-card: 0 4px 20px rgba(11, 46, 68, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(11, 46, 68, 0.12);
  --shadow-gold: 0 4px 16px rgba(212, 176, 106, 0.25);
  --shadow-gold-glow: 0 8px 24px rgba(212, 176, 106, 0.35);
  --shadow-gold-soft: 0 4px 20px rgba(212, 176, 106, 0.15);
  --shadow-completed: 0 6px 24px rgba(212, 176, 106, 0.25);
  --shadow-hero: 0 12px 40px rgba(11, 46, 68, 0.15);

  /* ===== TRANSICIONES ===== */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-very-slow: 0.5s ease;
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);

  /* ===== Z-INDEX ===== */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-notification: 800;

  /* ===== DIMENSIONES ===== */
  --navbar-height: 60px;
  --hero-height-sm: 140px;
  --hero-height-md: 160px;
  --hero-height-lg: 180px;

  --avatar-size-sm: 32px;
  --avatar-size-md: 40px;
  --avatar-size-lg: 64px;
  --avatar-size-xl: 96px;

  --icon-size-sm: 20px;
  --icon-size-md: 24px;
  --icon-size-lg: 40px;
  --icon-size-xl: 56px;

  --button-height-sm: 36px;
  --button-height-md: 44px;
  --button-height-lg: 52px;

  /* ===== BREAKPOINTS (para referencia en media queries) ===== */
  /* Se usan directamente en @media, no como variables */
  /* --breakpoint-sm: 576px; */
  /* --breakpoint-md: 768px; */
  /* --breakpoint-lg: 992px; */
  /* --breakpoint-xl: 1200px; */

  /* ===== OPACIDADES ===== */
  --opacity-disabled: 0.5;
  --opacity-hover: 0.8;
  --opacity-subtle: 0.15;
  --opacity-medium: 0.6;

  /* ===== COLORES DE FONDO PARA ESTADOS ===== */
  --bg-hover: rgba(11, 46, 68, 0.05);
  --bg-active: rgba(11, 46, 68, 0.1);
  --bg-selected: rgba(212, 176, 106, 0.15);
  --bg-disabled: #F5F5F5;
}

/* ===== UTILIDADES DE ACCESIBILIDAD ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== RESET DE FUENTES ===== */
body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
}

/* ===== CLASES UTILITARIAS DE TEXTO ===== */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-inverse { color: var(--color-text-inverse); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ===== TIPOGRAFÍA SAGRADA ===== */
.font-sacred {
  font-family: var(--font-family-sacred);
}

/* Estilo para textos bíblicos/sagrados */
.sacred-text {
  font-family: var(--font-family-sacred);
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--color-text-primary);
}

/* Primera letra decorativa (drop cap) */
.sacred-text.with-dropcap::first-letter {
  float: left;
  font-size: 3.5em;
  line-height: 0.8;
  padding-right: 8px;
  padding-top: 4px;
  font-weight: 600;
  color: var(--color-primary);
}

/* Citas bíblicas */
.bible-verse {
  font-family: var(--font-family-sacred);
  font-style: italic;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  border-left: 3px solid var(--color-secondary);
  padding-left: var(--spacing-4);
  margin: var(--spacing-4) 0;
}

/* ===== CLASES UTILITARIAS DE EFECTOS PREMIUM ===== */

/* Glassmorphism - Efecto vidrio */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(11, 46, 68, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== ANIMACIONES PREMIUM ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Clases de animación */
.animate-fadeInUp {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Delays escalonados para listas */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ===== EXAMEN: TRANSICIONES DE VISTA ===== */
@keyframes examenFadeIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.examen-view-enter {
  animation: examenFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== EXAMEN: SECCIÓN DESPLEGABLE ===== */
.examen-section-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
}

.examen-section-content.expanded {
  max-height: 2000px;
  opacity: 1;
}

.examen-chevron {
  transition: transform 0.2s ease;
}

.examen-chevron.rotated {
  transform: rotate(180deg);
}

/* ===== COMENTARIOS DE USO ===== */
/*
EJEMPLOS DE USO:

1. Colores:
   background: var(--color-primary);
   color: var(--color-text-secondary);
   border-color: var(--border-color);

2. Espaciado:
   padding: var(--spacing-4);
   margin-bottom: var(--spacing-6);
   gap: var(--spacing-2);

3. Tipografía:
   font-size: var(--font-size-lg);
   font-weight: var(--font-weight-semibold);
   line-height: var(--line-height-relaxed);

4. Bordes:
   border-radius: var(--border-radius-lg);
   border: var(--border-width-thin) solid var(--border-color);

5. Sombras:
   box-shadow: var(--shadow-lg);

6. Transiciones:
   transition: all var(--transition-normal);

7. Gradientes:
   background: var(--gradient-hero);
*/

/* ========================================
   DESIGN SYSTEM v2 — ADDITIONS (Abril 2026)
   Nuevos tokens para loading branded, a11y,
   estados unificados y microinteracciones.
   ======================================== */

:root {
  /* ===== SKELETON BRANDED ===== */
  --color-skeleton-bg: #F0E6D4;
  --color-skeleton-highlight: #FAF3E3;
  --color-skeleton-bg-dark: #2A2218;
  --color-skeleton-highlight-dark: #3A3020;

  /* ===== ACCESIBILIDAD ===== */
  --min-tap-target: 44px;
  --focus-ring: 0 0 0 3px rgba(212, 176, 106, 0.35);
}

/* ===== ANIMACIONES v2 ===== */

@keyframes breath {
  0%, 100% { transform: scale(0.96); opacity: 0.82; }
  50% { transform: scale(1.02); opacity: 1; }
}

@keyframes shimmer-slow {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes verse-fade-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== LOADING CONTEMPLATIVO (paloma + versículo) ===== */

.loading-contemplative {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-4);
  padding: var(--spacing-10) var(--spacing-4);
  min-height: 240px;
  text-align: center;
}

.loading-contemplative__icon {
  width: 56px;
  height: 56px;
  color: var(--color-secondary);
  animation: breath 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: transform, opacity;
}

.loading-contemplative__verse {
  font-family: var(--font-family-sacred);
  font-style: italic;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  max-width: 300px;
  line-height: var(--line-height-relaxed);
  animation: verse-fade-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

/* ===== SKELETON BRANDED ===== */

.skeleton-branded {
  background: linear-gradient(
    90deg,
    var(--color-skeleton-bg) 25%,
    var(--color-skeleton-highlight) 50%,
    var(--color-skeleton-bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer-slow 2.5s ease-in-out infinite;
  border-radius: var(--border-radius-sm);
  will-change: background-position;
}

.theme-dark .skeleton-branded,
.dark .skeleton-branded {
  background: linear-gradient(
    90deg,
    var(--color-skeleton-bg-dark) 25%,
    var(--color-skeleton-highlight-dark) 50%,
    var(--color-skeleton-bg-dark) 75%
  );
  background-size: 200% 100%;
}

/* ===== EMPTY STATE v2 ===== */

.empty-state-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-10) var(--spacing-5);
  gap: var(--spacing-3);
}

.empty-state-v2__icon {
  width: 64px;
  height: 64px;
  color: var(--color-secondary);
  margin-bottom: var(--spacing-2);
  opacity: 0.85;
}

.empty-state-v2__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
  line-height: var(--line-height-tight);
}

.empty-state-v2__subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 320px;
  line-height: var(--line-height-relaxed);
}

.empty-state-v2__cta {
  margin-top: var(--spacing-4);
  padding: 12px 24px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  min-height: var(--min-tap-target);
  min-width: var(--min-tap-target);
  transition: transform var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
}

.empty-state-v2__cta:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.empty-state-v2__cta:active {
  transform: translateY(0);
}

.empty-state-v2__cta:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ===== ERROR STATE v2 ===== */

.error-state-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-10) var(--spacing-5);
  gap: var(--spacing-3);
}

.error-state-v2__icon {
  width: 56px;
  height: 56px;
  color: var(--color-secondary);
  margin-bottom: var(--spacing-2);
  opacity: 0.9;
}

.error-state-v2__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
  line-height: var(--line-height-tight);
}

.error-state-v2__subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 320px;
  line-height: var(--line-height-relaxed);
}

.error-state-v2__cta {
  margin-top: var(--spacing-4);
  padding: 12px 24px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  min-height: var(--min-tap-target);
  min-width: var(--min-tap-target);
  transition: transform var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
}

.error-state-v2__cta:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.error-state-v2__cta:active {
  transform: translateY(0);
}

.error-state-v2__cta:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ===== UI ICON (sistema branded SVG) ===== */

.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  flex-shrink: 0;
  color: currentColor;
  vertical-align: middle;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ui-icon--sm { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.ui-icon--lg { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.ui-icon--xl { width: var(--icon-size-xl); height: var(--icon-size-xl); }

/* ===== FOCUS VISIBLE GLOBAL (a11y) =====
   Cualquier elemento interactivo enfocado por teclado muestra el focus ring
   branded. !important porque muchos selectores usan `outline: none` para
   estilos custom y queremos asegurar que la accesibilidad por teclado
   no se pierde. Solo aplica para keyboard focus (focus-visible),
   no para mouse click. */

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: none !important;
  box-shadow: var(--focus-ring) !important;
  border-radius: var(--border-radius-sm);
}

/* ===== TAP TARGET GUARANTEE ===== */

.tap-target {
  min-width: var(--min-tap-target);
  min-height: var(--min-tap-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== PRESS STATE GLOBAL =====
   Feedback táctil para botones de marca y CTAs principales.
   Solo aplica a clases reconocibles de botón primario, sin pisar otros
   active states custom. Acompañado de transition rápida para que el feedback
   sea perceptible sin parecer lento. */

.profile-setting-item:active,
.profile-logout-btn:active,
.empty-state-v2__cta:active,
.error-state-v2__cta:active,
.profile-setting-cta:active,
.profile-toast:active,
.tile:active,
.hero-bell-btn:active,
.hero-profile-btn:active {
  transform: scale(0.97);
  transition: transform 80ms ease;
}

/* Tokens-driven transitions: sustituir transitions inline 0.2s ease aplicando
   esta clase utilitaria. */
.transition-fast { transition: all var(--transition-fast); }
.transition-normal { transition: all var(--transition-normal); }
.transition-slow { transition: all var(--transition-slow); }

@media (prefers-reduced-motion: reduce) {
  .profile-setting-item:active,
  .profile-logout-btn:active,
  .empty-state-v2__cta:active,
  .error-state-v2__cta:active,
  .profile-setting-cta:active,
  .profile-toast:active,
  .tile:active,
  .hero-bell-btn:active,
  .hero-profile-btn:active {
    transform: none !important;
  }
}

/* ==========================================
   LOADING "VIVO" — Vela + Máquina de escribir
   Sustituyen al patrón skeleton genérico.
   El CSS de skeleton se mantiene como fallback
   pero la API ya no lo usa por defecto.
   ========================================== */

@keyframes candle-ignite {
  0%    { opacity: 0; transform: translateY(3px) scale(0.15); }
  18%   { opacity: 0.4; transform: translateY(2px) scale(0.35); }
  36%   { opacity: 0.8; transform: translateY(1px) scale(0.65); }
  60%   { opacity: 0.95; transform: translateY(0) scale(0.92); }
  100%  { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes candle-flicker {
  0%, 100% { transform: scaleY(1) scaleX(1); filter: brightness(1); }
  22%      { transform: scaleY(1.05) scaleX(0.96); filter: brightness(1.08); }
  44%      { transform: scaleY(0.97) scaleX(1.02); filter: brightness(0.94); }
  68%      { transform: scaleY(1.02) scaleX(0.98); filter: brightness(1.05); }
}

@keyframes candle-halo-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.58; }
}

@keyframes candle-wick-glow {
  0%   { stroke: #2A1F10; }
  12%  { stroke: #FF6B00; }
  38%  { stroke: #C27427; }
  100% { stroke: #6B4A20; }
}

@keyframes cursor-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.loading-candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  padding: var(--spacing-10) var(--spacing-5);
  min-height: 280px;
  text-align: center;
}

.loading-candle__svg {
  width: 80px;
  height: 130px;
  flex-shrink: 0;
}

.loading-candle__flame,
.loading-candle__flame-core {
  transform-origin: 40px 40px;
  opacity: 0;
  animation: candle-ignite 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards,
             candle-flicker 2.4s ease-in-out 1.55s infinite;
  will-change: transform, opacity;
}

.loading-candle__halo {
  transform-origin: center;
  opacity: 0;
  animation: candle-ignite 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.25s forwards,
             candle-halo-pulse 3.2s ease-in-out 1.85s infinite;
  will-change: opacity;
}

.loading-candle__wick {
  animation: candle-wick-glow 1.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

.loading-candle__caption {
  font-family: var(--font-family-sacred);
  font-style: italic;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  max-width: 300px;
  line-height: var(--line-height-relaxed);
  margin: 0;
  animation: verse-fade-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.9s both;
}

.loading-typewriter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-4);
  padding: var(--spacing-10) var(--spacing-5);
  min-height: 200px;
  text-align: center;
}

.loading-typewriter__text {
  font-family: var(--font-family-sacred);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  line-height: var(--line-height-relaxed);
  max-width: 460px;
  min-height: 2.4em;
  margin: 0;
  white-space: pre-wrap;
  letter-spacing: 0.01em;
}

.loading-typewriter__cursor {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 3px;
  background: var(--color-secondary);
  vertical-align: text-bottom;
  animation: cursor-blink 1s steps(2) infinite;
  border-radius: 1px;
}

.loading-typewriter__meta {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .loading-candle__flame,
  .loading-candle__flame-core,
  .loading-candle__halo,
  .loading-candle__wick,
  .loading-candle__caption {
    animation: none !important;
    opacity: 1 !important;
  }
  .loading-typewriter__cursor {
    animation: none !important;
    opacity: 1;
  }
  .loading-contemplative__icon {
    animation: none !important;
  }
  .skeleton-branded {
    animation: none !important;
    background: var(--color-skeleton-bg) !important;
  }
}

/* ==========================================
   Scrollbar oculta globalmente (pattern app móvil/PWA)
   ========================================== */

html, body {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legacy */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;                  /* Chrome / Safari / Edge moderno */
}

