/* ==========================================
   PROTEXIA - Estilos Mejorados
   Versión con todas las mejoras implementadas
   ========================================== */

/* ==========================================
   RESET Y VARIABLES
   ========================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal overflow globally */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Ensure images and media don't cause overflow */
img,
video,
iframe,
svg {
    max-width: 100%;
    height: auto;
}

:root {
    /* Colores principales */
    --primary-color: #27AE60;
    --primary-dark: #229954;
    --primary-light: #E8F8F0;

    /* Color secundario para diversidad */
    --secondary-color: #3498DB;
    --secondary-dark: #2980B9;
    --secondary-light: #EBF5FB;

    /* Gradientes alternativos */
    --gradient-blue: linear-gradient(135deg, #1e3a5f, #3498DB);
    --gradient-teal: linear-gradient(135deg, #1a4d4d, #16A085);

    /* Colores de texto */
    --text-dark: #1A1A1A;
    --text-medium: #555555;
    --text-light: #666666;

    /* Colores de fondo */
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-dark: #2C3E50;
    --bg-darker: #1A1A1A;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px 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.15);

    /* Espaciado */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;
    --spacing-2xl: 80px;
    --spacing-3xl: 100px;

    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Border Colors */
    --border-light: #f0f0f0;
    --border-medium: #e0e0e0;
    --border-dark: #30363D;

    /* Shadow Scale */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.15);
    --shadow-btn: 0 4px 12px rgba(46, 204, 113, 0.3);

    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==========================================
   PALETA ENTERPRISE (Alternativa propuesta)

   Esta paleta ofrece un look más corporativo y profesional
   usando navy como color primario y verde como acento.

   CÓMO ACTIVAR:
   Opción 1: Agregar clase "theme-enterprise" al elemento <html>
             Ejemplo: <html lang="es" class="theme-enterprise">

   Opción 2: Copiar estas variables al bloque :root reemplazando
             las variables originales (backup recomendado)

   COMPATIBILIDAD:
   - Funciona con dark mode (data-theme="dark")
   - Compatible con todos los componentes existentes
   ========================================== */

.theme-enterprise {
    /* Colores primarios - Navy profesional */
    --primary-color: #1A365D;
    --primary-dark: #0F2A4A;
    --primary-light: #EBF4FF;

    /* Colores de acento - Verde para CTAs y highlights */
    --accent-color: #27AE60;
    --accent-light: #E8F8F0;

    /* Acento premium - Dorado sutil para elementos destacados */
    --premium-accent: #C9A227;
    --premium-light: #FDF8E7;

    /* Colores secundarios heredan del navy */
    --secondary-color: #2C5282;
    --secondary-dark: #1A365D;
    --secondary-light: #EBF4FF;
}

/* Enterprise theme: Ajustes para botones primarios con acento verde */
.theme-enterprise .btn-primary {
    background: var(--accent-color);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.theme-enterprise .btn-primary:hover {
    background: #229954;
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
}

/* Enterprise theme: Headers y navegación con navy */
.theme-enterprise .nav-link:hover,
.theme-enterprise .nav-link.active {
    color: var(--primary-color);
}

/* Enterprise theme: Focus states con navy */
.theme-enterprise *:focus-visible {
    outline-color: var(--primary-color);
}

.theme-enterprise .btn-primary:focus-visible {
    box-shadow: 0 0 0 5px var(--accent-color);
}

/* ==========================================
   VARIANTES DE SECCIÓN

   Clases para romper la monotonía visual y crear
   diversidad en los fondos de sección.

   USO:
   <section class="section section-navy">...</section>
   <section class="section section-gradient">...</section>
   <section class="section section-premium">...</section>
   ========================================== */

/* Sección Navy - Fondo sólido oscuro profesional */
.section-navy {
    background: #1A365D;
    color: #ffffff;
}

.section-navy .section-title,
.section-navy .section-subtitle,
.section-navy .section-tag {
    color: #ffffff;
}

.section-navy .section-tag {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.section-navy .btn-outline {
    border-color: #ffffff;
    color: #ffffff;
}

.section-navy .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sección Gradient - Gradiente navy profesional */
.section-gradient {
    background: linear-gradient(135deg, #1A365D 0%, #2C5282 100%);
    color: #ffffff;
}

.section-gradient .section-title,
.section-gradient .section-subtitle,
.section-gradient .section-tag {
    color: #ffffff;
}

.section-gradient .section-tag {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Sección Premium - Con acento dorado sutil */
.section-premium {
    background: linear-gradient(135deg, #1A365D 0%, #0F2A4A 100%);
    color: #ffffff;
    position: relative;
}

.section-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #C9A227 0%, #D4AF37 50%, #C9A227 100%);
}

.section-premium .section-title,
.section-premium .section-subtitle {
    color: #ffffff;
}

.section-premium .section-tag {
    background: rgba(201, 162, 39, 0.2);
    color: #D4AF37;
    border: 1px solid rgba(201, 162, 39, 0.3);
}

/* Sección Light Alternate - Gris azulado suave */
.section-light-alt {
    background: #F7FAFC;
}

/* Tarjetas sobre fondos oscuros */
.section-navy .service-card,
.section-navy .why-card,
.section-navy .metric-card,
.section-gradient .service-card,
.section-gradient .why-card,
.section-gradient .metric-card,
.section-premium .service-card,
.section-premium .why-card,
.section-premium .metric-card {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
}

.section-navy .service-card .service-title,
.section-navy .why-card .why-title,
.section-gradient .service-card .service-title,
.section-gradient .why-card .why-title,
.section-premium .service-card .service-title,
.section-premium .why-card .why-title {
    color: #1A365D;
}

/* Dark mode compatibility para secciones enterprise */
[data-theme="dark"] .section-navy,
[data-theme="dark"] .section-gradient,
[data-theme="dark"] .section-premium {
    background: #0D1117;
}

[data-theme="dark"] .section-navy .service-card,
[data-theme="dark"] .section-navy .why-card,
[data-theme="dark"] .section-gradient .service-card,
[data-theme="dark"] .section-gradient .why-card,
[data-theme="dark"] .section-premium .service-card,
[data-theme="dark"] .section-premium .why-card {
    background: #161B22;
    border-color: var(--border-dark);
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

/* Ensure text wraps properly */
h1, h2, h3, h4, h5, h6, p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Smooth theme transitions for main elements */
.header,
.footer,
.section,
.card,
.feature-card,
.btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ==========================================
   ANIMATED NAZCA PATTERN BACKGROUND
   Subtle geometric pattern inspired by Nazca Lines
   ========================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('assets/pattern-nazca.svg');
    background-size: 200px 200px;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    animation: patternMove 60s linear infinite;
    overflow: hidden;
}

@keyframes patternMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 200px 200px;
    }
}

/* Reduce animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

/* Adjust pattern for dark mode if enabled (system preference) */
@media (prefers-color-scheme: dark) {
    body::before {
        opacity: 0.2;
        filter: brightness(0.8);
    }
}

/* Adjust pattern for dark mode via data-theme attribute */
body[data-theme="dark"]::before {
    opacity: 0.45;
    filter: brightness(1.2) saturate(1.3);
}

/* Force light color scheme for all form elements to prevent dark mode issues */
input, select, textarea, button {
    color-scheme: light;
}

/* Ensure autofill doesn't break text visibility */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #1A1A1A !important;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    /* Prevent horizontal overflow */
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================
   ACCESIBILIDAD Y NAVEGACIÓN POR TECLADO
   ========================================== */

/* Remover outline por defecto solo para mouse, mantener para teclado */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Estilos de enfoque consistentes para navegación por teclado */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

/* Enfoque específico para enlaces */
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    text-decoration: underline;
}

/* Enfoque para botones primarios */
.btn-primary:focus-visible {
    outline: 3px solid var(--bg-white);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--primary-color);
}

/* Enfoque para botones outline y secondary */
.btn-outline:focus-visible,
.btn-secondary:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enfoque para inputs y textareas */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

/* Enfoque para navegación */
.nav-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 6px;
    background: rgba(46, 204, 113, 0.05);
}

/* Enfoque para links de skip */
.skip-link:focus {
    outline: 3px solid var(--bg-white);
    outline-offset: 2px;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--spacing-sm) 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.logo-tagline {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}

.nav {
    display: flex;
    gap: var(--spacing-md);
}

.nav-link {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    padding: 12px 8px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--primary-color);
}

