<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Cotiza y compra tu SOAT online de forma rápida y segura. Seguro Obligatorio de Accidentes de Tránsito en Colombia con las mejores tarifas y atención inmediata.">
    <meta name="keywords" content="SOAT, seguro obligatorio, accidentes de tránsito, Colombia, seguro vehicular, cotizar SOAT">
    <meta name="author" content="SOAT  SEGUROS Digital Colombia">
    <meta name="robots" content="index, follow">
    
    <!-- Open Graph Meta Tags -->
    <meta property="og:title" content="SOAT Digital - Seguro Obligatorio de Accidentes de Tránsito">
    <meta property="og:description" content="Cotiza y compra tu SOAT online. Rápido, seguro y confiable.">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://segurosuraenlinea.com">
    <meta property="og:image" content="https://segurosuraenlinea.com/soate.png">
    
    <!-- Twitter Card Meta Tags -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="SOAT Digital Colombia">
    <meta name="twitter:description" content="Cotiza tu SOAT online de forma segura">
    
    <!-- Favicon -->
    <link rel="icon" type="image/png" href="soate.png">
    <link rel="apple-touch-icon" href="soate.png">
    
    <!-- Canonical URL -->
    <link rel="canonical" href="https://segurosuraenlinea.com">
    
    <!-- Schema.org JSON-LD para Google -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "InsuranceAgency",
      "name": "SOAT Digital Colombia",
      "description": "Seguro Obligatorio de Accidentes de Tránsito en Colombia",
      "url": "https://segurosuraenlinea.com",
      "telephone": "+57-315-8293-459",
      "email": "infoemails32@segurosuraenlinea.com.co",
      "address": {
        "@type": "PostalAddress",
        "addressCountry": "CO",
        "addressLocality": "Bogotá"
      },
      "sameAs": [
        "https://facebook.com/segurosuraenlinea.com",
        "https://twitter.com/segurosuraenlinea.com",
        "https://instagram.com/segurosuraenlinea.com"
      ],
      "priceRange": "$$$",
      "image": "https://segurosuraenlinea.comm/soate.png"
    }
    </script>
    
    <!-- Breadcrumb Schema -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [{
        "@type": "ListItem",
        "position": 1,
        "name": "Inicio",
        "item": "https://segurosuraenlinea.com"
      },{
        "@type": "ListItem",
        "position": 2,
        "name": "Cotizar SOAT",
        "item": "https://segurosuraenlinea.com#cotizar"
      }]
    }
    </script>
    
    <!-- FAQ Schema -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [{
        "@type": "Question",
        "name": "¿Qué es el SOAT?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "El SOAT (Seguro Obligatorio de Accidentes de Tránsito) es un seguro obligatorio en Colombia que cubre gastos médicos y hospitalarios de las víctimas de accidentes de tránsito."
        }
      },{
        "@type": "Question",
        "name": "¿Cuánto cuesta el SOAT?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "El precio del SOAT varía según el tipo de vehículo. Las motocicletas tienen tarifas desde $200.000, automóviles desde $450.000."
        }
      }]
    }
    </script>
    
    <title>SOAT Digital Colombia - Cotiza tu Seguro Obligatorio Online</title>
    
    <!-- External CSS -->
    <link rel="stylesheet" href="styles.css">
    
    <!-- Font Awesome -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js" defer></script>
    
    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&amp;display=swap" rel="stylesheet">
    
    <style>
        /* Critical CSS inline para mejor rendimiento */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
            line-height: 1.6;
            color: #2c3e50;
            overflow-x: hidden;
        }

        /* Animaciones */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(50px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        /* Header mejorado */
        header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 1rem 0;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            transition: all 0.3s ease;
        }

        header.scrolled {
            padding: 0.5rem 0;
            box-shadow: 0 6px 30px rgba(0,0,0,0.25);
        }

        nav {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2rem;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 0.7rem;
            animation: fadeInUp 0.6s ease;
        }

        .logo img {
            height: 50px;
            width: auto;
            object-fit: contain;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
        }

        .logo-text {
            font-size: 1.4rem;
            font-weight: 700;
            letter-spacing: -0.5px;
        }

        .nav-links {
            display: flex;
            list-style: none;
            gap: 2.5rem;
            animation: slideInRight 0.8s ease;
        }

        .nav-links a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s;
            position: relative;
            padding: 0.5rem 0;
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: white;
            transition: width 0.3s ease;
        }

        .nav-links a:hover::after {
            width: 100%;
        }

        /* Menú hamburguesa */
        .menu-toggle {
            display: none;
            flex-direction: column;
            cursor: pointer;
            gap: 5px;
        }

        .menu-toggle span {
            width: 25px;
            height: 3px;
            background: white;
            border-radius: 2px;
            transition: all 0.3s;
        }

        /* Hero mejorado */
        .hero {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
            color: white;
            padding: 8rem 2rem;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,144C960,149,1056,139,1152,122.7C1248,107,1344,85,1392,74.7L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
            background-size: cover;
            background-position: bottom;
            opacity: 0.3;
            z-index: 0;
        }

        .hero > * {
            position: relative;
            z-index: 1;
        }

        .hero h1 {
            font-size: 3.5rem;
            margin-bottom: 1.5rem;
            font-weight: 700;
            line-height: 1.2;
            animation: fadeInUp 0.8s ease;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        }

        .hero p {
            font-size: 1.4rem;
            margin-bottom: 2.5rem;
            animation: fadeInUp 1s ease;
            max-width: 700px;
            margin-left: auto;
            margin-right: auto;
        }

        .hero-badges {
            display: flex;
            justify-content: center;
            gap: 2rem;
            margin-top: 2rem;
            flex-wrap: wrap;
            animation: fadeInUp 1.2s ease;
        }

        .badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(255,255,255,0.2);
            padding: 0.7rem 1.5rem;
            border-radius: 50px;
            backdrop-filter: blur(10px);
            font-weight: 500;
        }

        .cta-button {
            background: white;
            color: #667eea;
            padding: 1.2rem 3rem;
            border: none;
            border-radius: 50px;
            font-size: 1.2rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 8px 20px rgba(0,0,0,0.15);
            animation: fadeInUp 1.4s ease;
        }

        .cta-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 30px rgba(0,0,0,0.25);
            animation: pulse 2s infinite;
        }

        .cta-button:active {
            transform: translateY(-1px);
        }

        /* Container */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 5rem 2rem;
        }

        section {
            scroll-margin-top: 80px;
        }

        /* Info Cards mejoradas */
        .section-title {
            text-align: center;
            margin-bottom: 3rem;
            font-size: 2.5rem;
            color: #2c3e50;
            position: relative;
            padding-bottom: 1rem;
        }

        .section-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 2px;
        }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 2.5rem;
            margin: 3rem 0;
        }

        .card {
            background: white;
            padding: 2.5rem;
            border-radius: 20px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.08);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border: 1px solid rgba(102, 126, 234, 0.1);
            position: relative;
            overflow: hidden;
        }

        .card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }

        .card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
        }

        .card:hover::before {
            transform: scaleX(1);
        }

        .card i {
            font-size: 3.5rem;
            color: #667eea;
            margin-bottom: 1.5rem;
            display: block;
            transition: transform 0.3s ease;
        }

        .card:hover i {
            transform: scale(1.1) rotate(5deg);
        }

        .card h3 {
            color: #2c3e50;
            margin-bottom: 1rem;
            font-size: 1.5rem;
            font-weight: 600;
        }

        .card p {
            color: #5a6c7d;
            line-height: 1.7;
        }

        /* Formulario mejorado */
        .quote-form {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            padding: 4rem;
            border-radius: 25px;
            margin: 4rem 0;
            box-shadow: 0 10px 40px rgba(0,0,0,0.1);
            border: 2px solid rgba(102, 126, 234, 0.1);
        }

        .form-group {
            margin-bottom: 2rem;
            animation: fadeInUp 0.6s ease;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.7rem;
            font-weight: 600;
            color: #2c3e50;
            font-size: 1.05rem;
        }

        .form-group label i {
            margin-right: 0.5rem;
            color: #667eea;
        }

        .form-group input, 
        .form-group select {
            width: 100%;
            padding: 1rem;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            font-size: 1rem;
            transition: all 0.3s ease;
            font-family: 'Poppins', sans-serif;
            background: white;
        }

        .form-group input:focus, 
        .form-group select:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
            transform: translateY(-2px);
        }

        .form-group input:valid {
            border-color: #10b981;
        }

        .form-group input::placeholder {
            color: #a0aec0;
        }

        /* Input con icono */
        .input-with-icon {
            position: relative;
        }

        .input-with-icon i {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: #667eea;
        }

        /* Turnstile mejorado */
        .turnstile-container {
            margin: 2rem 0;
            padding: 2rem;
            background: white;
            border-radius: 15px;
            text-align: center;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
            border: 2px dashed rgba(102, 126, 234, 0.3);
        }

        .security-badge {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            color: #667eea;
            font-weight: 600;
            margin-top: 1rem;
        }

        /* Footer mejorado */
        footer {
            background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
            color: white;
            padding: 4rem 2rem 2rem;
            margin-top: 5rem;
            position: relative;
        }

        footer::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
        }

        .footer-content {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 3rem;
        }

        .footer-section h3 {
            margin-bottom: 1.5rem;
            font-size: 1.3rem;
            color: #667eea;
        }

        .footer-section a {
            color: #cbd5e0;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0.7rem 0;
            transition: all 0.3s;
        }

        .footer-section a:hover {
            color: white;
            transform: translateX(5px);
        }

        .social-links {
            display: flex;
            gap: 1rem;
            margin-top: 1rem;
        }

        .social-icon {
            width: 45px;
            height: 45px;
            background: rgba(102, 126, 234, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
        }

        .social-icon:hover {
            background: #667eea;
            transform: translateY(-3px) scale(1.1);
        }

        /* Trust badges */
        .trust-section {
            background: #f8f9fa;
            padding: 3rem 2rem;
            text-align: center;
            margin: 3rem 0;
            border-radius: 20px;
        }

        .trust-badges {
            display: flex;
            justify-content: center;
            gap: 3rem;
            flex-wrap: wrap;
            margin-top: 2rem;
        }

        .trust-badge {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
        }

        .trust-badge i {
            font-size: 3rem;
            color: #667eea;
        }

        .trust-badge p {
            font-weight: 600;
            color: #2c3e50;
        }

        /* Modal mejorado */
        .modal {
            display: none;
            position: fixed;
            z-index: 3000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(5px);
            overflow-y: auto;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: white;
            margin: 2rem;
            padding: 3rem;
            width: 90%;
            max-width: 800px;
            border-radius: 25px;
            position: relative;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            animation: slideUp 0.4s ease;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .close {
            position: absolute;
            right: 1.5rem;
            top: 1.5rem;
            font-size: 2rem;
            cursor: pointer;
            color: #718096;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s;
        }

        .close:hover {
            background: #f8f9fa;
            color: #2d3748;
            transform: rotate(90deg);
        }

        .privacy-section {
            margin: 2rem 0;
            padding: 1.5rem;
            background: #f8f9fa;
            border-radius: 15px;
            border-left: 4px solid #667eea;
        }

        .privacy-section h3 {
            color: #667eea;
            margin-bottom: 1rem;
        }

        .privacy-section ul {
            margin-left: 1.5rem;
            line-height: 1.8;
        }

        /* Cookie Banner mejorado */
        .cookie-banner {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(45, 55, 72, 0.98);
            backdrop-filter: blur(10px);
            color: white;
            padding: 2rem;
            display: none;
            z-index: 2000;
            box-shadow: 0 -8px 30px rgba(0,0,0,0.3);
            animation: slideUpBanner 0.5s ease;
        }

        @keyframes slideUpBanner {
            from {
                transform: translateY(100%);
            }
            to {
                transform: translateY(0);
            }
        }

        .cookie-banner.show {
            display: block;
        }

        .cookie-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 2rem;
        }

        .cookie-buttons {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .cookie-button {
            padding: 1rem 2rem;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            font-family: 'Poppins', sans-serif;
        }

        .cookie-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0,0,0,0.2);
        }

        .accept-all {
            background: #667eea;
            color: white;
        }

        .reject-all {
            background: #718096;
            color: white;
        }

        .customize {
            background: white;
            color: #2d3748;
        }

        /* Loading spinner */
        .loading-spinner {
            display: none;
            width: 50px;
            height: 50px;
            border: 5px solid #f3f3f3;
            border-top: 5px solid #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 2rem auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Success/Error messages */
        .message {
            padding: 1.5rem;
            border-radius: 12px;
            margin: 1rem 0;
            display: none;
            animation: fadeInUp 0.5s ease;
        }

        .message.success {
            background: #d1fae5;
            border: 2px solid #10b981;
            color: #065f46;
        }

        .message.error {
            background: #fee2e2;
            border: 2px solid #ef4444;
            color: #991b1b;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .hero h1 {
                font-size: 2.2rem;
            }

            .hero p {
                font-size: 1.1rem;
            }

            .nav-links {
                position: fixed;
                top: 70px;
                left: -100%;
                flex-direction: column;
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                width: 100%;
                padding: 2rem;
                gap: 1.5rem;
                transition: left 0.3s ease;
                box-shadow: 0 8px 30px rgba(0,0,0,0.3);
            }

            .nav-links.active {
                left: 0;
            }

            .menu-toggle {
                display: flex;
            }

            .menu-toggle.active span:nth-child(1) {
                transform: rotate(45deg) translate(7px, 7px);
            }

            .menu-toggle.active span:nth-child(2) {
                opacity: 0;
            }

            .menu-toggle.active span:nth-child(3) {
                transform: rotate(-45deg) translate(7px, -7px);
            }

            .cookie-content {
                flex-direction: column;
            }

            .cookie-buttons {
                flex-direction: column;
                width: 100%;
            }

            .cookie-button {
                width: 100%;
            }

            .quote-form {
                padding: 2rem;
            }

            .info-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Accessibility */
        .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;
        }

        /* Skip to content link */
        .skip-link {
            position: absolute;
            top: -40px;
            left: 0;
            background: #667eea;
            color: white;
            padding: 0.5rem 1rem;
            text-decoration: none;
            z-index: 10000;
        }

        .skip-link:focus {
            top: 0;
        }
    </style>
