/* ==========================================================================
   RASTROSEGURO - DESIGN SYSTEM & BASE STYLES
   Minimalista, WPO (Web Performance Optimization), Mobile First
   ========================================================================== */

:root {
    /* Color Palette - Apple/Tesla Dark Premium */
    --color-primary: #000000;
    --color-secondary: #161617;
    --color-accent: #2997ff;
    --color-success: #25d366;
    --color-danger: #ff3b30;

    /* Neutral Colors for Base Design */
    --color-bg: #000000;
    /* Fondo general ultra oscuro */
    --color-surface: #1d1d1f;
    /* Gris espacial Apple */
    --color-text: #f5f5f7;
    /* Letra blanca mate */
    --color-text-light: #a1a1a6;
    /* Texto secundario gris */
    --color-border: rgba(255, 255, 255, 0.1);

    /* Typography (Estilo Apple System Native) */
    --font-family-base: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

    /* Layout Specs */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;

    /* Effects Premium */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   RESET & TYPOGRAPHY
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    /* Base 16px */
    scroll-behavior: smooth;
    /* Smooth scrolling para navegación interna */
}

body {
    font-family: var(--font-family-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ==========================================================================
   UTILITY CLASSES & LAYOUT
   ========================================================================== */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.text-accent {
    color: var(--color-accent);
}

/* ==========================================================================
   BUTTONS (Pills, Solid Shapes Apple-like)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    letter-spacing: -0.01em;
}

.btn--primary {
    background-color: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.btn--primary:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn--outline {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    backdrop-filter: blur(10px);
}

.btn--outline:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
}

.btn--whatsapp {
    background-color: var(--color-success);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn--whatsapp:hover {
    background-color: #1ebe5d;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    width: 100%;
    /* Default mobile width */
}

.icon-social {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   HEADER (Glassmorphism estilo Apple Nav)
   ========================================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.header__logo strong {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--color-text);
    /* Texto en color claro brillante */
    letter-spacing: -0.04em;
    line-height: 1;
}

.header__logo span {
    color: var(--color-accent);
}

.header__nav {
    display: none;
    /* Hidden on mobile by default */
    gap: var(--spacing-md);
    align-items: center;
}

.header__nav a {
    font-weight: 500;
    transition: color var(--transition-fast);
}

.header__nav a:hover {
    color: var(--color-accent);
}

.header__menu-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    display: block;
    /* Visible on mobile */
}

/* ==========================================================================
   HERO SECTION (Oscuro y envolvente)
   ========================================================================== */
.hero {
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg);
    background-image: radial-gradient(circle at top right, rgba(41, 151, 255, 0.1), transparent 50%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.05), transparent 50%);
    color: var(--color-text);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.hero__container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    position: relative;
    z-index: 2;
}

.hero__badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero__title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.03em;
}

/* ANIMACIÓN ROTATIVA TÍTULO HERO */
.animated-text-container {
    display: grid;
    align-items: center;
}

.animated-text {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    pointer-events: none;
}

.animated-text.active {
    opacity: 1;
    pointer-events: auto;
}

.animated-text.exiting {
    opacity: 0;
    pointer-events: none;
}

.hero__description {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    font-weight: 400;
    line-height: 1.5;
}

.hero__benefits-list {
    margin-bottom: var(--spacing-lg);
}

.hero__benefits-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.icon-check {
    width: 20px;
    height: 20px;
    color: var(--color-success);
}

.hero__ctas {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Mockup Placeholder para Diseño Visual (Mobile)*/
.hero__mockup {
    width: 280px;
    height: 550px;
    background: #111;
    border-radius: 40px;
    margin: 0 auto;
    border: 12px solid #222;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.hero__mockup-screen {
    background: var(--color-bg);
    height: 100%;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.map-placeholder {
    height: 60%;
    background: #e5e7eb;
    background-image: radial-gradient(#d1d5db 20%, transparent 0), radial-gradient(#d1d5db 20%, transparent 0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.alert-placeholder {
    background: var(--color-success);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    margin: 1rem;
    border-radius: 12px;
    transform: translateY(-30px);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   TRUST SECTION (Prueba Social)
   ========================================================================== */
.trust-bar {
    background-color: var(--color-surface);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
}

.trust-bar__container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
}

.trust-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.trust-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -1px;
}

.trust-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}


/* ==========================================================================
   GENERAL SECTIONS
   ========================================================================== */
.section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 1.125rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.text-center {
    text-align: center;
}

.text-danger {
    color: var(--color-danger);
}

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

.bg-dark {
    background-color: var(--color-primary);
    color: white;
}

.bg-dark .section-title {
    color: white;
}

.bg-dark .section-desc {
    color: #cbd5e1;
}

/* ==========================================================================
   PROBLEM / SOLUTION (Glass Cards)
   ========================================================================== */
.pb-container {
    max-width: 800px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-danger);
}