.header-cta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-phone {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 16px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: background 0.3s ease;
}

.header-phone:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: var(--font-family);
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-white);
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4);
}

.btn.loading,
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn.loading {
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: 16px;
    top: 50%;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spinner 0.8s linear infinite;
}

@keyframes btn-spinner {
    to { transform: rotate(360deg); }
}

.btn-secondary {
    background: transparent;
    color: var(--bg-white);
    border: 2px solid var(--bg-white);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-small {
    padding: 12px 24px;
    font-size: 14px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-full {
    width: 100%;
}

/* Button with icon */
.btn .btn-icon {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.btn:hover .btn-icon {
    transform: translateX(3px);
}

.btn-large .btn-icon {
    width: 20px;
    height: 20px;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    background-image:
        linear-gradient(135deg, rgba(26, 26, 26, 0.85) 0%, rgba(44, 62, 80, 0.75) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23667eea" width="1200" height="600"/><path fill="%23764ba2" d="M0 300L50 283.3C100 266.7 200 233.3 300 225C400 216.7 500 233.3 600 241.7C700 250 800 250 900 233.3C1000 216.7 1100 183.3 1150 166.7L1200 150V600H0Z"/></svg>');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    /* Prevent any child overflow from causing horizontal scroll */
    max-width: 100vw;
}

/* Nazca Network Pattern Layer */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('assets/nazca-network.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.85;
    z-index: 2;
    animation: nazcaPulse 12s ease-in-out infinite, subtleMove 30s ease-in-out infinite;
    pointer-events: none;
}

@keyframes nazcaPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}

@keyframes subtleMove {
    0%, 100% { transform: scale(1) translate(0, 0); }
    33% { transform: scale(1.01) translate(-3px, -2px); }
    66% { transform: scale(1.005) translate(3px, 2px); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.92) 0%, rgba(44, 62, 80, 0.88) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: var(--spacing-3xl) 0;
}

.hero-text {
    max-width: 700px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bg-white);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5),
                 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 20px;
    line-height: 1.6;
    color: var(--bg-white);
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero-cta-group {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.hero-features {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
    color: var(--bg-white);
    font-size: 15px;
}

.hero-features li {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ==========================================
   TRUST BAR
   ========================================== */

.trust-bar {
    background: var(--bg-darker);
    padding: var(--spacing-md) 0;
    text-align: center;
}

.trust-label {
    color: #666666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.trust-badge {
    color: var(--bg-white);
    font-size: 15px;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.trust-badge:nth-child(2n) {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
}

.trust-badge:nth-child(3n) {
    background: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.3);
}

.trust-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ==========================================
   SECTIONS
   ========================================== */

.section-title {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: 18px;
    text-align: center;
    color: var(--text-medium);
    margin-bottom: var(--spacing-xl);
}

.section-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    margin-bottom: var(--spacing-sm);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

/* ==========================================
   SHARED CARD BASE
   Reduces repetition across card components
   ========================================== */

.card-base,
.why-card,
.service-card,
.team-card,
.case-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ==========================================
   WHY US
   ========================================== */

.why-us {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-white);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.why-card {
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.why-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
}

.why-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-sm);
}

.why-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.why-description {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.why-metric {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    padding-top: var(--spacing-sm);
    border-top: 2px solid var(--primary-light);
}

/* Variante de why-card */
.why-card:nth-child(2) {
    background: var(--secondary-light);
}

.why-card:nth-child(2) .why-metric {
    color: var(--secondary-color);
    border-top-color: var(--secondary-color);
}

/* ==========================================
   RESULTS
   ========================================== */

.results {
    background: var(--bg-light);
    padding: var(--spacing-3xl) 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.metric-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.metric-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.metric-label {
    font-size: 16px;
    color: var(--text-medium);
    line-height: 1.5;
}

/* ==========================================
   SERVICES
   ========================================== */

.services {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.service-card {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.service-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-card);
}

/* Variante de service-card con acento secundario */
.service-card:nth-child(2n) {
    border-color: var(--secondary-light);
}

.service-card:nth-child(2n):hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.15);
}

.service-icon {
    font-size: 40px;
    margin-bottom: var(--spacing-sm);
}

.service-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.service-description {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 1.6;
}

/* ==========================================
   METHODOLOGY
   ========================================== */

.methodology {
    background: var(--bg-light);
    padding: var(--spacing-3xl) 0;
}

.methodology-steps {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    gap: var(--spacing-md);
    align-items: start;
    margin-bottom: var(--spacing-xl);
}

.step-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-card);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
}

