/* 
==========================================================================
    La Firma Digital - Global Styles & Design System Variables
========================================================================== 
*/

/* --- Google Fonts: Inter --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* --- Paleta Cromática Oficial --- */

    /* Colores Primarios */
    --primary-deep: #0B1F3B;
    /* Azul Corporativo Profundo */
    --primary-tech: #123A6F;
    /* Azul Tecnológico */

    /* Colores Secundarios */
    --accent-silver: #C7CCD6;
    /* Gris Plata */
    --text-dark: #2B2F36;
    /* Gris Oscuro Técnico */
    --bg-light: #F8F9FA;
    /* Off-white for section backgrounds */
    --bg-white: #FFFFFF;

    /* Colores de Acento */
    --accent-green: #1FA37A;
    /* Verde Estratégico */
    --accent-electric: #2D6CDF;
    /* Azul Eléctrico Sutil */

    /* --- Tipografía --- */
    --font-primary: 'Inter', sans-serif;

    /* Jerarquía Tipográfica Scales */
    --fs-h1: clamp(3rem, 5vw, 3.5rem);
    /* 48-56px */
    --fs-h2: clamp(2.25rem, 4vw, 2.5rem);
    /* 36-40px */
    --fs-h3: clamp(1.75rem, 3vw, 2rem);
    /* 28-32px */
    --fs-body-large: clamp(1.125rem, 2vw, 1.25rem);
    /* 18-20px */
    --fs-body: 1rem;
    /* 16px */
    --fs-small: 0.875rem;
    /* 14px */

    /* Line Heights */
    --lh-tight: 1.2;
    --lh-base: 1.5;
    --lh-loose: 1.6;

    /* --- Grid & Espaciado --- */
    --max-width: 1280px;
    --padding-mobile: 24px;
    --padding-desktop: 80px;
    --section-gap: clamp(3rem, 5vw, 5rem);
    /* 48-80px */

    /* --- Easing e Interacciones --- */
    --transition-fast: 0.2s ease-in-out;
    --transition-normal: 0.3s ease;

    /* --- Elevación / Sombras --- */
    --shadow-sm: 0 2px 8px rgba(11, 31, 59, 0.05);
    --shadow-md: 0 4px 16px rgba(11, 31, 59, 0.08);
    /* Minimal elevation for cards */
    --shadow-lg: 0 8px 24px rgba(11, 31, 59, 0.12);
}

/* ==========================================================================
    CSS Reset
========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--fs-body);
    line-height: var(--lh-loose);
    color: var(--text-dark);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul,
ol {
    list-style: none;
}

button,
input,
textarea,
select {
    font: inherit;
    background: none;
    border: none;
    color: inherit;
}

/* ==========================================================================
    Typography Styles
========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-deep);
    line-height: var(--lh-tight);
    font-weight: 700;
}

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

h2 {
    font-size: var(--fs-h2);
    font-weight: 600;
}

h3 {
    font-size: var(--fs-h3);
    font-weight: 500;
}

.body-large {
    font-size: var(--fs-body-large);
}

.text-small {
    font-size: var(--fs-small);
}

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
    Layout Utilities
========================================================================== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding-mobile);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--padding-desktop);
    }
}

.section {
    padding: var(--section-gap) 0;
}

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

.bg-dark {
    background: linear-gradient(135deg, var(--primary-deep) 0%, #061224 100%);
    color: var(--bg-white);
}

.bg-dark h1,
.bg-dark h2,
.bg-dark h3 {
    color: var(--bg-white);
}

/* Base Grid System */
.grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

/* ==========================================================================
    UI Components
========================================================================== */

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-tech) 0%, var(--accent-electric) 100%);
    background-size: 200% auto;
    color: var(--bg-white);
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 4px 15px rgba(45, 108, 223, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-tech) 0%, var(--accent-electric) 100%);
    color: var(--bg-white);
    border: 1px solid transparent;
    box-shadow: 0 12px 30px rgba(45, 108, 223, 0.25), 0 0 20px rgba(45, 108, 223, 0.15);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: transparent;
    color: var(--primary-tech);
    border-color: var(--primary-tech);
    box-shadow: none;
    transform: translateY(-2px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-green) 0%, #158562 100%);
    background-size: 200% auto;
    color: var(--bg-white);
    border: none;
}

.btn-accent:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 4px 15px rgba(31, 163, 122, 0.4);
}

/* --- Cards --- */
.card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(18, 58, 111, 0.08) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 24px rgba(11, 31, 59, 0.04);
    border: 1px solid rgba(18, 58, 111, 0.08);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-tech) 0%, var(--accent-electric) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(11, 31, 59, 0.1);
    border-color: rgba(18, 58, 111, 0.2);
    background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(18, 58, 111, 0.12) 100%);
}

.card-icon {
    width: 64px;
    height: 64px;
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    color: var(--primary-tech);
    background: linear-gradient(135deg, rgba(18, 58, 111, 0.03) 0%, rgba(18, 58, 111, 0.08) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5);
    transition: transform var(--transition-normal);
}

.card:hover .card-icon {
    transform: scale(1.05);
}

.card-title {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--primary-deep);
}

.card-body {
    flex-grow: 1;
    color: var(--text-dark);
}

/* --- Badges/Tags --- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: var(--fs-small);
    font-weight: 500;
    background-color: rgba(18, 58, 111, 0.1);
    color: var(--primary-tech);
    margin-bottom: 1rem;
}

/* Utility alignments */
.text-center {
    text-align: center;
}

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

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 2rem;
}

.pt-0 {
    padding-top: 0 !important;
}

