/**
 * ================================================
 * BLUEACCOUNT CMS - ESTUDIO ALFARO DESIGN SYSTEM
 * Complete CSS based on estudioalfaro.pe analysis
 * ================================================
 */

/* ===============================================
   1. VARIABLES GLOBALES - Sistema de Diseño
   =============================================== */
:root {
  /* Colores Primarios */
  --color-primary: #1B3A5C;
  --color-primary-dark: #0F2440;
  --color-primary-light: #2A5F8F;
  
  /* Colores Secundarios */
  --color-secondary: #D4A843;
  --color-secondary-dark: #B8922F;
  --color-secondary-light: #E8C96A;
  
  /* Colores de Acento */
  --color-accent: #2196F3;
  --color-accent-hover: #1976D2;
  --color-success: #27AE60;
  
  /* Neutros */
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-heading: #1B3A5C;
  --color-white: #FFFFFF;
  --color-bg-light: #F5F7FA;
  --color-bg-gray: #EBEEF2;
  --color-border: #E0E4E8;
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #1B3A5C 0%, #2A5F8F 100%);
  --gradient-overlay: linear-gradient(180deg, rgba(27,58,92,0.85) 0%, rgba(15,36,64,0.95) 100%);
  --gradient-gold: linear-gradient(135deg, #D4A843 0%, #E8C96A 100%);
  
  /* Tipografía */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  
  /* Tamaños de Fuente */
  --fs-hero: clamp(2.5rem, 5vw, 4rem);
  --fs-h1: clamp(2rem, 4vw, 3rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.25rem);
  --fs-h3: clamp(1.25rem, 2.5vw, 1.75rem);
  --fs-h4: clamp(1.1rem, 2vw, 1.375rem);
  --fs-body: 1rem;
  --fs-body-lg: 1.125rem;
  --fs-small: 0.875rem;
  --fs-xs: 0.75rem;
  
  /* Pesos de Fuente */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  
  /* Line Heights */
  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;
  
  /* Letter Spacing */
  --ls-tight: -0.025em;
  --ls-normal: 0;
  --ls-wide: 0.05em;
  --ls-wider: 0.1em;
  
  /* Espaciado */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Contenedor */
  --container-width: 1140px;
  --container-padding: 15px;
  
  /* Bordes */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;
  
  /* Sombras */
  --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.12);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 5px 20px rgba(27, 58, 92, 0.1);
  --shadow-card-hover: 0 10px 40px rgba(27, 58, 92, 0.18);
}

/* ===============================================
   2. RESET Y BASE
   =============================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: 0.5em;
  font-weight: var(--fw-bold);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  margin-bottom: 1em;
  line-height: var(--lh-relaxed);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===============================================
   3. CONTENEDOR Y LAYOUT
   =============================================== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  width: 100%;
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-light {
  background: var(--color-bg-light);
}

.section-dark {
  background: #374151;
  color: var(--color-white);
}

/* ===============================================
   4. HEADER / TOP BAR MEJORADO
   =============================================== */
.top-bar {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 10px 0;
  font-size: var(--fs-small);
  border-bottom: 2px solid var(--color-secondary);
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.top-bar-left {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.top-bar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.3s ease;
}

.top-bar-item:hover {
  color: var(--color-secondary);
}

.top-bar-item i {
  color: var(--color-secondary);
  font-size: 0.9rem;
}

.top-bar-right {
  display: flex;
  gap: 12px;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
  background: var(--color-secondary);
  color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
}

/* Header Principal */
.header {
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header.scrolled {
  box-shadow: var(--shadow-lg);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: height 0.3s ease;
}

.header.scrolled .navbar {
  height: 70px;
}

.logo img {
  height: 50px;
  width: auto;
  transition: height 0.3s ease;
}

.header.scrolled .logo img {
  height: 40px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  align-items: center;
}

.nav-menu a {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  padding: 10px 18px;
  position: relative;
  transition: color 0.3s ease;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--color-secondary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--color-accent);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 80%;
}

/* Dropdown */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-white);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  padding: 0.75rem 0;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  font-size: 13px;
  text-transform: none;
  transition: all 0.2s ease;
}

.dropdown-menu a::after {
  display: none;
}