</head>
<body>
    <!-- Skip to content for accessibility -->
    <a href="#main-content" class="skip-link">Saltar al contenido principal</a>

    <!-- Header -->
    <header id="header">
        <nav role="navigation" aria-label="Navegación principal">
            <div class="logo">
                <img src="soate.png" alt="Logo SOAT Digital Colombia">
                <span class="logo-text">SOAT Digital</span>
            </div>
            <div class="menu-toggle" id="menuToggle" aria-label="Menú de navegación" role="button" tabindex="0">
                <span></span>
                <span></span>
                <span></span>
            </div>
            <ul class="nav-links" id="navLinks">
                <li><a href="#inicio">Inicio</a></li>
                <li><a href="#cotizar">Cotizar</a></li>
                <li><a href="#coberturas">Coberturas</a></li>
                <li><a href="#preguntas">Preguntas</a></li>
                <li><a href="#contacto">Contacto</a></li>
                <li><a href="#" onclick="openPrivacyModal(); return false;">Privacidad</a></li>
            </ul>
        </nav>
    </header>

    <!-- Hero Section -->
    <main id="main-content">
        <section class="hero" id="inicio">
            <h1>Seguro Obligatorio de Accidentes de Tránsito</h1>
            <p>Protección garantizada para ti y los tuyos en la carretera. Cotiza en minutos y recibe tu SOAT de forma inmediata.</p>
            <button class="cta-button" onclick="document.getElementById('cotizar').scrollIntoView({behavior: 'smooth'})">
                <i class="fas fa-shield-alt"></i> Cotiza Ahora
            </button>
            <div class="hero-badges">
                <div class="badge">
                    <i class="fas fa-check-circle"></i>
                    <span>100% Legal</span>
                </div>
                <div class="badge">
                    <i class="fas fa-lock"></i>
                    <span>Seguro y Confiable</span>
                </div>
                <div class="badge">
                    <i class="fas fa-bolt"></i>
                    <span>Emisión Instantánea</span>
                </div>
            </div>
        </section>

        <!-- Trust Section -->
        <section class="trust-section">
            <h2 class="section-title">Miles de Colombianos Confían en Nosotros</h2>
            <div class="trust-badges">
                <div class="trust-badge">
                    <i class="fas fa-users"></i>
                    <p style="margin-top: 0.5rem;">Guardan tus preferencias y configuraciones del sitio, como idioma y región.</p>
            </div>

            <div style="display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap;">
                <button class="cta-button" onclick="saveCustomCookies()" style="flex: 1;">
                    <i class="fas fa-save"></i> Guardar Preferencias
                </button>
                <button class="cookie-button reject-all" onclick="closeCookieModal()" style="flex: 1;">
                    <i class="fas fa-times"></i> Cancelar
                </button>
            </div>
        </div>

    <!-- Cloudflare Turnstile Script -->
    <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>

    <!-- Cloudflare Turnstile Script -->
    <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>

    <script>
        // ==========================================
        // COOKIE MANAGEMENT SYSTEM
        // ==========================================
        const cookiePreferences = {
            necessary: true,
            analytics: false,
            marketing: false,
            preferences: false
        };

        function showCookieBanner() {
            const consent = localStorage.getItem('cookieConsent');
            if (!consent) {
                setTimeout(() => {
                    document.getElementById('cookieBanner').classList.add('show');
                }, 1000);
            } else {
                loadCookiePreferences();
            }
        }

        function acceptAllCookies() {
            cookiePreferences.analytics = true;
            cookiePreferences.marketing = true;
            cookiePreferences.preferences = true;
            saveCookiePreferences();
            document.getElementById('cookieBanner').classList.remove('show');
            console.log('✅ Todas las cookies aceptadas');
            showMessage('Preferencias de cookies guardadas correctamente', 'success');
        }

        function rejectAllCookies() {
            cookiePreferences.analytics = false;
            cookiePreferences.marketing = false;
            cookiePreferences.preferences = false;
            saveCookiePreferences();
            document.getElementById('cookieBanner').classList.remove('show');
            console.log('❌ Cookies opcionales rechazadas');
            showMessage('Solo se usarán cookies necesarias', 'success');
        }

        function saveCookiePreferences() {
            localStorage.setItem('cookieConsent', JSON.stringify(cookiePreferences));
            localStorage.setItem('cookieConsentDate', new Date().toISOString());
            loadCookiePreferences();
        }

        function loadCookiePreferences() {
            const saved = localStorage.getItem('cookieConsent');
            if (saved) {
                Object.assign(cookiePreferences, JSON.parse(saved));
                if (cookiePreferences.analytics) {
                    console.log('📊 Analytics cookies habilitadas');
                    // Aquí cargarías Google Analytics u otra herramienta
                }
                if (cookiePreferences.marketing) {
                    console.log('🎯 Marketing cookies habilitadas');
                    // Aquí cargarías Google Ads, Facebook Pixel, etc.
                }
            }
        }

        function openCookieModal() {
            document.getElementById('cookieModal').classList.add('show');
            document.getElementById('analyticsCookies').checked = cookiePreferences.analytics;
            document.getElementById('marketingCookies').checked = cookiePreferences.marketing;
            document.getElementById('preferenceCookies').checked = cookiePreferences.preferences;
            document.body.style.overflow = 'hidden';
        }

        function closeCookieModal() {
            document.getElementById('cookieModal').classList.remove('show');
            document.body.style.overflow = 'auto';
        }

        function saveCustomCookies() {
            cookiePreferences.analytics = document.getElementById('analyticsCookies').checked;
            cookiePreferences.marketing = document.getElementById('marketingCookies').checked;
            cookiePreferences.preferences = document.getElementById('preferenceCookies').checked;
            saveCookiePreferences();
            closeCookieModal();
            document.getElementById('cookieBanner').classList.remove('show');
            showMessage('Preferencias de cookies guardadas correctamente', 'success');
        }

        function openPrivacyModal() {
            document.getElementById('privacyModal').classList.add('show');
            document.body.style.overflow = 'hidden';
        }

        function closePrivacyModal() {
            document.getElementById('privacyModal').classList.remove('show');
            document.body.style.overflow = 'auto';
        }

        // ==========================================
        // CLOUDFLARE TURNSTILE INTEGRATION
        // ==========================================
        let turnstileToken = null;
        let turnstileWidgetId = null;

        function onTurnstileSuccess(token) {
            turnstileToken = token;
            console.log('✅ Turnstile verificado exitosamente');
            document.querySelector('button[type="submit"]').disabled = false;
            document.querySelector('button[type="submit"]').style.opacity = '1';
        }

        function onTurnstileExpire() {
            turnstileToken = null;
            console.log('⚠️ Turnstile expiró, por favor verifica nuevamente');
            document.querySelector('button[type="submit"]').disabled = true;
            document.querySelector('button[type="submit"]').style.opacity = '0.6';
            showMessage('La verificación de seguridad expiró. Por favor, verifica nuevamente.', 'error');
        }

        function onTurnstileError(error) {
            turnstileToken = null;
            console.log('❌ Error en Turnstile:', error);
            document.querySelector('button[type="submit"]').disabled = true;
            document.querySelector('button[type="submit"]').style.opacity = '0.6';
        }

        window.addEventListener('load', function() {
            if (typeof turnstile !== 'undefined') {
                turnstileWidgetId = turnstile.render('#turnstile-widget', {
                    sitekey: '0x4AAAAAAB8xc3uslNzqnaDy',
                    theme: 'light',
                    size: 'normal',
                    callback: onTurnstileSuccess,
                    'expired-callback': onTurnstileExpire,
                    'error-callback': onTurnstileError,
                });
                
                document.querySelector('button[type="submit"]').disabled = true;
                document.querySelector('button[type="submit"]').style.opacity = '0.6';
            } else {
                console.warn('⚠️ Turnstile no está cargado');
            }
        });

        // ==========================================
        // FORM VALIDATION AND SUBMISSION
        // ==========================================
        function showMessage(message, type) {
            const messageContainer = document.getElementById('messageContainer');
            messageContainer.innerHTML = `
                <div class="message ${type}">
                    <i class="fas fa-${type === 'success' ? 'check-circle' : 'exclamation-circle'}"></i>
                    ${message}
                </div>
            `;
            messageContainer.querySelector('.message').style.display = 'block';
            
            setTimeout(() => {
                if (messageContainer.querySelector('.message')) {
                    messageContainer.querySelector('.message').style.display = 'none';
                }
            }, 5000);
        }

        // Validación en tiempo real de la placa
        document.getElementById('plate').addEventListener('input', function(e) {
            const value = e.target.value.toUpperCase();
            e.target.value = value;
            
            const pattern = /^[A-Z]{3}[0-9]{3}$/;
            const check = document.getElementById('plateCheck');
            
            if (pattern.test(value)) {
                e.target.style.borderColor = '#10b981';
                check.style.display = 'block';
                check.style.color = '#10b981';
            } else {
                e.target.style.borderColor = '#e0e0e0';
                check.style.display = 'none';
            }
        });

        // Validación del teléfono
        document.getElementById('phone').addEventListener('input', function(e) {
            e.target.value = e.target.value.replace(/\D/g, '');
        });

        // Form submission
        document.getElementById('soatForm').addEventListener('submit', async function(e) {
            e.preventDefault();
            
            // Validar Turnstile
            if (!turnstileToken) {
                showMessage('⚠️ Por favor completa la verificación de seguridad (Turnstile)', 'error');
                return;
            }

            // Validar términos y condiciones
            if (!document.getElementById('terms').checked) {
                showMessage('⚠️ Debes aceptar los términos y condiciones', 'error');
                return;
            }
            
            const formData = {
                vehicleType: document.getElementById('vehicleType').value,
                plate: document.getElementById('plate').value,
                name: document.getElementById('name').value,
                email: document.getElementById('email').value,
                phone: document.getElementById('phone').value,
                city: document.getElementById('city').value,
                turnstileToken: turnstileToken,
                timestamp: new Date().toISOString(),
                userAgent: navigator.userAgent
            };

            // Mostrar loading
            const submitBtn = document.getElementById('submitBtn');
            const originalText = submitBtn.innerHTML;
            submitBtn.disabled = true;
            submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Procesando...';
            document.getElementById('loadingSpinner').style.display = 'block';

            try {
                // Simulación de envío (REEMPLAZA ESTA URL CON TU BACKEND REAL)
                // const response = await fetch('https://segurosuraenlinea.com/api/cotizacion', {
                //     method: 'POST',
                //     headers: { 
                //         'Content-Type': 'application/json'
                //     },
                //     body: JSON.stringify(formData)
                // });

                // SIMULACIÓN PARA DEMO (eliminar en producción)
                await new Promise(resolve => setTimeout(resolve, 2000));
                
                // Simulación de respuesta exitosa
                const result = {
                    success: true,
                    data: {
                        ...formData,
                        precio: formData.vehicleType === 'moto' ? 245000 : 
                                formData.vehicleType === 'auto' ? 485000 : 
                                formData.vehicleType === 'taxi' ? 620000 : 520000,
                        referencia: 'SOAT-' + Date.now()
                    }
                };

                if (result.success) {
                    // Éxito
                    const precio = result.data.precio.toLocaleString('es-CO');
                    showMessage(`✅ ¡Cotización exitosa! El precio de tu SOAT es: ${precio}. Te contactaremos pronto a ${result.data.email}`, 'success');
                    
                    // Resetear formulario
                    this.reset();
                    turnstileToken = null;
                    if (typeof turnstile !== 'undefined' && turnstileWidgetId !== null) {
                        turnstile.reset(turnstileWidgetId);
                    }
                    
                    // Scroll al mensaje
                    document.getElementById('messageContainer').scrollIntoView({ behavior: 'smooth' });
                } else {
                    showMessage('❌ ' + (result.message || 'Error al procesar la cotización'), 'error');
                }
            } catch (error) {
                console.error('Error:', error);
                showMessage('❌ Error al procesar la cotización. Por favor intenta nuevamente o contáctanos directamente.', 'error');
            } finally {
                // Rehabilitar botón
                submitBtn.disabled = false;
                submitBtn.innerHTML = originalText;
                document.getElementById('loadingSpinner').style.display = 'none';
            }
        });

        // ==========================================
        // NAVIGATION AND UI ENHANCEMENTS
        // ==========================================
        
        // Menú hamburguesa
        const menuToggle = document.getElementById('menuToggle');
        const navLinks = document.getElementById('navLinks');

        menuToggle.addEventListener('click', function() {
            this.classList.toggle('active');
            navLinks.classList.toggle('active');
        });

        // Cerrar menú al hacer click en un enlace
        navLinks.querySelectorAll('a').forEach(link => {
            link.addEventListener('click', () => {
                menuToggle.classList.remove('active');
                navLinks.classList.remove('active');
            });
        });

        // Header scroll effect
        let lastScroll = 0;
        const header = document.getElementById('header');

        window.addEventListener('scroll', () => {
            const currentScroll = window.pageYOffset;
            
            if (currentScroll > 100) {
                header.classList.add('scrolled');
            } else {
                header.classList.remove('scrolled');
            }
            
            lastScroll = currentScroll;
        });

        // Cerrar modales al hacer click fuera
        window.onclick = function(event) {
            if (event.target.classList.contains('modal')) {
                event.target.classList.remove('show');
                document.body.style.overflow = 'auto';
            }
        }

        // Cerrar modales con la tecla ESC
        document.addEventListener('keydown', function(event) {
            if (event.key === 'Escape') {
                document.querySelectorAll('.modal.show').forEach(modal => {
                    modal.classList.remove('show');
                    document.body.style.overflow = 'auto';
                });
            }
        });

        // ==========================================
        // SMOOTH SCROLL PARA NAVEGACIÓN
        // ==========================================
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                const href = this.getAttribute('href');
                if (href !== '#' && !href.includes('onclick')) {
                    e.preventDefault();
                    const target = document.querySelector(href);
                    if (target) {
                        target.scrollIntoView({
                            behavior: 'smooth',
                            block: 'start'
                        });
                    }
                }
            });
        });

        // ==========================================
        // INTERSECTION OBSERVER PARA ANIMACIONES
        // ==========================================
        const observerOptions = {
            threshold: 0.1,
            rootMargin: '0px 0px -50px 0px'
        };

        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.style.opacity = '1';
                    entry.target.style.transform = 'translateY(0)';
                }
            });
        }, observerOptions);

        document.querySelectorAll('.card, .form-group').forEach(el => {
            el.style.opacity = '0';
            el.style.transform = 'translateY(20px)';
            el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
            observer.observe(el);
        });

        // ==========================================
        // INICIALIZACIÓN
        // ==========================================
        showCookieBanner();

        // Prevenir envío del formulario al presionar Enter en campos que no son el botón
        document.getElementById('soatForm').addEventListener('keypress', function(e) {
            if (e.key === 'Enter' && e.target.type !== 'submit') {
                e.preventDefault();
            }
        });

        // Log de inicialización
        console.log('✅ SOAT Digital inicializado correctamente');
        console.log('📱 Versión: 2.0');
        console.log('🔒 Seguridad: Cloudflare Turnstile activo');
        console.log('🍪 Sistema de cookies: Activo');

        // ==========================================
        // GOOGLE ADS CONVERSION TRACKING (Ejemplo)
        // ==========================================
        function trackConversion() {
            if (cookiePreferences.marketing) {
                // Aquí irían tus eventos de conversión de Google Ads
                // gtag('event', 'conversion', {'send_to': 'AW-XXXXXXX/XXXXXX'});
                console.log('📊 Conversión registrada (demo)');
            }
        }

        // ==========================================
        // GOOGLE ANALYTICS (Ejemplo)
        // ==========================================
        if (cookiePreferences.analytics) {
            // Aquí cargarías Google Analytics
            // (function(i,s,o,g,r,a,m){...})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
            // ga('create', 'UA-XXXXXXX-X', 'auto');
            // ga('send', 'pageview');
            console.log('📊 Google Analytics habilitado (demo)');
        }

        // ==========================================
        // FACEBOOK PIXEL (Ejemplo)
        // ==========================================
        if (cookiePreferences.marketing) {
            // Aquí cargarías Facebook Pixel
            // !function(f,b,e,v,n,t,s){...}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');
            // fbq('init', 'XXXXXXXXXX');
            // fbq('track', 'PageView');
            console.log('📊 Facebook Pixel habilitado (demo)');
        }

        // ==========================================
        // PERFORMANCE MONITORING
        // ==========================================
        window.addEventListener('load', () => {
            if (window.performance) {
                const perfData = window.performance.timing;
                const pageLoadTime = perfData.loadEventEnd - perfData.navigationStart;
                console.log('⏱️ Tiempo de carga: ' + pageLoadTime + 'ms');
            }
        });
    </script>

    <!-- Schema markup adicional para páginas de servicios -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Service",
      "serviceType": "SOAT - Seguro Obligatorio de Accidentes de Tránsito",
      "provider": {
        "@type": "InsuranceAgency",
        "name": "SOAT Digital Colombia"
      },
      "areaServed": {
        "@type": "Country",
        "name": "Colombia"
      },
      "hasOfferCatalog": {
        "@type": "OfferCatalog",
        "name": "Seguros SOAT",
        "itemListElement": [
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "SOAT Motocicleta"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "SOAT Automóvil"
            }
          }
        ]
      }
    }
    </script>
                <div class="trust-badge">
                    <i class="fas fa-users"></i>
                    <p>+50,000 Clientes</p>
                    <span style="color: #718096;">Satisfechos</span>
                </div>
                <div class="trust-badge">
                    <i class="fas fa-star"></i>
                    <p>4.8/5 Estrellas</p>
                    <span style="color: #718096;">Calificación</span>
                </div>
                <div class="trust-badge">
                    <i class="fas fa-clock"></i>
                    <p>24/7 Atención</p>
                    <span style="color: #718096;">Disponible</span>
                </div>
                <div class="trust-badge">
                    <i class="fas fa-shield-alt"></i>
                    <p>100% Seguro</p>
                    <span style="color: #718096;">Verificado</span>
                </div>
            
        </section>

        <!-- Info Cards -->
        <div class="container">
            <h2 class="section-title">¿Por qué necesitas el SOAT?</h2>
            <div class="info-grid">
                <div class="card">
                    <i class="fas fa-gavel"></i>
                    <h3>Obligatorio por Ley</h3>
                    <p>Es un requisito legal para circular en Colombia. Protege a las víctimas de accidentes de tránsito y evita sanciones.</p>
                </div>
                <div class="card">
                    <i class="fas fa-hospital"></i>
                    <h3>Cobertura Médica Completa</h3>
                    <p>Cubre gastos médicos, quirúrgicos, farmacéuticos y hospitalarios por accidentes de tránsito hasta $1.066 millones.</p>
                </div>
                <div class="card">
                    <i class="fas fa-money-bill-wave"></i>
                    <h3>Indemnizaciones</h3>
                    <p>Proporciona indemnización por muerte e incapacidad permanente causadas por accidentes de tránsito.</p>
                </div>
                <div class="card">
                    <i class="fas fa-ambulance"></i>
                    <h3>Gastos de Transporte</h3>
                    <p>Cubre el transporte de víctimas al centro médico más cercano de forma inmediata.</p>
                </div>
                <div class="card">
                    <i class="fas fa-users"></i>
                    <h3>Protección Total</h3>
                    <p>Cubre a conductores, pasajeros y peatones afectados en el accidente sin importar quién sea el culpable.</p>
                </div>
                <div class="card">
                    <i class="fas fa-calendar-check"></i>
                    <h3>Vigencia Anual</h3>
                    <p>Un año completo de protección desde la fecha de expedición. Renovación fácil y rápida.</p>
                </div>
            </div>

            <!-- Quote Form -->
            <section id="cotizar" class="quote-form">
                <h2 class="section-title">Cotiza tu SOAT en 3 Minutos</h2>
                <p style="text-align: center; color: #718096; margin-bottom: 2rem;">
                    Completa el formulario y recibe tu cotización inmediata
                </p>
                
                <div id="messageContainer"></div>
                
                <form id="soatForm" novalidate>
                    <div class="form-group">
                        <label for="vehicleType">
                            <i class="fas fa-car"></i>
                            Tipo de Vehículo *
                        </label>
                        <select id="vehicleType" required aria-required="true">
                            <option value="">Selecciona el tipo de vehículo...</option>
                            <option value="moto">🏍️ Motocicleta</option>
                            <option value="auto">🚗 Automóvil Particular</option>
                            <option value="camioneta">🚙 Camioneta</option>
                            <option value="taxi">🚕 Taxi</option>
                            <option value="bus">🚌 Bus</option>
                            <option value="camion">🚚 Camión</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label for="plate">
                            <i class="fas fa-id-card"></i>
                            Placa del Vehículo *
                        </label>
                        <div class="input-with-icon">
                            <input 
                                type="text" 
                                id="plate" 
                                placeholder="Ej: ABC123" 
                                required 
                                pattern="[A-Za-z]{3}[0-9]{3}"
                                title="Formato: 3 letras y 3 números (ej: ABC123)"
                                maxlength="6"
                                aria-required="true"
                            >
                            <i class="fas fa-check-circle" style="display: none;" id="plateCheck"></i>
                        </div>
                        <small style="color: #718096;">Formato: 3 letras y 3 números</small>
                    </div>

                    <div class="form-group">
                        <label for="name">
                            <i class="fas fa-user"></i>
                            Nombre Completo *
                        </label>
                        <input 
                            type="text" 
                            id="name" 
                            placeholder="Juan Pérez García" 
                            required 
                            minlength="3"
                            aria-required="true"
                        >
                    </div>

                    <div class="form-group">
                        <label for="email">
                            <i class="fas fa-envelope"></i>
                            Correo Electrónico *
                        </label>
                        <input 
                            type="email" 
                            id="email" 
                            placeholder="correo@ejemplo.com" 
                            required
                            aria-required="true"
                        >
                        <small style="color: #718096;">Recibirás tu SOAT a este correo</small>
                    </div>

                    <div class="form-group">
                        <label for="phone">
                            <i class="fas fa-phone"></i>
                            Teléfono / WhatsApp *
                        </label>
                        <input 
                            type="tel" 
                            id="phone" 
                            placeholder="3001234567" 
                            required
                            pattern="[0-9]{10}"
                            title="Ingresa 10 dígitos"
                            maxlength="10"
                            aria-required="true"
                        >
                        <small style="color: #718096;">10 dígitos sin espacios</small>
                    </div>

                    <div class="form-group">
                        <label for="city">
                            <i class="fas fa-map-marker-alt"></i>
                            Ciudad *
                        </label>
                        <select id="city" required aria-required="true">
                            <option value="">Selecciona tu ciudad...</option>
                            <option value="bogota">Bogotá D.C.</option>
                            <option value="medellin">Medellín</option>
                            <option value="cali">Cali</option>
                            <option value="barranquilla">Barranquilla</option>
                            <option value="cartagena">Cartagena</option>
                            <option value="bucaramanga">Bucaramanga</option>
                            <option value="pereira">Pereira</option>
                            <option value="manizales">Manizales</option>
                            <option value="otra">Otra ciudad</option>
                        </select>
                    </div>
                    
                    <!-- Turnstile Cloudflare -->
                    <div class="turnstile-container">
                        <p style="color: #2c3e50; font-weight: 600; margin-bottom: 1rem;">
                            <i class="fas fa-shield-alt"></i> Verificación de Seguridad
                        </p>
                        <div id="turnstile-widget"></div>
                        <div class="security-badge">
                            <i class="fas fa-lock"></i>
                            <span>Protegido por Cloudflare</span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label style="display: flex; align-items: start; gap: 0.5rem; cursor: pointer;">
                            <input 
                                type="checkbox" 
                                id="terms" 
                                required 
                                style="width: auto; margin-top: 0.3rem;"
                                aria-required="true"
                            >
                            <span style="font-weight: 400; font-size: 0.95rem;">
                                Acepto los <a href="#" onclick="openPrivacyModal(); return false;" style="color: #667eea; text-decoration: underline;">términos y condiciones</a> y la <a href="#" onclick="openPrivacyModal(); return false;" style="color: #667eea; text-decoration: underline;">política de privacidad</a>
                            </span>
                        </label>
                    </div>

                    <div class="loading-spinner" id="loadingSpinner"></div>

                    <button type="submit" class="cta-button" id="submitBtn" style="width: 100%; margin-top: 1rem;">
                        <i class="fas fa-paper-plane"></i> Obtener Cotización Gratis
                    </button>

                    <p style="text-align: center; color: #718096; margin-top: 1.5rem; font-size: 0.9rem;">
                        <i class="fas fa-info-circle"></i> Tu información está protegida y segura
                    </p>
                </form>
            </section>

            <!-- Coverage Section -->
            <section id="coberturas" style="margin: 5rem 0;">
                <h2 class="section-title">Coberturas del SOAT 2025</h2>
                <p style="text-align: center; color: #718096; max-width: 700px; margin: 0 auto 3rem;">
                    El SOAT te protege a ti y a terceros en caso de accidentes de tránsito con las siguientes coberturas:
                </p>
                <div class="info-grid">
                    <div class="card">
                        <i class="fas fa-notes-medical"></i>
                        <h3>Gastos Médicos</h3>
                        <p style="font-size: 1.8rem; color: #667eea; font-weight: 700; margin: 1rem 0;">$1.066M</p>
                        <p>Por persona para atención médica, quirúrgica, hospitalaria y medicamentos.</p>
                    </div>
                    <div class="card">
                        <i class="fas fa-truck-medical"></i>
                        <h3>Gastos de Transporte</h3>
                        <p style="font-size: 1.8rem; color: #667eea; font-weight: 700; margin: 1rem 0;">$266.500</p>
                        <p>Para traslado de víctimas al centro asistencial más cercano.</p>
                    </div>
                    <div class="card">
                        <i class="fas fa-wheelchair"></i>
                        <h3>Incapacidad Permanente</h3>
                        <p style="font-size: 1.8rem; color: #667eea; font-weight: 700; margin: 1rem 0;">$88.320M</p>
                        <p>Por persona en caso de incapacidad permanente causada por el accidente.</p>
                    </div>
                    <div class="card">
                        <i class="fas fa-heart-broken"></i>
                        <h3>Muerte</h3>
                        <p style="font-size: 1.8rem; color: #667eea; font-weight: 700; margin: 1rem 0;">$88.320M</p>
                        <p>Por víctima en caso de fallecimiento como resultado del accidente.</p>
                    </div>
                    <div class="card">
                        <i class="fas fa-praying-hands"></i>
                        <h3>Gastos Funerarios</h3>
                        <p style="font-size: 1.8rem; color: #667eea; font-weight: 700; margin: 1rem 0;">$13.320M</p>
                        <p>Para cubrir gastos de sepelio y servicios funerarios.</p>
                    </div>
                    <div class="card">
                        <i class="fas fa-hands-helping"></i>
                        <h3>Sin Franquicia</h3>
                        <p style="font-size: 1.8rem; color: #667eea; font-weight: 700; margin: 1rem 0;">100%</p>
                        <p>Cobertura completa sin deducibles ni copagos para las víctimas.</p>
                    </div>
                </div>
            </section>

            <!-- FAQ Section -->
            <section id="preguntas" style="margin: 5rem 0;">
                <h2 class="section-title">Preguntas Frecuentes</h2>
                <div class="info-grid" style="grid-template-columns: 1fr;">
                    <div class="card">
                        <h3><i class="fas fa-question-circle" style="margin-right: 0.5rem;"></i> ¿Qué es el SOAT?</h3>
                        <p>El SOAT (Seguro Obligatorio de Accidentes de Tránsito) es un seguro obligatorio en Colombia que cubre los gastos médicos y hospitalarios de las víctimas de accidentes de tránsito, sin importar quién sea el responsable del accidente.</p>
                    </div>
                    <div class="card">
                        <h3><i class="fas fa-question-circle" style="margin-right: 0.5rem;"></i> ¿Cuánto cuesta el SOAT?</h3>
                        <p>El precio del SOAT varía según el tipo de vehículo y la ciudad. Motocicletas desde $200.000, automóviles desde $450.000. Cotiza gratis para conocer el precio exacto para tu vehículo.</p>
                    </div>
                    <div class="card">
                        <h3><i class="fas fa-question-circle" style="margin-right: 0.5rem;"></i> ¿Qué pasa si no tengo SOAT?</h3>
                        <p>Circular sin SOAT es una infracción de tránsito que puede resultar en multas desde $936.000, inmovilización del vehículo y no podrás matricular o renovar documentos del vehículo.</p>
                    </div>
                    <div class="card">
                        <h3><i class="fas fa-question-circle" style="margin-right: 0.5rem;"></i> ¿Cómo recibo mi SOAT?</h3>
                        <p>Una vez completado el pago, recibirás tu póliza digital de SOAT inmediatamente en tu correo electrónico. Es 100% válido y no necesitas documento físico.</p>
                    </div>
                </div>
            </section>
        </div>
    </main>

    <!-- Footer -->
    <footer id="contacto">
        <div class="footer-content">
            <div class="footer-section">
                <h3><i class="fas fa-shield-alt"></i> SOAT Digital</h3>
                <p style="margin: 1rem 0;">Tu seguro obligatorio de forma rápida, segura y 100% digital.</p>
                <p style="margin: 0.5rem 0;"><i class="fas fa-envelope"></i> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="90f9fef6ffd0e3fff1e4bef3fffdbef3ff">[email&#160;protected]</a></p>
                <p style="margin: 0.5rem 0;"><i class="fas fa-phone"></i> 01 8000 123 456</p>
                <p style="margin: 0.5rem 0;"><i class="fas fa-whatsapp"></i> WhatsApp: 300 123 4567</p>
                <p style="margin: 0.5rem 0;"><i class="fas fa-map-marker-alt"></i> Bogotá, Colombia</p>
            </div>
            <div class="footer-section">
                <h3>Enlaces Rápidos</h3>
                <a href="#cotizar"><i class="fas fa-calculator"></i> Cotizar SOAT</a>
                <a href="#coberturas"><i class="fas fa-shield-alt"></i> Coberturas</a>
                <a href="#preguntas"><i class="fas fa-question-circle"></i> Preguntas Frecuentes</a>
                <a href="#" onclick="openPrivacyModal(); return false;"><i class="fas fa-lock"></i> Política de Privacidad</a>
                <a href="#" onclick="openCookieModal(); return false;"><i class="fas fa-cookie-bite"></i> Configurar Cookies</a>
            </div>
            <div class="footer-section">
                <h3>Recursos</h3>
                <a href="#"><i class="fas fa-file-alt"></i> Términos y Condiciones</a>
                <a href="#"><i class="fas fa-gavel"></i> Aviso Legal</a>
                <a href="#"><i class="fas fa-headset"></i> Atención al Cliente</a>
                <a href="#"><i class="fas fa-blog"></i> Blog</a>
                <a href="#"><i class="fas fa-briefcase"></i> Trabaja con Nosotros</a>
            </div>
            <div class="footer-section">
                <h3>Síguenos</h3>
                <div class="social-links">
                    <a href="#" class="social-icon" aria-label="Facebook"><i class="fab fa-facebook-f"></i></a>
                    <a href="#" class="social-icon" aria-label="Twitter"><i class="fab fa-twitter"></i></a>
                    <a href="#" class="social-icon" aria-label="Instagram"><i class="fab fa-instagram"></i></a>
                    <a href="#" class="social-icon" aria-label="LinkedIn"><i class="fab fa-linkedin-in"></i></a>
                </div>
                <p style="margin-top: 1.5rem; color: #cbd5e0;">
                    <i class="fas fa-certificate"></i> Certificado por la Superintendencia Financiera
                </p>
            </div>
        </div>
        <div style="text-align: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #4a5568;">
            <p>&copy; 2025 SOAT Digital Colombia. Todos los derechos reservados.</p>
            <p style="margin-top: 0.5rem; color: #a0aec0; font-size: 0.9rem;">
                Hecho con <i class="fas fa-heart" style="color: #ef4444;"></i> en Colombia
            </p>
        </div>
    </footer>

    <!-- Cookie Banner -->
    <div class="cookie-banner" id="cookieBanner" role="dialog" aria-label="Aviso de cookies">
        <div class="cookie-content">
            <div>
                <h3><i class="fas fa-cookie-bite"></i> Este sitio usa cookies</h3>
                <p>Utilizamos cookies para mejorar tu experiencia, analizar el tráfico y personalizar el contenido. Al hacer clic en "Aceptar todo", aceptas nuestro uso de cookies según nuestra política de privacidad.</p>
            </div>
            <div class="cookie-buttons">
                <button class="cookie-button accept-all" onclick="acceptAllCookies()">
                    <i class="fas fa-check"></i> Aceptar Todo
                </button>
                <button class="cookie-button reject-all" onclick="rejectAllCookies()">
                    <i class="fas fa-times"></i> Rechazar Todo
                </button>
                <button class="cookie-button customize" onclick="openCookieModal()">
                    <i class="fas fa-cog"></i> Personalizar
                </button>
            </div>
        </div>
    </div>

    <!-- Privacy Policy Modal -->
    <div id="privacyModal" class="modal" role="dialog" aria-labelledby="privacyTitle" aria-modal="true">
        <div class="modal-content">
            <span class="close" onclick="closePrivacyModal()" aria-label="Cerrar">&times;</span>
            <h2 id="privacyTitle"><i class="fas fa-lock"></i> Política de Privacidad y Protección de Datos</h2>
            
            <div class="privacy-section">
                <h3>1. Información que Recopilamos</h3>
                <p>Recopilamos información personal cuando solicitas una cotización de SOAT, incluyendo:</p>
                <ul>
                    <li>Nombre completo y documento de identidad</li>
                    <li>Placa y tipo de vehículo</li>
                    <li>Correo electrónico y número de teléfono</li>
                    <li>Ciudad de residencia</li>
                    <li>Dirección IP y datos de navegación</li>
                </ul>
            </div>

            <div class="privacy-section">
                <h3>2. Uso de la Información</h3>
                <p>Utilizamos tu información para:</p>
                <ul>
                    <li>Procesar tu solicitud y emitir pólizas de SOAT</li>
                    <li>Comunicarnos contigo sobre tu seguro</li>
                    <li>Enviar recordatorios de renovación</li>
                    <li>Cumplir con obligaciones legales y regulatorias</li>
                    <li>Mejorar nuestros servicios y experiencia de usuario</li>
                    <li>Prevenir fraudes y garantizar la seguridad</li>
                </ul>
            </div>

            <div class="privacy-section">
                <h3>3. Protección de Datos</h3>
                <p>Implementamos medidas de seguridad técnicas y organizativas robustas:</p>
                <ul>
                    <li>Encriptación SSL/TLS en todas las comunicaciones</li>
                    <li>Servidores seguros con certificación ISO 27001</li>
                    <li>Acceso restringido a datos personales</li>
                    <li>Auditorías de seguridad periódicas</li>
                    <li>Respaldo y recuperación de datos</li>
                </ul>
            </div>

            <div class="privacy-section">
                <h3>4. Compartir Información</h3>
                <p>No vendemos tu información personal. Compartimos datos únicamente con:</p>
                <ul>
                    <li>Aseguradoras autorizadas por la Superintendencia Financiera</li>
                    <li>Entidades reguladoras (RUNT, Ministerio de Transporte)</li>
                    <li>Proveedores de servicios bajo acuerdos de confidencialidad</li>
                    <li>Autoridades competentes cuando sea legalmente requerido</li>
                </ul>
            </div>

            <div class="privacy-section">
                <h3>5. Tus Derechos (Ley 1581 de 2012)</h3>
                <p>Tienes derecho a:</p>
                <ul>
                    <li><strong>Acceder</strong> a tus datos personales</li>
                    <li><strong>Rectificar</strong> información incorrecta o desactualizada</li>
                    <li><strong>Cancelar</strong> tus datos cuando no sean necesarios</li>
                    <li><strong>Oponerte</strong> al tratamiento de tus datos</li>
                    <li><strong>Revocar</strong> la autorización en cualquier momento</li>
                </ul>
                <p>Para ejercer estos derechos, contáctanos en: <strong><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0272706b7463616b66636642716d63762c616d6f2c616d">[email&#160;protected]</a></strong></p>
            </div>

            <div class="privacy-section">
                <h3>6. Cookies y Tecnologías Similares</h3>
                <p>Utilizamos cookies para:</p>
                <ul>
                    <li>Recordar tus preferencias</li>
                    <li>Analizar el uso del sitio web</li>
                    <li>Personalizar contenido y anuncios</li>
                    <li>Mejorar la seguridad y prevenir fraudes</li>
                </ul>
                <p>Puedes gestionar tus preferencias de cookies en cualquier momento.</p>
            </div>

            <div class="privacy-section">
                <h3>7. Retención de Datos</h3>
                <p>Conservamos tu información personal durante el tiempo necesario para cumplir con los fines para los que fue recopilada y según lo requiera la ley (mínimo 5 años para registros de seguros).</p>
            </div>

            <div class="privacy-section">
                <h3>8. Cambios a esta Política</h3>
                <p>Podemos actualizar esta política periódicamente. Te notificaremos sobre cambios significativos a través de nuestro sitio web o por correo electrónico.</p>
                <p><strong>Última actualización:</strong> Enero 2025</p>
            </div>

            <div class="privacy-section">
                <h3>9. Contacto</h3>
                <p>Para cualquier consulta sobre privacidad y protección de datos:</p>
                <p><strong>Email:</strong> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e494968d9285878d808580a4978b8590ca878b89ca878b">[email&#160;protected]</a></p>
                <p><strong>Teléfono:</strong> 01 8000 123 456</p>
                <p><strong>Dirección:</strong> Bogotá, Colombia</p>
            </div>

            <button class="cta-button" onclick="closePrivacyModal()" style="margin-top: 2rem; width: 100%;">
                <i class="fas fa-check"></i> Entendido
            </button>
        </div>
    </div>

    <!-- Cookie Settings Modal -->
    <div id="cookieModal" class="modal" role="dialog" aria-labelledby="cookieTitle" aria-modal="true">
        <div class="modal-content">
            <span class="close" onclick="closeCookieModal()" aria-label="Cerrar">&times;</span>
            <h2 id="cookieTitle"><i class="fas fa-cookie-bite"></i> Configuración de Cookies</h2>
            
            <p style="margin-bottom: 2rem; color: #718096;">
                Las cookies nos ayudan a ofrecerte una mejor experiencia. Puedes elegir qué tipos de cookies aceptar.
            </p>

            <div class="privacy-section">
                <h3><i class="fas fa-check-circle" style="color: #10b981;"></i> Cookies Necesarias (Siempre activas)</h3>
                <p>Estas cookies son esenciales para el funcionamiento del sitio web y no pueden desactivarse. Incluyen cookies de sesión, seguridad y accesibilidad.</p>
            </div>

            <div class="privacy-section">
                <h3><i class="fas fa-chart-line"></i> Cookies Analíticas</h3>
                <label style="display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500;">
                    <input type="checkbox" id="analyticsCookies" checked style="width: 20px; height: 20px;">
                    Permitir cookies analíticas
                </label>
                <p style="margin-top: 0.5rem;">Nos ayudan a entender cómo interactúas con el sitio para mejorarlo. Usamos Google Analytics y herramientas similares.</p>
            </div>

            <div class="privacy-section">
                <h3><i class="fas fa-bullhorn"></i> Cookies de Marketing</h3>
                <label style="display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500;">
                    <input type="checkbox" id="marketingCookies" style="width: 20px; height: 20px;">
                    Permitir cookies de marketing
                </label>
                <p style="margin-top: 0.5rem;">Utilizadas para mostrar anuncios relevantes basados en tus intereses. Incluye remarketing y publicidad personalizada.</p>
            </div>

            <div class="privacy-section">
                <h3><i class="fas fa-sliders-h"></i> Cookies de Preferencias</h3>
                <label style="display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500;">
                    <input type="checkbox" id="preferenceCookies" checked style="width: 20px; height: 20px;">
                    Permitir cookies de preferencias
                </label>
                <p
                style="margin-top: 0.5rem;">Guardan tus preferencias y configuraciones del sitio, como idioma y región.</p>
            </div>

            <div style="display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap;">
                <button class="cta-button" onclick="saveCustomCookies()" style="flex: 1;">
                    <i class="fas fa-save"></i> Guardar Preferencias
                </button>
                <button class="cookie-button reject-all" onclick="closeCookieModal()" style="flex: 1;">
                    <i class="fas fa-times"></i> Cancelar
                </button>
            </div>
        </div>
    </div>

    <!-- Cloudflare Turnstile Script -->
    <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>

    <script>
        // ==========================================
        // COOKIE MANAGEMENT SYSTEM
        // ==========================================
        const cookiePreferences = {
            necessary: true,
            analytics: false,
            marketing: false,
            preferences: false
        };

        function showCookieBanner() {
            const consent = localStorage.getItem('cookieConsent');
            if (!consent) {
                setTimeout(() => {
                    document.getElementById('cookieBanner').classList.add('show');
                }, 1000);
            } else {
                loadCookiePreferences();
            }
        }

        function acceptAllCookies() {
            cookiePreferences.analytics = true;
            cookiePreferences.marketing = true;
            cookiePreferences.preferences = true;
            saveCookiePreferences();
            document.getElementById('cookieBanner').classList.remove('show');
            console.log('✅ Todas las cookies aceptadas');
            showMessage('Preferencias de cookies guardadas correctamente', 'success');
        }

        function rejectAllCookies() {
            cookiePreferences.analytics = false;
            cookiePreferences.marketing = false;
            cookiePreferences.preferences = false;
            saveCookiePreferences();
            document.getElementById('cookieBanner').classList.remove('show');
            console.log('❌ Cookies opcionales rechazadas');
            showMessage('Solo se usarán cookies necesarias', 'success');
        }

        function saveCookiePreferences() {
            localStorage.setItem('cookieConsent', JSON.stringify(cookiePreferences));
            localStorage.setItem('cookieConsentDate', new Date().toISOString());
            loadCookiePreferences();
        }

        function loadCookiePreferences() {
            const saved = localStorage.getItem('cookieConsent');
            if (saved) {
                Object.assign(cookiePreferences, JSON.parse(saved));
                if (cookiePreferences.analytics) {
                    console.log('📊 Analytics cookies habilitadas');
                }
                if (cookiePreferences.marketing) {
                    console.log('🎯 Marketing cookies habilitadas');
                }
            }
        }

        function openCookieModal() {
            document.getElementById('cookieModal').classList.add('show');
            document.getElementById('analyticsCookies').checked = cookiePreferences.analytics;
            document.getElementById('marketingCookies').checked = cookiePreferences.marketing;
            document.getElementById('preferenceCookies').checked = cookiePreferences.preferences;
            document.body.style.overflow = 'hidden';
        }

        function closeCookieModal() {
            document.getElementById('cookieModal').classList.remove('show');
            document.body.style.overflow = 'auto';
        }

        function saveCustomCookies() {
            cookiePreferences.analytics = document.getElementById('analyticsCookies').checked;
            cookiePreferences.marketing = document.getElementById('marketingCookies').checked;
            cookiePreferences.preferences = document.getElementById('preferenceCookies').checked;
            saveCookiePreferences();
            closeCookieModal();
            document.getElementById('cookieBanner').classList.remove('show');
            showMessage('Preferencias de cookies guardadas correctamente', 'success');
        }

        function openPrivacyModal() {
            document.getElementById('privacyModal').classList.add('show');
            document.body.style.overflow = 'hidden';
        }

        function closePrivacyModal() {
            document.getElementById('privacyModal').classList.remove('show');
            document.body.style.overflow = 'auto';
        }

        // ==========================================
        // CLOUDFLARE TURNSTILE INTEGRATION
        // ==========================================
        let turnstileToken = null;
        let turnstileWidgetId = null;

        function onTurnstileSuccess(token) {
            turnstileToken = token;
            console.log('✅ Turnstile verificado exitosamente');
            document.querySelector('button[type="submit"]').disabled = false;
            document.querySelector('button[type="submit"]').style.opacity = '1';
        }

        function onTurnstileExpire() {
            turnstileToken = null;
            console.log('⚠️ Turnstile expiró, por favor verifica nuevamente');
            document.querySelector('button[type="submit"]').disabled = true;
            document.querySelector('button[type="submit"]').style.opacity = '0.6';
            showMessage('La verificación de seguridad expiró. Por favor, verifica nuevamente.', 'error');
        }

        function onTurnstileError(error) {
            turnstileToken = null;
            console.log('❌ Error en Turnstile:', error);
            document.querySelector('button[type="submit"]').disabled = true;
            document.querySelector('button[type="submit"]').style.opacity = '0.6';
        }

        window.addEventListener('load', function() {
            if (typeof turnstile !== 'undefined') {
                turnstileWidgetId = turnstile.render('#turnstile-widget', {
                    sitekey: '0x4AAAAAAB8DVh5c3V1UZagb',
                    theme: 'light',
                    size: 'normal',
                    callback: onTurnstileSuccess,
                    'expired-callback': onTurnstileExpire,
                    'error-callback': onTurnstileError,
                });
                
                document.querySelector('button[type="submit"]').disabled = true;
                document.querySelector('button[type="submit"]').style.opacity = '0.6';
            } else {
                console.warn('⚠️ Turnstile no está cargado');
            }
        });

        // ==========================================
        // FORM VALIDATION AND SUBMISSION
        // ==========================================
        function showMessage(message, type) {
            const messageContainer = document.getElementById('messageContainer');
            messageContainer.innerHTML = `
                <div class="message ${type}">
                    <i class="fas fa-${type === 'success' ? 'check-circle' : 'exclamation-circle'}"></i>
                    ${message}
                </div>
            `;
            messageContainer.querySelector('.message').style.display = 'block';
            
            setTimeout(() => {
                if (messageContainer.querySelector('.message')) {
                    messageContainer.querySelector('.message').style.display = 'none';
                }
            }, 5000);
        }

        // Validación en tiempo real de la placa
        document.getElementById('plate').addEventListener('input', function(e) {
            const value = e.target.value.toUpperCase();
            e.target.value = value;
            
            const pattern = /^[A-Z]{3}[0-9]{3}$/;
            const check = document.getElementById('plateCheck');
            
            if (pattern.test(value)) {
                e.target.style.borderColor = '#10b981';
                check.style.display = 'block';
                check.style.color = '#10b981';
            } else {
                e.target.style.borderColor = '#e0e0e0';
                check.style.display = 'none';
            }
        });

        // Validación del teléfono
        document.getElementById('phone').addEventListener('input', function(e) {
            e.target.value = e.target.value.replace(/\D/g, '');
        });

        // Form submission
        document.getElementById('soatForm').addEventListener('submit', async function(e) {
            e.preventDefault();
            
            if (!turnstileToken) {
                showMessage('⚠️ Por favor completa la verificación de seguridad (Turnstile)', 'error');
                return;
            }

            if (!document.getElementById('terms').checked) {
                showMessage('⚠️ Debes aceptar los términos y condiciones', 'error');
                return;
            }
            
            const formData = {
                vehicleType: document.getElementById('vehicleType').value,
                plate: document.getElementById('plate').value,
                name: document.getElementById('name').value,
                email: document.getElementById('email').value,
                phone: document.getElementById('phone').value,
                city: document.getElementById('city').value,
                turnstileToken: turnstileToken,
                timestamp: new Date().toISOString(),
                userAgent: navigator.userAgent
            };

            const submitBtn = document.getElementById('submitBtn');
            const originalText = submitBtn.innerHTML;
            submitBtn.disabled = true;
            submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Procesando...';
            document.getElementById('loadingSpinner').style.display = 'block';

            try {
                // 🔥 REEMPLAZA con tu URL de backend real
                // const response = await fetch('https://segurosuraenlinea.comm/api/cotizacion', {
                //     method: 'POST',
                //     headers: { 'Content-Type': 'application/json' },
                //     body: JSON.stringify(formData)
                // });

                // SIMULACIÓN DEMO
                await new Promise(resolve => setTimeout(resolve, 2000));
                
                const result = {
                    success: true,
                    data: {
                        ...formData,
                        precio: formData.vehicleType === 'moto' ? 245000 : 
                                formData.vehicleType === 'auto' ? 485000 : 
                                formData.vehicleType === 'taxi' ? 620000 : 520000,
                        referencia: 'SOAT-' + Date.now()
                    }
                };

                if (result.success) {
                    const precio = result.data.precio.toLocaleString('es-CO');
                    showMessage(`✅ ¡Cotización exitosa! El precio de tu SOAT es: $${precio}. Te contactaremos pronto a ${result.data.email}`, 'success');
                    
                    this.reset();
                    turnstileToken = null;
                    if (typeof turnstile !== 'undefined' && turnstileWidgetId !== null) {
                        turnstile.reset(turnstileWidgetId);
                    }
                    
                    document.getElementById('messageContainer').scrollIntoView({ behavior: 'smooth' });
                    
                    if (cookiePreferences.marketing) {
                        trackConversion();
                    }
                } else {
                    showMessage('❌ ' + (result.message || 'Error al procesar la cotización'), 'error');
                }
            } catch (error) {
                console.error('Error:', error);
                showMessage('❌ Error al procesar la cotización. Por favor intenta nuevamente.', 'error');
            } finally {
                submitBtn.disabled = false;
                submitBtn.innerHTML = originalText;
                document.getElementById('loadingSpinner').style.display = 'none';
            }
        });

        // ==========================================
        // NAVIGATION
        // ==========================================
        const menuToggle = document.getElementById('menuToggle');
        const navLinks = document.getElementById('navLinks');

        menuToggle.addEventListener('click', function() {
            this.classList.toggle('active');
            navLinks.classList.toggle('active');
        });

        navLinks.querySelectorAll('a').forEach(link => {
            link.addEventListener('click', () => {
                menuToggle.classList.remove('active');
                navLinks.classList.remove('active');
            });
        });

        const header = document.getElementById('header');
        window.addEventListener('scroll', () => {
            if (window.pageYOffset > 100) {
                header.classList.add('scrolled');
            } else {
                header.classList.remove('scrolled');
            }
        });

        window.onclick = function(event) {
            if (event.target.classList.contains('modal')) {
                event.target.classList.remove('show');
                document.body.style.overflow = 'auto';
            }
        }

        document.addEventListener('keydown', function(event) {
            if (event.key === 'Escape') {
                document.querySelectorAll('.modal.show').forEach(modal => {
                    modal.classList.remove('show');
                    document.body.style.overflow = 'auto';
                });
            }
        });

        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                const href = this.getAttribute('href');
                if (href !== '#' && !href.includes('onclick')) {
                    e.preventDefault();
                    const target = document.querySelector(href);
                    if (target) {
                        target.scrollIntoView({ behavior: 'smooth', block: 'start' });
                    }
                }
            });
        });

        // ==========================================
        // ANIMATIONS
        // ==========================================
        const observerOptions = {
            threshold: 0.1,
            rootMargin: '0px 0px -50px 0px'
        };

        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.style.opacity = '1';
                    entry.target.style.transform = 'translateY(0)';
                }
            });
        }, observerOptions);

        document.querySelectorAll('.card, .form-group').forEach(el => {
            el.style.opacity = '0';
            el.style.transform = 'translateY(20px)';
            el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
            observer.observe(el);
        });

        // ==========================================
        // TRACKING
        // ==========================================
        function trackConversion() {
            if (cookiePreferences.marketing) {
                console.log('📊 Conversión registrada (demo)');
            }
        }

        // ==========================================
        // INIT
        // ==========================================
        showCookieBanner();

        document.getElementById('soatForm').addEventListener('keypress', function(e) {
            if (e.key === 'Enter' && e.target.type !== 'submit') {
                e.preventDefault();
            }
        });

        console.log('✅ SOAT Digital inicializado correctamente');
        console.log('📱 Versión: 2.0');
        console.log('🔒 Seguridad: Cloudflare Turnstile activo');

        window.addEventListener('load', () => {
            if (window.performance) {
                const perfData = window.performance.timing;
                const pageLoadTime = perfData.loadEventEnd - perfData.navigationStart;
                console.log('⏱️ Tiempo de carga: ' + pageLoadTime + 'ms');
            }
        });
    </script>

    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Service",
      "serviceType": "SOAT - Seguro Obligatorio de Accidentes de Tránsito",
      "provider": {
        "@type": "InsuranceAgency",
        "name": "SOAT Digital Colombia"
      },
      "areaServed": {
        "@type": "Country",
        "name": "Colombia"
      },
      "hasOfferCatalog": {
        "@type": "OfferCatalog",
        "name": "Seguros SOAT",
        "itemListElement": [
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "SOAT Motocicleta"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "SOAT Automóvil"
            }
          }
        ]
      }
    }
    </script>
</body>
</html>