.step-number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-sm);
    box-shadow: var(--shadow-btn);
}

.step-icon {
    font-size: 32px;
    margin-bottom: var(--spacing-xs);
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-duration {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}

.step-description {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.step-deliverable {
    background: var(--primary-light);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-sm);
    border-left: 3px solid var(--primary-color);
    font-size: 14px;
    text-align: left;
}

.step-connector {
    font-size: 32px;
    color: var(--primary-color);
    align-self: center;
    padding-top: 32px;
}

.methodology-cta {
    text-align: center;
    background: var(--bg-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.methodology-cta p {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

/* ==========================================
   CASES
   ========================================== */

.cases {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-white);
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.case-card {
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-card);
}

.case-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.case-industry {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.case-icon {
    font-size: 20px;
}

.case-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.case-info {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: var(--spacing-sm);
}

.case-challenge {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.case-results {
    background: #F0FFF4;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.case-result-item {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.8;
    padding-left: 24px;
    position: relative;
    margin-bottom: 6px;
}

.case-result-item:before {
    content: "✓";
    color: var(--primary-color);
    font-weight: 700;
    position: absolute;
    left: 0;
}

.case-note {
    max-width: 760px;
    margin: var(--spacing-md) auto 0;
    color: var(--text-medium);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

/* ==========================================
   BLOG
   ========================================== */

.blog {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-light);
}

.blog-featured {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-lg);
}

.blog-featured-image {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.blog-placeholder-image {
    font-size: 120px;
}

.blog-featured-content {
    padding: var(--spacing-xl);
}

.blog-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: var(--radius-xs);
    margin-bottom: var(--spacing-sm);
}

.blog-featured-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.blog-featured-description {
    font-size: 18px;
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.blog-features {
    list-style: none;
    margin-bottom: var(--spacing-lg);
}

.blog-features li {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 2;
    padding-left: 24px;
    position: relative;
}

.blog-features li:before {
    content: "✓";
    color: var(--primary-color);
    font-weight: 700;
    position: absolute;
    left: 0;
}

.blog-cta-group {
    display: flex;
    gap: var(--spacing-sm);
}

.blog-upcoming {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-medium);
    font-style: italic;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #34495E 100%);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--bg-white);
    margin-top: var(--spacing-lg);
}

.newsletter-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.newsletter-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
}

.newsletter-form {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 500px;
    margin: 0 auto var(--spacing-sm);
}

.newsletter-input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-family);
    /* Force light mode colors - override browser dark mode */
    background-color: #ffffff;
    color: #1A1A1A;
    color-scheme: light;
    -webkit-text-fill-color: #1A1A1A;
}

.newsletter-input::placeholder {
    color: var(--text-light);
    opacity: 1;
}

.newsletter-disclaimer {
    font-size: 13px;
    opacity: 0.7;
}

/* ==========================================
   CTA FINAL
   ========================================== */

.cta-final {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-white);
}