.max-w-md {
    max-width: 900px;
    margin: 0 auto;
}

.container-sm {
    max-width: 700px;
}

.text-h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
    Specific Section Styles
========================================================================== */

/* Hero Section */
.hero {
    padding: clamp(4rem, 8vw, 6rem) 0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(45, 108, 223, 0.15), transparent 60%);
    pointer-events: none;
}

/* Hero Background Images with Dark Overlay */
.hero-bg-home {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/home.webp') center/cover no-repeat;
}

.hero-bg-infra {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/infraestructura.webp') center/cover no-repeat;
}

.hero-bg-marketing {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/marketing.webp') center/cover no-repeat;
}

.hero-bg-ciber {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/ciberseguridad.webp') center/cover no-repeat;
}

.hero-bg-redes {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/cctv.webp') center/cover no-repeat;
}

.hero-bg-software {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/software.webp') center/cover no-repeat;
}

.hero-bg-educacion {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/educacion.webp') center/cover no-repeat;
}

.hero-bg-consultoria {
    background: linear-gradient(rgba(11, 31, 59, 0.6), rgba(11, 31, 59, 0.6)), url('../img/consultoria.webp') center/cover no-repeat;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* Propuesta de Valor Custom Section */
.value-prop-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-deep) 0%, #0c182a 100%);
    overflow: hidden;
}

.value-prop-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(45, 108, 223, 0.15) 0%, rgba(199, 204, 214, 0.05) 50%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.value-prop-section .container {
    position: relative;
    z-index: 1;
}

.value-prop-glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 3rem 2rem;
    color: var(--bg-white);
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 1rem;
    position: relative;
}

.tags-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse at center, rgba(45, 108, 223, 0.08) 0%, rgba(31, 163, 122, 0.05) 50%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.tags-container .badge {
    position: relative;
    z-index: 1;
}

.badge-lg {
    font-size: 1.125rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, rgba(18, 58, 111, 0.85) 0%, rgba(11, 31, 59, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(11, 31, 59, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
    transition: all var(--transition-normal);
    margin-bottom: 0;
    cursor: default;
}

.badge-lg:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, var(--primary-tech) 0%, var(--accent-electric) 100%);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 30px rgba(45, 108, 223, 0.25), 0 0 20px rgba(45, 108, 223, 0.15);
    color: var(--bg-white);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.cta-section {
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(31, 163, 122, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

/* ==========================================================================
    Header / Navigation
========================================================================== */
.header {
    background-color: rgba(11, 31, 59, 0.85);
    /* Glass effect from var(--primary-deep) */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* subtle separation */
    color: var(--bg-white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: 0.5px;
    color: var(--bg-white);
}

.nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--primary-deep);
    padding: 1.5rem var(--padding-mobile);
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links.active {
    display: flex;
}

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

.nav-links.active a {
    color: var(--bg-white);
    font-size: 1.125rem;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links.active a:last-child {
    border-bottom: none;
}

@media (min-width: 992px) {
    .nav-links {
        display: flex;
        position: static;
        width: auto;
        background-color: transparent;
        padding: 0;
        flex-direction: row;
        gap: 2rem;
        align-items: center;
        box-shadow: none;
        border-top: none;
    }

    .nav-links.active a,
    .nav-links a {
        font-size: var(--fs-body);
        display: inline;
        border-bottom: none;
        padding: 0;
    }

    .nav-links a:hover,
    .nav-links a:focus {
        color: var(--accent-silver);
    }

    /* Dropdown Styles */
    .dropdown {
        position: relative;
        display: flex;
        align-items: center;
        height: 100%;
        padding: 1rem 0;
        /* Increase hit area for easier hover */
    }

    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 260px;
        background-color: var(--bg-white);
        box-shadow: var(--shadow-lg);
        border-radius: 8px;
        padding: 0.5rem 0;
        display: flex;
        flex-direction: column;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all var(--transition-fast);
        z-index: 1050;
        border: 1px solid var(--accent-silver);
    }

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

    .dropdown-menu a {
        color: var(--text-dark) !important;
        padding: 0.75rem 1.5rem;
        font-size: var(--fs-small);
        border-bottom: 1px solid var(--bg-light);
        display: block;
        font-weight: 500;
        transition: background-color var(--transition-fast), color var(--transition-fast);
    }

    .dropdown-menu a:last-child {
        border-bottom: none;
    }

    .dropdown-menu a:hover,
    .dropdown-menu a:focus {
        background-color: var(--bg-light);
        color: var(--primary-tech) !important;
    }
}

.nav-actions {
    display: none;
}

@media (min-width: 992px) {
    .nav-actions {
        display: block;
    }
}

.menu-toggle {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--bg-white);
}

@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }
}

/* ==========================================================================
    Footer
========================================================================== */
.footer {
    padding: 4rem 0 2rem 0;
    border-top: 4px solid var(--primary-tech);
}

.footer-grid {
    gap: 3rem;
    margin-bottom: 3rem;
}

/* ==========================================================================
    Success Modal Styles
========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 31, 59, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-white);
    padding: 3rem 2rem;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon i {
    font-size: 4rem;
    color: var(--accent-green);
}

/* ==========================================================================
    Button Loading State
========================================================================== */
.btn.loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    margin-left: -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--bg-white);
    border-radius: 50%;
    animation: button-spin 1s ease-in-out infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

.footer-col h4 {
    color: var(--bg-white);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.footer-col a,
.footer-col li {
    color: var(--accent-silver);
    font-size: var(--fs-body);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col a:hover {
    color: var(--bg-white);
}

.footer-logo {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-silver);
}