/* ==========================================================================
   HOW IT WORKS (STEPS) & BENEFITS
   ========================================================================== */
.steps-grid,
.benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.step-card,
.benefit-card {
    background: var(--color-surface);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    text-align: center;
}

.step-card:hover,
.benefit-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.step-icon {
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.05);
    /* Subtile circle */
    color: var(--color-accent);
    font-size: 1.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto var(--spacing-sm);
    border: 1px solid var(--color-border);
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.step-card h3,
.benefit-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* ==========================================================================
   VIDEO DEMOSTRATIVO (LAZY LOAD YOUTUBE)
   ========================================================================== */
.video-wrapper {
    max-width: 800px;
    /* Horizontal por defecto */
    margin: var(--spacing-lg) auto 0;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.video-vertical {
    max-width: 320px;
    /* Ancho de móvil para centrar en Desktop */
    aspect-ratio: 9 / 16;
    /* Invertimos el ratio para formato vertical */
    border: 12px solid #222;
    /* Simulamos el marco de un teléfono */
    border-radius: 40px;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Imagen generada de pantalla con widgets/apps */
    background: url('../assets/images/app-screen.png') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.video-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.play-btn-circle {
    width: 80px;
    height: 80px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 20;
    transition: transform 0.3s;
    box-shadow: 0 0 20px rgba(56, 182, 255, 0.5);
}

.video-thumbnail:hover .play-btn-circle {
    transform: scale(1.1);
}

.play-btn-triangle {
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 24px solid white;
    margin-left: 5px;
}

.video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-container {
    max-width: 800px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    transition: background 0.3s;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-item summary {
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--color-text);
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 2rem;
    letter-spacing: -0.01em;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.5rem;
    color: var(--color-accent);
    line-height: 1;
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-answer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text);
}

/* ==========================================================================
   CONTACT FORMS & HERO FORM
   ========================================================================== */
.contact-container {
    max-width: 600px;
}

.contact-box {
    background: var(--color-surface);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.hero__form-box {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 22, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--border-radius-lg);
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-family-base);
    transition: all var(--transition-fast);
    background-color: rgba(0, 0, 0, 0.5);
    /* Ultra oscuro mate */
    color: var(--color-text);
    outline: none;
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: #888888;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--color-accent);
    background-color: #000000;
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.2);
}

.honeypot {
    position: absolute;
    left: -9999px;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-align: center;
}

.form-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   FOOTER & WHATSAPP FLOAT
   ========================================================================== */
.footer {
    background: var(--color-primary);
    color: #94a3b8;
    padding: var(--spacing-md) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-success);
    color: white;
    padding: 12px 20px 12px 18px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: wa-pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.05) translateY(-5px);
    animation: none;
}

.wa-text {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

@keyframes wa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ==========================================================================
   MODAL (EXIT INTENT POP-UP)
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(15, 32, 39, 0.85);
    /* Oscuro corporativo */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-danger);
}

@keyframes modalPop {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   MEDIA QUERIES (TABLET Y DESKTOP)
   ========================================================================== */

@media (min-width: 768px) {
    .hero__title {
        font-size: 3rem;
    }

    .hero__ctas {
        flex-direction: row;
    }

    .btn--large {
        width: auto;
        /* Reset full width */
    }

    .trust-bar__container {
        flex-direction: row;
        justify-content: space-around;
    }

    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .header__nav {
        display: flex;
        /* Show nav on desktop */
    }

    .header__menu-btn {
        display: none;
        /* Hide hamburger */
    }

    .hero__container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .hero__content {
        flex: 1;
        max-width: 600px;
    }

    .hero__image-wrapper {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .hero__title {
        font-size: 3.5rem;
    }

    .hero {
        padding: var(--spacing-xl) 0;
    }

    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .section-title {
        font-size: 2.5rem;
    }
}