.cta-title {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.cta-subtitle {
    font-size: 18px;
    text-align: center;
    color: var(--text-medium);
    margin-bottom: var(--spacing-xl);
}

/* Form */
.diagnostic-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-light);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* Fieldset y Legend para agrupacion semantica */
.form-fieldset {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: var(--bg-white);
}

.form-fieldset legend {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    padding: 0 var(--spacing-xs);
    margin-left: calc(-1 * var(--spacing-xs));
}

/* Estilos para checkbox de consentimiento */
.form-group-checkbox {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--spacing-xs);
}

.form-group-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.form-group-checkbox label {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-medium);
    line-height: 1.5;
    cursor: pointer;
}

.form-group-checkbox label a {
    color: var(--primary-color);
    text-decoration: underline;
}

.form-group-checkbox label a:hover {
    color: var(--primary-dark);
}

.form-group-checkbox .required-indicator {
    color: #E74C3C;
}

.form-group-checkbox .error-message {
    flex-basis: 100%;
    margin-left: 28px;
}

.form-group-checkbox input[type="checkbox"].error {
    outline: 2px solid #E74C3C;
    outline-offset: 2px;
}

.form-group-checkbox input[type="checkbox"].success {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px 16px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-family);
    transition: border-color 0.3s ease;
    /* Force light mode colors - override browser dark mode */
    background-color: #ffffff;
    color: #1A1A1A;
    color-scheme: light;
    -webkit-text-fill-color: #1A1A1A;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
    color: #1A1A1A;
    -webkit-text-fill-color: #1A1A1A;
}