.dropdown-menu a:hover {
  background: var(--color-bg-light);
  color: var(--color-accent);
  padding-left: 1.75rem;
}

/* ===============================================
   5. BOTONES PROFESIONALES
   =============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 4px 15px rgba(27, 58, 92, 0.25);
  padding: 14px 32px;
  font-size: 14px;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(27, 58, 92, 0.35);
  color: var(--color-white);
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-primary);
  border-color: var(--color-secondary);
  box-shadow: 0 4px 15px rgba(212, 168, 67, 0.3);
  padding: 14px 32px;
  font-size: 14px;
}

.btn-secondary:hover {
  background: var(--color-secondary-dark);
  border-color: var(--color-secondary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(212, 168, 67, 0.4);
  color: var(--color-primary);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
  padding: 12px 28px;
  font-size: 14px;
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(27, 58, 92, 0.3);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 15px;
}

/* Efecto Ripple */
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

/* ===============================================
   6. CARDS Y SERVICIOS MEJORADOS
   =============================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.service-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 35px 30px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(27, 58, 92, 0.1);
}

.service-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-bg-light);
  color: var(--color-primary);
  font-size: 32px;
  transition: all 0.4s ease;
}

.service-card:hover .service-icon {
  background: var(--color-primary);
  color: var(--color-white);
  transform: rotateY(180deg) scale(1.05);
  box-shadow: 0 8px 25px rgba(27, 58, 92, 0.25);
}

.service-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  color: var(--color-heading);
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.service-card:hover .service-title {
  color: var(--color-accent);
}

.service-description {
  font-size: var(--fs-small);
  color: var(--color-text-light);
  line-height: var(--lh-relaxed);
  margin-bottom: 15px;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--color-accent);
  text-decoration: none;
  transition: all 0.3s ease;
}

.service-link::after {
  content: '→';
  transition: transform 0.3s ease;
}

.service-card:hover .service-link::after {
  transform: translateX(5px);
}

/* ===============================================
   7. SECCIONES ESPECIALES
   =============================================== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: var(--fs-h2);
  color: var(--color-heading);
  position: relative;
  display: inline-block;
  padding-bottom: 20px;
  margin-bottom: 15px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-gold);
  border-radius: 2px;
}

.section-description {
  font-size: var(--fs-body-lg);
  color: var(--color-text-light);
  line-height: var(--lh-relaxed);
}

/* ===============================================
   8. CTA SECTION
   =============================================== */
.cta-section {
  background: var(--gradient-primary);
  padding: var(--space-4xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: var(--radius-full);
  background: rgba(212, 168, 67, 0.05);
}

.cta-section .section-title,
.cta-section .section-description {
  color: var(--color-white);
}

.cta-section .section-title::after {
  background: var(--color-secondary);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ===============================================
   9. FOOTER PROFESIONAL
   =============================================== */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding-top: var(--space-4xl);
}

.footer-content {
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: var(--space-2xl);
}

.footer-col h3,
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: var(--fw-bold);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: 20px;
  padding-bottom: 10px;
  position: relative;
}

.footer-col h3::after,
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--color-secondary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--fs-small);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-links a::before {
  content: '›';
  color: var(--color-secondary);
  font-weight: bold;
  transition: transform 0.3s ease;
}

.footer-links a:hover {
  color: var(--color-secondary);
  transform: translateX(5px);
}

.footer-contact {
  list-style: none;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.65);
}

.footer-contact li i {
  color: var(--color-secondary);
  font-size: 18px;
  margin-top: 3px;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--color-secondary);
  color: var(--color-primary);
  transform: translateY(-3px);
}

.footer-bottom {
  padding: 25px 0;
  text-align: center;
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.5);
}

/* ===============================================
   10. ANIMACIONES
   =============================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Delay escalonado para tarjetas */
.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* ===============================================
   11. RESPONSIVE
   =============================================== */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 968px) {
  .top-bar {
    display: none;
  }
  
  .nav-menu {
    display: none;
  }
  
  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-col h3::after,
  .footer-col h4::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .social-links {
    justify-content: center;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===============================================
   12. UTILIDADES
   =============================================== */
.mt-2 { margin-top: var(--space-xl); }
.mb-2 { margin-bottom: var(--space-xl); }
.text-center { text-align: center; }
