/* =========================================
   1. SISTEMA DE DISEÑO GLOBAL (Dark & Light)
========================================= */
:root {
    /* Paleta Dark Premium (Header / Hero) */
    --bg-dark-primary: #0B0F19;
    --bg-dark-secondary: #1A2235;
    --text-main: #FFFFFF;
    --text-muted: #9BA4B5;

    /* Acentos AlekFlow */
    --color-cyan: #00BFFF;
    --color-orange: #FF8C00;
    --color-navy: #002D62;

    /* Paleta Light (Secciones Inferiores) */
    --color-bg-light: #FAFAFA;
    --color-text-dark: #4A4A4A;

    /* Tipografía */
    --font-headings: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* Reseteo Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Configuración Base Dark */
body {
    font-family: var(--font-body);
    background-color: var(--bg-dark-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-headings);
    color: var(--text-main);
}

a {
    text-decoration: none;
}

/* =========================================
   2. NAVBAR (Dark Premium)
========================================= */
.dark-nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: var(--bg-dark-secondary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
}

.temp-logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-white {
    color: var(--text-main);
}

.logo-cyan {
    color: var(--color-cyan);
}

.btn-orange-header {
    background-color: var(--color-orange);
    color: var(--text-main);
    border-radius: 4px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-orange-header:hover {
    transform: translateY(-2px);
}

/* =========================================
   3. HERO SECTION (Dark Tech)
========================================= */
.hero-dark {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, var(--bg-dark-secondary) 0%, var(--bg-dark-primary) 70%);
    overflow: hidden;
    /* Modificación aquí: Añadimos 120px de espacio superior */
    padding: 120px 5% 2rem 5%;
}

.hero-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0, 191, 255, 0.05) 40px, rgba(0, 191, 255, 0.05) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0, 191, 255, 0.05) 40px, rgba(0, 191, 255, 0.05) 41px);
    z-index: 0;
}

.hero-grid {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    width: 100%;
}

.hero-text-col h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-text-col p {
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.btn-orange-main {
    display: inline-block;
    background-color: var(--color-orange);
    color: var(--text-main);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-orange-main:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.4);
}

/* Parallax y Dashboard Glassmorphism */
.hero-visual-col {
    perspective: 1000px;
}

#float-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Elementos abstractos del Dashboard */
.dash-header {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
}

.dash-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.dash-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dash-bar {
    height: 12px;
    border-radius: 6px;
}

.cyan-bar {
    background: rgba(0, 191, 255, 0.8);
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

.orange-bar {
    background: rgba(255, 140, 0, 0.8);
}

.dash-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid rgba(0, 191, 255, 0.8);
    border-top-color: transparent;
    /* El círculo inicia en 45 grados por diseño */
    transform: rotate(45deg);
    animation: spin-circle 3s linear infinite;
}

.dash-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-line-mini {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    width: 100%;
}

/* Animación de Pulso Luminoso para simular "Automatización en proceso" */
@keyframes data-pulse {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 0 rgba(0, 191, 255, 0);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 12px rgba(0, 191, 255, 0.6);
    }

    100% {
        opacity: 0.5;
        box-shadow: 0 0 0 rgba(0, 191, 255, 0);
    }
}

@keyframes spin-slow {
    to {
        transform: rotate(405deg);
    }

    /* Gira desde sus 45deg iniciales */
}

/* Keyframes optimizados */
@keyframes pulse-glow {
    0% {
        opacity: 0.6;
        box-shadow: 0 0 0 transparent;
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(0, 191, 255, 0.8);
    }
}

@keyframes spin-circle {
    0% {
        transform: rotate(45deg);
    }

    100% {
        transform: rotate(405deg);
    }

    /* 45 + 360 para un giro completo limpio */
}

/* Aplicamos las animaciones a los elementos existentes */
.cyan-bar {
    animation: data-pulse 2s infinite ease-in-out;
}

.dash-circle {
    /* Añadimos un giro suave y continuo al círculo */
    animation: spin-slow 4s infinite linear;
}

/* =========================================
   4. SECCIÓN DE SERVICIOS (Light Mode)
========================================= */
.services {
    padding: 6rem 5%;
    position: relative;
    background: var(--color-bg-light);
    /* Retorno a fondo claro */
    color: var(--color-text-dark);
    /* Forzamos texto oscuro */
    z-index: 2;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: var(--color-navy);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 200, 200, 0.3);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
}

.card-navy::before {
    background: var(--color-navy);
}

.card-cyan::before {
    background: var(--color-cyan);
}

.card-orange::before {
    background: var(--color-orange);
}

