/* ==========================================================================
   Grupo Autoniza - Apex Design System & Corporate Stylesheet
   Compatible with Google Stitch Project: Portal Corporativo Regional Autoniza
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,300..900;1,300..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

:root {
  --primary: #e10b17;
  --primary-dark: #b4000d;
  --primary-glow: rgba(225, 11, 23, 0.35);
  --secondary: #005691;
  --secondary-dark: #003e6b;
  --accent-electric: #0ea5e9;
  --status-gold: #ceb60c;
  --status-teal: #0f766e;
  
  /* Light theme default */
  --bg-body: #fcf9f8;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #f1f5f9;
  --border-subtle: #e2e8f0;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-body: #334155;
  --nav-bg: #000000;
  --nav-text: #ffffff;
}

html.dark {
  --bg-body: #0c121e;
  --bg-card: #131b2a;
  --bg-subtle: #161c28;
  --bg-muted: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --text-body: #cbd5e1;
  --primary-glow: rgba(224, 30, 38, 0.45);
}

/* Flag vector icons styling - strict sizing with !important to prevent flex stretch */
.flag-icon, img[src*="flags/"] {
  display: inline-block !important;
  width: 20px !important;
  max-width: 20px !important;
  height: 14px !important;
  max-height: 14px !important;
  object-fit: cover !important;
  border-radius: 3px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}
.flag-icon-sm, img[src*="flags/"].flag-icon-sm {
  display: inline-block !important;
  width: 16px !important;
  max-width: 16px !important;
  height: 11px !important;
  max-height: 11px !important;
  object-fit: cover !important;
  border-radius: 2px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}
.flag-icon-lg, img[src*="flags/"].flag-icon-lg {
  display: inline-block !important;
  width: 32px !important;
  max-width: 32px !important;
  height: 22px !important;
  max-height: 22px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

/* Base resets & typography */
html, body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-body);
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

/* Safe area padding for mobile notches & home indicators */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.pt-safe {
  padding-top: env(safe-area-inset-top, 0px);
}