/* Placeholder colors for dark mode compatibility */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
    opacity: 1;
}

/* Estados de validación */
.form-group {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #E74C3C;
    background-color: #FDEDEC;
    color: #1A1A1A;
    -webkit-text-fill-color: #1A1A1A;
}

.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: var(--primary-color);
    background-color: #E8F8F0;
    color: #1A1A1A;
    -webkit-text-fill-color: #1A1A1A;
}

.error-message {
    display: none;
    color: #E74C3C;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

.error-message.visible {
    display: block;
}

.success-message {
    display: none;
    background: #E8F8F0;
    border-left: 3px solid var(--primary-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
    position: relative;
}

.success-message.visible {
    display: block;
}

/* Animación de checkmark para mensaje de éxito */
.success-message::before {
    content: '\2713';
    display: inline-block;
    margin-right: 8px;
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 700;
    animation: checkmark 0.3s ease-out;
}

@keyframes checkmark {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Character counter para textareas */
.char-counter {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
    transition: color 0.2s ease;
}

.char-counter.near-limit {
    color: #E74C3C;
    font-weight: 500;
}

/* Error de envío del formulario (conexión, servidor, etc.) */
.submission-error {
    display: none;
    background: #FDEDEC;
    border-left: 3px solid #E74C3C;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
    color: #C0392B;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.submission-error.visible {
    display: block;
}

/* Mensaje de modo demo (cuando Formspree no está configurado) */
.demo-message {
    display: none;
    background: #FEF9E7;
    border-left: 3px solid #F39C12;
    padding: var(--spacing-sm);
    margin-top: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
}

.demo-message.visible {
    display: block;
}

.demo-message strong {
    display: block;
    color: #D68910;
    margin-bottom: 8px;
    font-size: 15px;
}

.demo-message p {
    margin: 0 0 8px 0;
    color: var(--text-medium);
}

.demo-message p:last-child {
    margin-bottom: 0;
}

/* Aviso de privacidad */
.privacy-notice {
    background: #F8F9FA;
    border-left: 3px solid var(--primary-color);
    padding: var(--spacing-sm);
    font-size: 13px;
    color: var(--text-medium);
    margin-top: var(--spacing-md);
    border-radius: var(--radius-sm);
}

.privacy-notice a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Required indicator */
label .required-indicator {
    color: #E74C3C;
    font-weight: 700;
}

/* Optional form fields */
.form-optional {
    margin-top: var(--spacing-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0;
}

.form-optional summary {
    padding: var(--spacing-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-medium);
    list-style: none;
}

.form-optional summary::-webkit-details-marker {
    display: none;
}

.form-optional summary::before {
    content: '+ ';
    color: var(--primary-color);
}

.form-optional[open] summary::before {
    content: '- ';
}

.form-optional > div {
    padding: 0 var(--spacing-sm) var(--spacing-sm);
}

[data-theme="dark"] .form-optional {
    border-color: var(--border-dark);
}

/* Form note */
.form-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: var(--spacing-xs);
}

[data-theme="dark"] .form-note {
    color: #8B949E;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: var(--bg-darker);
    color: var(--bg-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--bg-white);
}

.footer-tagline {
    font-size: 14px;
    color: #CCCCCC;
    margin-bottom: var(--spacing-xs);
}

.footer-description {
    font-size: 14px;
    color: #CCCCCC;
    line-height: 1.6;
}

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

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    color: #CCCCCC;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

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

.footer-contact li {
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
}

.footer-contact a {
    color: var(--bg-white);
    text-decoration: none;
}

.footer-contact strong {
    color: #CCCCCC;
    font-weight: 600;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
}

.footer-copyright {
    font-size: 14px;
    color: #CCCCCC;
}

.footer-legal {
    display: flex;
    gap: var(--spacing-md);
}

.footer-legal a {
    color: #CCCCCC;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--primary-color);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .results-grid,
    .services-grid,
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .methodology-steps {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .step-connector {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Header */
    .header-content {
        gap: var(--spacing-sm);
    }

    .nav {
        display: none;
    }

    .header-phone {
        display: none;
    }

    .theme-toggle,
    .header-cta .btn {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: 500px;
    }

    .hero-title {
        font-size: 32px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-cta-group {
        flex-direction: column;
    }

    .hero-cta-group .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .hero-features {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    /* Section titles */
    .section-title {
        font-size: 28px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .section-subtitle {
        font-size: 16px;
    }

    /* Grids */
    .why-grid,
    .results-grid,
    .services-grid,
    .cases-grid {
        grid-template-columns: 1fr;
    }

    .methodology-steps {
        grid-template-columns: 1fr;
    }

    /* Blog */
    .blog-featured {
        grid-template-columns: 1fr;
    }

    .blog-featured-image {
        min-height: 200px;
    }

    .blog-featured-title {
        font-size: 24px;
    }

    .blog-featured-description {
        font-size: 16px;
    }

    /* Trust badges */
    .trust-badges {
        gap: var(--spacing-xs);
    }

    .trust-badge {
        font-size: 13px;
        padding: 6px 12px;
    }

    /* Form */
    .form-row {
        grid-template-columns: 1fr;
    }

    .diagnostic-form {
        padding: var(--spacing-md);
    }

    /* Newsletter */
    .newsletter {
        padding: var(--spacing-md);
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-title {
        font-size: 22px;
    }

    /* CTA section */
    .cta-title {
        font-size: 28px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .footer-col:first-child {
        text-align: center;
        margin-bottom: var(--spacing-sm);
    }

    .footer-links a,
    .footer-contact a,
    .footer-legal a {
        font-size: 15px;
        padding: 11px 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .footer-title {
        font-size: 16px;
        margin-bottom: var(--spacing-xs);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Extra small screens - prevent any remaining overflow */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .hero-title {
        font-size: 28px;
    }

    .section-title {
        font-size: 24px;
    }

    .cta-title {
        font-size: 24px;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 16px;
    }

    .step-card {
        padding: var(--spacing-md);
    }

    .why-card,
    .service-card,
    .case-card,
    .metric-card {
        padding: var(--spacing-md);
    }

    .metric-number {
        font-size: 36px;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

/* Visually hidden (for screen readers only) */
.visually-hidden,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion preference */
@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;
    }
}

/* ==========================================
   DARK MODE
   ========================================== */

.theme-toggle {
    background: none;
    border: 2px solid var(--text-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: var(--text-medium);
}

.theme-icon-dark {
    display: none;
}

/* Dark mode active */
[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

[data-theme="dark"] .theme-icon {
    color: var(--text-medium);
}

[data-theme="dark"] {
    --bg-color: #0D1117;
    --bg-secondary: #161B22;
    --text-dark: #F0F6FC;
    --text-medium: #C9D1D9;
    --text-light: #8B949E;
    --border-color: var(--border-dark);
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
    color: var(--text-medium);
}

[data-theme="dark"] .header {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .section-light {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .card,
[data-theme="dark"] .service-card,
[data-theme="dark"] .why-card,
[data-theme="dark"] .team-card,
[data-theme="dark"] .feature-card {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .footer {
    background-color: var(--bg-secondary);
    border-top-color: var(--border-color);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-medium);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--text-light);
    color: var(--text-medium);
}

[data-theme="dark"] .nav-link {
    color: var(--text-medium);
}

[data-theme="dark"] .section-title,
[data-theme="dark"] .page-hero-title,
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4 {
    color: var(--text-dark);
}

/* ==========================================
   DARK MODE - FORM INPUTS
   Override light mode !important declarations
   ========================================== */

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #161B22 !important;
    border-color: var(--border-dark) !important;
    color: #C9D1D9 !important;
    -webkit-text-fill-color: #C9D1D9 !important;
    color-scheme: dark !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #8B949E !important;
    -webkit-text-fill-color: #8B949E !important;
    opacity: 1;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
    background-color: #161B22 !important;
    color: #C9D1D9 !important;
    -webkit-text-fill-color: #C9D1D9 !important;
}

/* Dark mode autofill styles */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] textarea:-webkit-autofill,
[data-theme="dark"] textarea:-webkit-autofill:hover,
[data-theme="dark"] textarea:-webkit-autofill:focus,
[data-theme="dark"] select:-webkit-autofill,
[data-theme="dark"] select:-webkit-autofill:hover,
[data-theme="dark"] select:-webkit-autofill:focus {
    -webkit-text-fill-color: #C9D1D9 !important;
    -webkit-box-shadow: 0 0 0px 1000px #161B22 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Dark mode form validation states */
[data-theme="dark"] .form-group input.error,
[data-theme="dark"] .form-group select.error,
[data-theme="dark"] .form-group textarea.error {
    border-color: #F85149 !important;
    background-color: rgba(248, 81, 73, 0.1) !important;
    color: #C9D1D9 !important;
    -webkit-text-fill-color: #C9D1D9 !important;
}

[data-theme="dark"] .form-group input.success,
[data-theme="dark"] .form-group select.success,
[data-theme="dark"] .form-group textarea.success {
    border-color: var(--primary-color) !important;
    background-color: rgba(46, 204, 113, 0.1) !important;
    color: #C9D1D9 !important;
    -webkit-text-fill-color: #C9D1D9 !important;
}

/* Dark mode form fieldset and labels */
[data-theme="dark"] .form-fieldset {
    border-color: var(--border-dark);
    background-color: #0D1117;
}

[data-theme="dark"] legend {
    color: #F0F6FC;
}

[data-theme="dark"] label {
    color: #C9D1D9;
}

[data-theme="dark"] .form-group label {
    color: #C9D1D9;
}

/* Dark mode form messages */
[data-theme="dark"] .error-message {
    color: #F85149;
}

[data-theme="dark"] .success-message {
    background-color: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
    color: #C9D1D9;
}

[data-theme="dark"] .success-message::before {
    color: var(--primary-color);
}

[data-theme="dark"] .demo-message {
    background-color: rgba(243, 156, 18, 0.15);
    border-color: rgba(243, 156, 18, 0.3);
    color: #C9D1D9;
}

[data-theme="dark"] .demo-message strong {
    color: #F39C12;
}

[data-theme="dark"] .demo-message p {
    color: #8B949E;
}

[data-theme="dark"] .submission-error {
    background-color: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.3);
    color: #F85149;
}

[data-theme="dark"] .privacy-notice {
    background-color: #161B22;
    border-color: var(--primary-color);
    color: #8B949E;
}

/* Dark mode newsletter input */
[data-theme="dark"] .newsletter-input {
    background-color: #161B22 !important;
    color: #C9D1D9 !important;
    -webkit-text-fill-color: #C9D1D9 !important;
    border: 1px solid var(--border-dark);
}

[data-theme="dark"] .newsletter-input::placeholder {
    color: #8B949E !important;
    -webkit-text-fill-color: #8B949E !important;
}

/* Dark mode diagnostic form container */
[data-theme="dark"] .diagnostic-form {
    background-color: #161B22;
}

/* Dark mode char counter */
[data-theme="dark"] .char-counter {
    color: #8B949E;
}

[data-theme="dark"] .char-counter.near-limit {
    color: #F85149;
}

/* ==========================================
   DARK MODE - CARDS
   Enhanced shadows and borders for dark backgrounds
   ========================================== */

[data-theme="dark"] .service-card,
[data-theme="dark"] .why-card,
[data-theme="dark"] .team-card,
[data-theme="dark"] .case-card,
[data-theme="dark"] .step-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .feature-card {
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-dark);
}

[data-theme="dark"] .service-card:hover,
[data-theme="dark"] .why-card:hover,
[data-theme="dark"] .case-card:hover,
[data-theme="dark"] .step-card:hover,
[data-theme="dark"] .metric-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-color);
}

/* Secondary color variant cards in dark mode */
[data-theme="dark"] .service-card:nth-child(2n):hover {
    border-color: var(--secondary-color);
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.2);
}

[data-theme="dark"] .why-card:nth-child(2) {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Case card left border */
[data-theme="dark"] .case-card {
    border-left: 4px solid var(--primary-color);
}

/* Case results background in dark mode */
[data-theme="dark"] .case-results {
    background-color: rgba(46, 204, 113, 0.1);
}

/* Methodology CTA box */
[data-theme="dark"] .methodology-cta {
    background-color: #161B22;
    box-shadow: var(--shadow-card);
}

/* Blog featured card */
[data-theme="dark"] .blog-featured {
    background-color: #161B22;
    box-shadow: var(--shadow-card);
}

/* Newsletter section */
[data-theme="dark"] .newsletter {
    background: linear-gradient(135deg, #161B22 0%, #21262D 100%);
}

/* ==========================================
   SVG ICONS
   Professional icon system replacing emojis
   ========================================== */

.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.icon-sm {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 32px;
    height: 32px;
}

.icon-xl {
    width: 48px;
    height: 48px;
}

/* Icon colors */
.icon {
    color: var(--primary-color);
}

/* Service card icons */
.service-icon .icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
}

/* Why card icons */
.why-icon .icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
}

/* Step card icons in methodology */
.step-icon .icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

/* Feature card icons */
.icon-badge .icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
}

/* Case card icons */
.case-icon .icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

/* Post card icons (blog) */
.post-image .icon {
    width: 64px;
    height: 64px;
    color: var(--bg-white);
}

/* Dark mode icon colors */
[data-theme="dark"] .icon {
    color: var(--primary-color);
}

[data-theme="dark"] .service-card:nth-child(2n) .service-icon .icon {
    color: var(--secondary-color);
}

/* Secondary color variant for alternating cards */
.service-card:nth-child(2n) .service-icon .icon {
    color: var(--secondary-color);
}

.why-card:nth-child(2) .why-icon .icon {
    color: var(--secondary-color);
}

/* ==========================================
   WHATSAPP FLOATING BUTTON
   ========================================== */

.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-btn);
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: white;
}

/* Dark mode adjustment */
[data-theme="dark"] .whatsapp-float {
    box-shadow: var(--shadow-btn);
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }

    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* ==========================================
   LAZY LOADING
   Smooth fade-in for lazy loaded images
   ========================================== */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}