.glass-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* =========================================
   5. LABORATORIO DE DEMOS (Light Mode - FIX SAFARI)
========================================= */
.laboratorio {
    padding: 6rem 5%;
    background-color: #F5F7FA;
    color: var(--color-text-dark);
}

.wireframe-card {
    border: 2px dashed var(--color-cyan);
    background: transparent;
    border-radius: 16px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    padding: 2rem;
}

.wireframe-content {
    transition: opacity 0.3s ease;
}

/* FIX 1: Cambiamos pointer-events por visibility y añadimos z-index */
.wireframe-card .btn-demo {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    background-color: var(--color-navy);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: bold;
    z-index: 10;
}

.wireframe-card:hover {
    border-style: solid;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.08), rgba(255, 140, 0, 0.08));
}

.wireframe-card:hover .wireframe-content {
    opacity: 0.2;
}

/* Aplicamos visibility: visible al hacer hover */
.wireframe-card:hover .btn-demo {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* FIX 2: UX adaptativa para dispositivos táctiles (iOS / Android) */
@media (hover: none) {
    .wireframe-card .btn-demo {
        opacity: 1;
        visibility: visible;
        position: relative;
        transform: translateY(0);
        margin-top: 1.5rem;
    }

    .wireframe-card .wireframe-content {
        opacity: 1 !important;
        /* Mantiene el texto siempre visible */
    }

    .wireframe-card {
        border-style: solid;
        background: linear-gradient(135deg, rgba(0, 191, 255, 0.03), rgba(255, 140, 0, 0.03));
    }
}

/* =========================================
   6. SECCIÓN DE CONTACTO (Navy Dark)
========================================= */
.contact {
    background-color: var(--color-navy);
    color: white;
    padding: 6rem 5%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info h2 {
    color: white;
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.contact-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-cyan);
    background: rgba(255, 255, 255, 0.15);
}

.form-group select option {
    background-color: var(--color-navy);
    color: white;
}

/* Botones y Spinner del Formulario */
.btn-submit {
    width: 100%;
    font-size: 1.1rem;
    padding: 1.2rem;
    background-color: var(--color-orange);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.4);
}

.btn-success {
    background-color: #28a745 !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   7. MEDIA QUERIES (Responsive)
========================================= */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text-col h1 {
        font-size: 2.8rem;
    }

    .contact {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-text-col h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-text-col h1 {
        font-size: 2.2rem;
    }

    .hero-text-col p {
        font-size: 1rem;
    }
}

/* =========================================
   AJUSTES ESPECÍFICOS PARA MÓVILES (< 480px)
========================================= */
@media (max-width: 480px) {

    /* Mantenemos el Navbar en una sola línea */
    .dark-nav {
        padding: 1rem 5%;
        flex-wrap: nowrap;
    }

    /* Reducimos ligeramente el logo */
    .temp-logo {
        font-size: 1.3rem;
    }

    /* Ajustamos el botón CTA para que no se rompa */
    .btn-orange-header {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap;
        /* Magia: evita que el texto se parta en dos líneas */
        border-radius: 6px;
    }
}

.navbar-logo {
    height: 35px;
    /* Altura ideal para móvil */
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

/* Escalarlo ligeramente en pantallas grandes */
@media (min-width: 768px) {
    .navbar-logo {
        height: 45px;
    }
}

/* =========================================
   8. MODAL SELECCIÓN DE ROL (ECOMMERCE)
========================================= */
.modal-role-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 45, 98, 0.7);
    /* color-navy al 70% */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Oculto por defecto */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.modal-role-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-role-container {
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    width: 90%;
    max-width: 750px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    /* Efecto de entrada desde abajo */
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    text-align: center;
}

.modal-role-overlay.active .modal-role-container {
    transform: translateY(0);
}

.modal-role-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-role-close:hover {
    color: var(--color-navy);
}

.role-grid {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.role-card {
    flex: 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    outline: none;
}

.role-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.role-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--color-navy);
}

.role-card p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Efectos Hover Interactivos */
.role-client:hover {
    transform: translateY(-8px);
    border-color: var(--color-orange);
    box-shadow: 0 10px 25px rgba(255, 140, 0, 0.15);
}

.role-admin:hover {
    transform: translateY(-8px);
    border-color: var(--color-cyan);
    box-shadow: 0 10px 25px rgba(0, 191, 255, 0.15);
}

/* Responsive del Modal */
@media (max-width: 768px) {
    .role-grid {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-role-container {
        padding: 2.5rem 1.5rem;
    }

    .role-card {
        padding: 1.5rem;
    }

    .modal-role-container h2 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
}