/* Material Symbols alignment helper */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}
.material-symbols-filled {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
html.dark ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Aero-glassmorphism */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
html.dark .glass-panel {
  background: rgba(19, 27, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Comprehensive Dark & Light Contrast Engine (Guarantees zero disappearing elements)
   ========================================================================== */

/* Theme Toggle Button Enhancement */
.theme-toggle-btn {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1.5px solid transparent;
}

/* Light mode appearance of toggle button in header */
html:not(.dark) .theme-toggle-btn {
  background: #1e293b;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
}
html:not(.dark) .theme-toggle-btn:hover {
  background: #0f172a;
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}
html:not(.dark) .theme-toggle-btn .theme-toggle-badge {
  background: #334155;
  color: #fbbf24;
}

/* Dark mode appearance of toggle button in header */
html.dark .theme-toggle-btn {
  background: #0f172a;
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.2);
}
html.dark .theme-toggle-btn:hover {
  background: #1e293b;
  border-color: #fbbf24;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
  transform: translateY(-1px);
}
html.dark .theme-toggle-btn .theme-toggle-badge {
  background: #fbbf24;
  color: #0f172a;
}

.theme-toggle-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}
.theme-toggle-btn:hover .theme-toggle-badge {
  transform: rotate(20deg) scale(1.08);
}

/* GLOBAL DARK MODE ENFORCEMENT */
html.dark,
html.dark body {
  background-color: #0c121e !important;
  color: #cbd5e1 !important;
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6 {
  color: #f8fafc !important;
}

html.dark p,
html.dark li {
  color: #cbd5e1;
}

html.dark .text-text-primary,
html.dark .dark-text-white {
  color: #f8fafc !important;
}

html.dark .text-text-body {
  color: #cbd5e1 !important;
}

html.dark .text-text-muted,
html.dark .dark-text-muted {
  color: #94a3b8 !important;
}

/* Backgrounds in dark mode */
html.dark .bg-surface,
html.dark .dark-bg-main {
  background-color: #0c121e !important;
  background-image: none !important;
}

html.dark .bg-surface-subtle,
html.dark .dark-bg-surface {
  background-color: #0f1624 !important;
  background-image: none !important;
}

html.dark .bg-surface-muted,
html.dark .dark-bg-muted {
  background-color: #1e293b !important;
}

html.dark .bg-white {
  background-color: #131b2a !important;
}

html.dark .dark-bg-card,
html.dark .brand-card {
  background-color: #131b2a !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html.dark .dark-border,
html.dark .border-border-hairline {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Accordions (Details) in dark mode */
html.dark details {
  background-color: #162032 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
html.dark details summary {
  color: #f8fafc !important;
}
html.dark details p,
html.dark details strong {
  color: #cbd5e1 !important;
}

/* Form inputs & controls in dark mode */
html.dark input,
html.dark select,
html.dark textarea,
html.dark .dark-input {
  background-color: #131b2a !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
html.dark input::placeholder {
  color: #64748b !important;
}
html.dark input:focus,
html.dark select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(225, 11, 23, 0.3) !important;
}

/* GLOBAL LIGHT MODE ENFORCEMENT */
html:not(.dark),
html:not(.dark) body {
  background-color: #fcf9f8 !important;
  color: #334155 !important;
}

html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4 {
  color: #0f172a !important;
}

html:not(.dark) .text-text-primary {
  color: #0f172a !important;
}

html:not(.dark) .text-text-body {
  color: #334155 !important;
}

html:not(.dark) .text-text-muted {
  color: #475569 !important;
}

html:not(.dark) .bg-surface {
  background-color: #ffffff !important;
}

html:not(.dark) .bg-surface-subtle {
  background-color: #f8fafc !important;
}

html:not(.dark) .bg-surface-muted {
  background-color: #f1f5f9 !important;
}

html:not(.dark) .brand-card {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) details {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) input,
html:not(.dark) select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html:not(.dark) input::placeholder {
  color: #94a3b8 !important;
}

/* Hover lift and glow effects */
.card-hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.15);
}
html.dark .card-hover-lift:hover {
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(224, 30, 38, 0.15);
}

/* Primary Button Glow */
.btn-primary-glow {
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}
.btn-primary-glow:hover {
  box-shadow: 0 6px 20px rgba(225, 11, 23, 0.5);
  transform: translateY(-1px);
}
.btn-primary-glow:active {
  transform: scale(0.98);
}

/* Brand Grid Transitions */
.brand-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* Mobile Bottom Navigation active pill */
.nav-tab-active {
  color: var(--primary) !important;
  font-weight: 700 !important;
}
.nav-tab-active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* Animation utilities */
@keyframes pulseSubtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}
.animate-pulse-subtle {
  animation: pulseSubtle 2.5s infinite ease-in-out;
}

/* Footer Guarantee Slogan Strictly White */
footer .footer-guarantee,
.footer-guarantee {
  color: #ffffff !important;
}

/* ==========================================================================
   COLOMBIA TRICOLOR TYPOGRAPHY (AMARILLO, AZUL, ROJO)
   ========================================================================== */
.colombia-tricolor {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-decoration: none !important;
  vertical-align: baseline;
  position: relative;
}

.colombia-tricolor .col-yellow {
  color: #d97706; /* High-contrast gold-amber on light background */
  text-shadow: 0 1px 2px rgba(217, 119, 6, 0.2);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
html.dark .colombia-tricolor .col-yellow {
  color: #fbbf24; /* Luminous golden yellow on dark background */
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.5);
}

.colombia-tricolor .col-blue {
  color: #004b87; /* Official deep blue */
  text-shadow: 0 1px 2px rgba(0, 75, 135, 0.2);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
html.dark .colombia-tricolor .col-blue {
  color: #38bdf8; /* Clear sky blue for high contrast in dark mode */
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.colombia-tricolor .col-red {
  color: #dc2626; /* Crimson red */
  text-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
html.dark .colombia-tricolor .col-red {
  color: #f87171; /* Vibrant coral red in dark mode */
  text-shadow: 0 0 14px rgba(248, 113, 113, 0.5);
}

.colombia-tricolor:hover span {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

/* ==========================================================================
   GRANULAR REVEAL ANIMATION ENGINE (SAFE CSS KEYFRAME DRIVEN - NEVER INVISIBLE)
   ========================================================================== */
@keyframes revealFadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes revealFadeLeft {
  0% { opacity: 0; transform: translateX(-24px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes revealFadeRight {
  0% { opacity: 0; transform: translateX(24px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes revealFadePop {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.reveal-init {
  opacity: 1;
  animation: revealFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}
.reveal-left {
  opacity: 1;
  animation: revealFadeLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}
.reveal-right {
  opacity: 1;
  animation: revealFadeRight 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}
.reveal-pop {
  opacity: 1;
  animation: revealFadePop 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

.reveal-init.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-pop.revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* Micro-delay staggered timing */
.delay-50  { transition-delay: 50ms !important; }
.delay-100 { transition-delay: 100ms !important; }
.delay-150 { transition-delay: 150ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-250 { transition-delay: 250ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-350 { transition-delay: 350ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-450 { transition-delay: 450ms !important; }
.delay-500 { transition-delay: 500ms !important; }
.delay-600 { transition-delay: 600ms !important; }

/* Accessibility fallback */
@media (prefers-reduced-motion: reduce) {
  .reveal-init,
  .reveal-left,
  .reveal-right,
  .reveal-pop {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

