/* ============================================================
   ZKA — Sistema de diseño (gris humo con acento naranja industrial)
   ============================================================ */

:root {
    /* Colores */
    --bg: #ffffff;
    --surface: #FAFAF8;
    --surface-dark: #17191B;
    --text: #26282A;
    --text-muted: #5F6367;
    --primary: #26282A;
    --primary-dark: #0F1113;
    --accent: #C2410C;
    --accent-dark: #9A3B0E;
    --accent-soft: #F0DDCF;
    --hud: #F2A65A;
    --border: #D6D4CD;
    --on-dark: #DDDCD6;

    /* Tipografía */
    --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Forma */
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(20, 22, 24, 0.08);
    --shadow-lg: 0 12px 32px rgba(20, 22, 24, 0.12);

    /* Layout */
    --container: 1140px;
    --section-pad: 4.5rem;
}

/* Accesibilidad: contenido solo para lectores de pantalla */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; margin: 0 0 0.6em; }
h1 { font-size: 2.4rem; letter-spacing: -0.02em; }
h2 { font-size: 1.8rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }

a { color: var(--accent-dark); }
p { margin: 0 0 1rem; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section { padding: var(--section-pad) 0; }
.section--surface {
    background:
        linear-gradient(rgba(38, 40, 42, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(38, 40, 42, 0.045) 1px, transparent 1px),
        #F1F1EE;
    background-size: 44px 44px, 44px 44px, auto;
}

.section-title { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-title .kicker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.section-title .kicker::before,
.section-title .kicker::after {
    content: "";
    display: inline-block;
    width: 1.75rem;
    height: 1px;
    background: var(--accent);
    vertical-align: middle;
    margin: 0 0.7rem;
    opacity: 0.6;
}
.section-title p { color: var(--text-muted); margin: 0; }

/* ---------- Navbar ---------- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.navbar-inner {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.5rem 1.8rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}
.brand svg { display: block; }
.brand-tagline {
    display: none;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #C2410C;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 11rem;
}
@media (min-width: 960px) {
    .brand-tagline { display: inline-block; }
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}
.nav-links a {
    position: relative;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.35rem 0;
    transition: color 0.15s;
}
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-links a.nav-soon {
    opacity: 0.55;
    cursor: default;
}
.nav-links a.nav-soon:hover { color: var(--text); }
.nav-links a.nav-soon::after { display: none; }

.nav-right { display: flex; align-items: center; gap: 1.75rem; }

.nav-user {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-menu {
    position: relative;
}
.nav-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    transition: background 0.15s, border-color 0.15s;
}
.nav-user-toggle:hover,
.nav-user-toggle:focus {
    background: var(--bg);
    border-color: var(--accent);
    outline: none;
}
.nav-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-user-icon { display: none; }
.nav-user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    padding: 0.4rem 0 0 0;
    z-index: 200;
}
.nav-user-menu:hover .nav-user-dropdown,
.nav-user-menu:focus-within .nav-user-dropdown,
.nav-user-toggle:focus + .nav-user-dropdown { display: block; }
.nav-user-dropdown a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
}
.nav-user-dropdown a:hover { background: var(--surface); color: var(--accent-dark); }
.nav-user-dropdown .nav-logout-form {
    margin: 0;
    padding: 0;
}
.nav-user-dropdown .nav-logout-button {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    color: var(--text);
    background: transparent;
    border: none;
    text-align: left;
    font-size: 0.92rem;
    cursor: pointer;
}
.nav-user-dropdown .nav-logout-button:hover {
    background: var(--surface);
    color: var(--accent-dark);
}

/* Logout visible en el navbar (fuera del dropdown, para cualquier usuario) */
.nav-right > .nav-logout-form { margin: 0; padding: 0; }
.nav-right > .nav-logout-form .nav-logout-button {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nav-right > .nav-logout-form .nav-logout-button:hover {
    background: var(--bg);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    padding: 0.25rem 0;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0.4rem 0;
    z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown-toggle:focus + .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
}
.nav-dropdown-menu a:hover { background: var(--surface); color: var(--accent-dark); }

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.lang-flag {
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}
.lang-flag:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.lang-flag.active {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

/* Menú móvil (checkbox hack, sin JS) */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle-label svg { display: block; }

@media (max-width: 860px) {
    .nav-toggle-label { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 1.25rem 1rem;
    }
    .nav-links li { border-top: 1px solid var(--border); }
    .nav-links a { display: block; padding: 0.75rem 0; }
    .nav-toggle:checked ~ .nav-links { display: flex; }
    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--border);
        margin: 0 0 0 0.5rem;
        padding: 0;
    }
    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown:focus-within .nav-dropdown-menu,
    .nav-dropdown-toggle:focus + .nav-dropdown-menu { display: block; }
    .nav-dropdown-toggle { display: flex; padding: 0.75rem 0; }
    .nav-dropdown-menu a { padding: 0.6rem 1rem; }
    .nav-user { display: none; }
    .navbar-inner { gap: 0.75rem; padding: 1rem 1.25rem; }
    .brand svg { width: 104px; height: auto; }
    .nav-right { gap: 0.6rem; margin-left: auto; }
    .nav-right .btn { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
    .nav-user-name { display: none; }
    .nav-user-icon { display: block; }
    .nav-user-toggle { padding: 0.4rem; }
    .nav-user-dropdown {
        right: 0;
        left: auto;
        min-width: 160px;
    }
    .nav-right > .nav-logout-form .nav-logout-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
    }
    /* Logout compacto a icono en movil (el texto sigue siendo el nombre accesible) */
    .nav-right > .nav-logout-form .nav-logout-button {
        font-size: 0;
        gap: 0;
        padding: 0.5rem;
    }
    .nav-right > .nav-logout-form .nav-logout-button::before {
        content: "";
        display: block;
        width: 16px;
        height: 16px;
        background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center / contain no-repeat;
    }
}

@media (max-width: 400px) {
    .navbar-inner { gap: 0.5rem; padding: 0.75rem; }
    .brand svg { width: 84px; }
    .lang-switcher { gap: 0.25rem; }
    .lang-flag { padding: 0.2rem 0.3rem; font-size: 1rem; }
    .nav-right { gap: 0.4rem; }
    .nav-right .btn { padding: 0.45rem 0.7rem; font-size: 0.8rem; }
}

/* Pantallas muy estrechas: la fila del navbar envuelve y nav-right
   pasa a una segunda linea completa, sin ocultar ningun elemento */
@media (max-width: 360px) {
    .navbar-inner { flex-wrap: wrap; row-gap: 0.4rem; padding: 0.6rem 0.75rem; }
    .brand { order: 1; }
    .nav-toggle-label { order: 2; margin-left: auto; }
    .nav-right { order: 3; flex: 1 1 100%; justify-content: flex-end; margin-left: 0; }
}

/* ---------- Botones ---------- */

.btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn--outline:hover { background: var(--primary); color: #fff; }
.btn--light { background: #fff; color: var(--primary); }
.btn--light:hover { background: var(--surface); }
.btn--block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ---------- Hero ---------- */

.hero {
    background: linear-gradient(160deg, #FFFFFF 0%, #FBFBF9 55%, #F2F2EF 100%);
    padding: 5rem 0 4.5rem;
    overflow: hidden;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
}
.hero h1 { font-size: 2.8rem; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 1.15rem; color: var(--text-muted); max-width: 32rem; }
.hero-ctas { display: flex; gap: 0.9rem; margin-top: 1.75rem; flex-wrap: wrap; }

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.1rem; }
}

/* Panel visual tipo "visor de detección" (CSS puro, sin imágenes) */
.detector {
    position: relative;
    aspect-ratio: 4 / 3;
    background:
        linear-gradient(rgba(20, 22, 24, 0.55), rgba(20, 22, 24, 0.55)),
        repeating-linear-gradient(0deg, #33373B 0, #33373B 2px, #26282A 2px, #26282A 44px),
        repeating-linear-gradient(90deg, #33373B 0, #33373B 2px, #26282A 2px, #26282A 44px),
        #26282A;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.detector::before { /* silueta de camión estilizada */
    content: "";
    position: absolute;
    left: 14%;
    bottom: 18%;
    width: 46%;
    height: 38%;
    background: linear-gradient(#3A3F45, #2B2F34);
    border-radius: 6px;
}
.detector::after { /* silueta de persona */
    content: "";
    position: absolute;
    right: 18%;
    bottom: 18%;
    width: 9%;
    height: 30%;
    background: linear-gradient(#42474E, #32363C);
    border-radius: 40% 40% 6px 6px;
}
.detector .bbox {
    position: absolute;
    border: 2px solid var(--accent);
    border-radius: 4px;
}
.detector .bbox .tag {
    position: absolute;
    top: -1.5rem;
    left: -2px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 4px 4px 4px 0;
    white-space: nowrap;
}
.detector .bbox--truck { left: 12%; bottom: 14%; width: 51%; height: 47%; }
.detector .bbox--person { right: 15.5%; bottom: 14%; width: 14%; height: 37%; }
.detector .bbox--helmet { right: 17.5%; bottom: 44%; width: 10%; height: 9%; border-color: #f59e0b; }
.detector .bbox--helmet .tag { background: #f59e0b; }
.detector .hud {
    position: absolute;
    top: 0.75rem;
    left: 0.9rem;
    color: var(--hud);
    font-size: 0.75rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    letter-spacing: 0.05em;
}
.detector .hud .rec { color: #f87171; }
.detector .scanline {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 48%, rgba(242, 166, 90, 0.14) 50%, transparent 52%);
    animation: scan 5s linear infinite;
    pointer-events: none;
}
@keyframes scan {
    from { transform: translateY(-100%); }
    to { transform: translateY(100%); }
}
@media (prefers-reduced-motion: reduce) {
    .detector .scanline { animation: none; }
}

/* ---------- Stats ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}
.stat .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.stat .stat-label { color: var(--text-muted); font-size: 0.92rem; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cards y grids ---------- */

.grid { display: grid; gap: 1.5rem; }
.grid--3 { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
.grid--3 > * { flex: 0 0 calc(33.333% - 1rem); min-width: 0; }
.grid--2 { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
.grid--2 > * { flex: 0 0 calc(50% - 0.75rem); min-width: 0; }
.grid--3:has(> :only-child),
.grid--2:has(> :only-child) { display: flex; justify-content: center; }
.grid--3:has(> :only-child) > *,
.grid--2:has(> :only-child) > * { flex: 0 0 100%; width: 100%; max-width: 26rem; }
@media (max-width: 900px) { .grid--3 > * { flex: 0 0 calc(50% - 0.75rem); } }
@media (max-width: 600px) { .grid--3 > *, .grid--2 > * { flex: 0 0 100%; } }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    box-shadow: var(--shadow);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #C7C4BC;
}
.card h3 { margin-bottom: 0.4rem; }
.card h3 a, .card h2 a { color: var(--text); text-decoration: none; }
.card h3 a:hover, .card h2 a:hover { color: var(--accent); }
.card p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.card img { border-radius: var(--radius-sm); margin-bottom: 1rem; }

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 1rem;
}
.card-icon svg { width: 24px; height: 24px; }

.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.25rem 0.7rem;
    border-radius: 3px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    margin-bottom: 0.75rem;
}

.meta { color: var(--text-muted); font-size: 0.88rem; }

/* ---------- Proceso (steps) ---------- */

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; counter-reset: step; }
.step { position: relative; padding-top: 2.75rem; }
.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.9;
}
.step h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.step p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- CTA final ---------- */

.cta-band {
    background: var(--surface-dark);
    color: var(--on-dark);
    border-radius: var(--radius);
    padding: 3.5rem 2.5rem;
    text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { max-width: 34rem; margin: 0 auto 1.75rem; color: var(--on-dark); }

/* ---------- Páginas de detalle ---------- */

.page-header {
    background: linear-gradient(160deg, #FFFFFF, #F6F6F3);
    padding: 3.5rem 0 2.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 3rem;
}
.page-header h1 { margin-bottom: 0.4rem; }
.page-header .lead { color: var(--text-muted); max-width: 44rem; margin: 0; }

.article-body { max-width: 64rem; }
.article-body img { border-radius: var(--radius); margin-bottom: 1.5rem; }

/* Contenido enriquecido de casos de éxito / artículos */
.article-content {
    line-height: 1.75;
}
.article-content h2 {
    position: relative;
    margin: 3rem 0 1.25rem;
    padding-bottom: 0.6rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    border-bottom: 2px solid var(--accent);
}
.article-content h3 {
    margin: 2.2rem 0 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}
.article-content h2:first-child { margin-top: 0; }
.article-content h2 + p { color: var(--text); font-size: 1.05rem; }
.article-content h3 + p { color: var(--text); }
.article-content p {
    color: var(--text-muted);
    margin-bottom: 1.1rem;
}
.article-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.6rem;
}
.article-content ul li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.85rem;
    color: var(--text-muted);
}
.article-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 2px;
    background: var(--accent);
}
.article-content .table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.6rem;
    font-size: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.article-content .table th {
    background: var(--accent-soft, rgba(230, 110, 40, 0.12));
    color: var(--text);
    text-align: left;
    font-weight: 700;
    padding: 0.65rem 0.9rem;
    border-bottom: 2px solid var(--accent);
}
.article-content .table td {
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.article-content .table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.025); }
.article-content .table tbody tr:last-child td { border-bottom: none; }

.poc-note { color: var(--text-muted); font-size: 0.92rem; max-width: 44rem; }


/* ---------- Formularios ---------- */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    max-width: 620px;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.3rem; }
.form-control {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    color: var(--text);
    background: #FCFCFA;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.16);
}
.has-error .form-control { border-color: #dc2626; }
.error { color: #dc2626; margin: 0.3rem 0 0; font-size: 0.85rem; }

/* ---------- Mensajes ---------- */

.messages { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.messages li {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    background: #ecfdf3;
    border: 1px solid #a7e6c3;
    color: #166534;
    font-weight: 500;
}

/* ---------- Paginación ---------- */

.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 2.5rem;
    font-size: 0.95rem;
}

/* ---------- Footer ---------- */

footer {
    background: var(--surface-dark);
    color: var(--on-dark);
    margin-top: var(--section-pad);
}
.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
    max-width: var(--container);
    margin: 0 auto;
    padding: 3.5rem 1.25rem 2.5rem;
}
footer h4 { color: #fff; font-size: 0.95rem; letter-spacing: 0.05em; text-transform: uppercase; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 0.5rem; }
footer a { color: var(--on-dark); text-decoration: none; }
footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { color: #fff; }
.footer-brand svg { display: block; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 1.25rem;
    font-size: 0.85rem;
    color: #9B9E98;
}
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Animación de aparición al hacer scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        animation: fade-up 0.7s ease both;
    }
    @supports (animation-timeline: view()) {
        .fade-in {
            animation-timeline: view();
            animation-range: entry 0% entry 40%;
        }
    }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* ============================================================
   Carrusel hero — visor de visión computacional
   ============================================================ */

.carousel {
    position: relative;
    height: max(72vh, 520px);
    max-height: 780px;
    overflow: hidden;
    background: var(--surface-dark);
}

.carousel-track { height: 100%; }

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s ease, visibility 0.9s;
}
.slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.slide-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
/* Slides con imagen completa (collages con etiquetas): sin recorte,
   alineados a la derecha para que el texto caiga sobre el panel oscuro */
.slide--contain .slide-bg {
    object-fit: contain;
    object-position: right center;
    background: #0A0E14;
}
.slide--contain .slide-overlay { background: none; }
/* Movil: el texto puede caer sobre zonas claras de la imagen (contain sin
   overlay + ken-burns moviendo el fondo), asi que se asegura contraste */
@media (max-width: 860px) {
    .slide-content > *:not(.slide-cta) {
        text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.6);
    }
    .slide--contain .slide-overlay {
        background: linear-gradient(180deg, rgba(14, 16, 18, 0.85) 0%, rgba(14, 16, 18, 0.55) 45%, rgba(14, 16, 18, 0.85) 100%);
    }
}
@media (prefers-reduced-motion: no-preference) {
    .slide.is-active .slide-bg { animation: ken-burns 8s ease-out both; }
    .slide--contain.is-active .slide-bg { animation: none; }
}
@keyframes ken-burns {
    from { transform: scale(1.06); }
    to { transform: scale(1); }
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(78deg, rgba(14, 16, 18, 0.92) 0%, rgba(28, 31, 35, 0.72) 42%, rgba(28, 31, 35, 0.25) 75%, rgba(14, 16, 18, 0.45) 100%);
}

/* Marco de visor: esquinas de registro */
.slide-frame {
    position: absolute;
    inset: 1.1rem;
    pointer-events: none;
    z-index: 3;
}
.slide-frame::before,
.slide-frame::after,
.slide-frame .corner::before,
.slide-frame .corner::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(242, 166, 90, 0.75);
}
.slide-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.slide-frame::after { top: 0; right: 0; border-left: none; border-bottom: none; }
.slide-frame .corner::before { bottom: 0; left: 0; border-right: none; border-top: none; }
.slide-frame .corner::after { bottom: 0; right: 0; border-left: none; border-top: none; }

/* HUD fijo */
.slide-hud {
    position: absolute;
    top: 1.9rem;
    left: 2.4rem;
    z-index: 4;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--hud);
    text-transform: uppercase;
}
.slide-hud .rec { color: #f87171; }
.slide-hud-counter {
    position: absolute;
    top: 1.9rem;
    right: 2.4rem;
    left: auto;
}

/* Contenido del slide */
.slide-content {
    position: relative;
    z-index: 5;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 620px;
    padding: 0 2rem;
    margin-left: 6vw;
    color: #fff;
}
.slide-kicker {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--hud);
    margin-bottom: 1.1rem;
}
.slide-kicker::before {
    content: "";
    display: inline-block;
    width: 2.2rem;
    height: 1px;
    background: var(--hud);
    vertical-align: middle;
    margin-right: 0.8rem;
}
.slide-title {
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: #fff;
    margin-bottom: 1rem;
}
.slide-subtitle {
    font-size: 1.1rem;
    color: #D8D5CC;
    max-width: 30rem;
    margin-bottom: 1.9rem;
}

/* Reveal escalonado al activarse el slide */
@media (prefers-reduced-motion: no-preference) {
    .slide .slide-kicker,
    .slide .slide-title,
    .slide .slide-subtitle,
    .slide .slide-cta {
        opacity: 0;
        transform: translateY(22px);
    }
    .slide.is-active .slide-kicker,
    .slide.is-active .slide-title,
    .slide.is-active .slide-subtitle,
    .slide.is-active .slide-cta {
        animation: slide-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .slide.is-active .slide-title { animation-delay: 0.12s; }
    .slide.is-active .slide-subtitle { animation-delay: 0.26s; }
    .slide.is-active .slide-cta { animation-delay: 0.4s; }
}
@keyframes slide-rise {
    to { opacity: 1; transform: none; }
}

/* Controles */
.carousel-nav {
    position: absolute;
    z-index: 6;
    bottom: 2.2rem;
    left: 6vw;
    right: 6vw;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 0 2rem;
}
.carousel-dots { display: flex; gap: 1.1rem; }
.carousel-dot {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.3rem 0;
    position: relative;
    transition: color 0.2s;
}
.carousel-dot::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--hud);
    transform: scaleX(0);
    transform-origin: left;
}
.carousel-dot.is-active { color: #fff; }
.carousel-dot.is-active::after { transform: scaleX(1); transition: transform 0.3s; }
@media (prefers-reduced-motion: no-preference) {
    .carousel--autoplay .carousel-dot.is-active::after {
        animation: dot-progress var(--autoplay-ms, 6000ms) linear both;
    }
    .carousel:hover .carousel-dot.is-active::after,
    .carousel:focus-within .carousel-dot.is-active::after {
        animation-play-state: paused;
    }
}
@keyframes dot-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.carousel-arrows { margin-left: auto; display: flex; gap: 0.6rem; }
.carousel-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(14, 16, 18, 0.35);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}
.carousel-arrow:hover { background: rgba(242, 166, 90, 0.25); border-color: var(--hud); }

@media (max-width: 700px) {
    .slide-content { margin-left: 0; padding: 0 1.6rem; }
    .carousel-nav { left: 0; right: 0; padding: 0 1.6rem; }
    .slide-hud { display: none; }
    .slide-frame { inset: 0.6rem; }
}

/* ---------- Marquesina de logos (tecnologías) ---------- */

.logo-strip {
    padding: 2.75rem 0 3rem;
    border-bottom: 1px solid var(--border);
}
.logo-marquee {
    display: flex;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.logo-track {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4.5rem;
    padding-right: 4.5rem;
    min-width: max-content;
}
@media (prefers-reduced-motion: no-preference) {
    .logo-track { animation: logo-marquee 36s linear infinite; }
    .logo-marquee:hover .logo-track { animation-play-state: paused; }
}
@keyframes logo-marquee {
    to { transform: translateX(-100%); }
}
.logo-track img {
    height: 30px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    filter: grayscale(1) opacity(0.55);
    transition: filter 0.25s ease;
}
.logo-track img:hover { filter: none; }
@media (prefers-reduced-motion: reduce) {
    .logo-marquee { overflow-x: auto; }
}

/* ---------- Lista de certificaciones (Nosotros) ---------- */

.check-list {
    list-style: none;
    margin: 1.2rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem 2rem;
}
.check-list li {
    position: relative;
    padding-left: 1.6rem;
    font-size: 0.95rem;
    color: var(--text);
}
.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 0.55rem;
    height: 0.9rem;
    border-right: 2.5px solid var(--accent);
    border-bottom: 2.5px solid var(--accent);
    transform: rotate(45deg) translateY(-2px);
}
@media (max-width: 700px) {
    .check-list { grid-template-columns: 1fr; }
}

/* ---------- Galería de servicio (capturas de proyectos) ---------- */

.service-gallery {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.service-gallery h2 {
    margin-bottom: 1.4rem;
}
.service-gallery-grid {
    columns: 1;
    column-gap: 1.25rem;
}
@media (min-width: 720px) {
    .service-gallery-grid { columns: 2; }
}
.service-gallery-grid figure {
    margin: 0 0 1.25rem;
    break-inside: avoid;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}
.service-gallery-grid img {
    display: block;
    width: 100%;
    height: auto;
}
.service-gallery-grid figcaption {
    padding: 0.65rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ---------- Lightbox (galería a tamaño completo) ---------- */

.gallery-zoom {
    display: block;
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(15, 17, 19, 0.94);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.lightbox.is-open {
    opacity: 1;
}
.lightbox[hidden] {
    display: none;
}

.lightbox-stage {
    margin: 0;
    max-width: min(92vw, 1400px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid rgba(242, 165, 90, 0.35);
    border-radius: var(--radius-sm);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    background: var(--surface-dark);
}
.lightbox-caption {
    margin-top: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--on-dark);
    text-align: center;
}
.lightbox-caption:empty {
    display: none;
}

.lightbox-close,
.lightbox-arrow {
    border: 1px solid rgba(242, 165, 90, 0.45);
    background: rgba(23, 25, 27, 0.7);
    color: var(--hud);
    font-family: var(--font-mono);
    cursor: pointer;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
.lightbox-close:hover,
.lightbox-arrow:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.06);
}
.lightbox-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    font-size: 1.6rem;
}
.lightbox-arrow--prev { margin-left: 1rem; }
.lightbox-arrow--next { margin-right: 1rem; }

@media (max-width: 700px) {
    .lightbox {
        flex-direction: column;
        gap: 0.75rem;
    }
    .lightbox-arrow {
        position: absolute;
        bottom: 1rem;
        margin: 0;
    }
    .lightbox-arrow--prev { left: 1rem; }
    .lightbox-arrow--next { right: 1rem; }
}

/* Casos de éxito: secciones y portadas uniformes */
.case-section { margin-bottom: 3rem; }
.case-section__title {
    font-size: 1.4rem;
    margin-bottom: 1.4rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}
.case-section__empty { color: var(--text-muted); }
.card__cover {
    width: 100%;
    aspect-ratio: 21 / 10;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Dashboard del cliente
   ========================================================================== */

/* Las tarjetas del dashboard no son tarjetas promocionales: nada de lift */
.dashboard .card:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--border);
}
.dashboard .card > h2 {
    margin: 0 0 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1.15rem;
}

/* Grilla de definición (perfil, datos de empresa): etiqueta | valor */
.profile-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.15rem 1.4rem;
    margin: 0.8rem 0 1.2rem;
    font-size: 0.95rem;
}
.profile-grid dt {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.profile-grid dd {
    margin: 0;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    word-break: break-word;
}
.profile-grid dt:last-of-type,
.profile-grid dd:last-of-type { border-bottom: none; }

/* Tablas del dashboard (recursos, usuarios): encabezado titulado y columnas */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0 1.2rem;
    font-size: 0.95rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.dash-table th {
    background: var(--accent-soft, rgba(230, 110, 40, 0.12));
    color: var(--text);
    text-align: left;
    font-weight: 700;
    padding: 0.65rem 0.9rem;
    border-bottom: 2px solid var(--accent);
    white-space: nowrap;
}
.dash-table td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.dash-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.025); }
.dash-table tbody tr:last-child td,
.dash-table tbody tr:last-child th { border-bottom: none; }
.dash-table .table-actions { white-space: nowrap; }
.dash-table .table-actions a { margin-right: 0.8rem; }

/* Botones dentro de celdas del dashboard: compactos para no desalinear la fila */
.dash-table .btn {
    padding: 0.25rem 0.8rem;
    font-size: 0.85rem;
}

/* Tabla de perfil (etiqueta | valor): la columna de etiquetas es th en tbody,
   sin el fondo de encabezado de las tablas de datos */
.dash-table tbody th {
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    border-top: none;
    border-left: none;
    border-right: none;
    white-space: nowrap;
    vertical-align: middle;
    width: 1%;
}

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

/* Honeypot anti-spam: campo cebo fuera de pantalla (los bots lo rellenan). */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
    opacity: 0;
}

/* Centro de ayuda */
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.help-card {
    display: block;
    border: 1px solid #e3e4e6;
    border-radius: 8px;
    padding: 1.25rem;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.help-card:hover {
    border-color: #C2410C;
    box-shadow: 0 4px 14px rgba(38, 40, 42, .08);
}

.help-card h2 {
    margin: 0 0 .5rem;
    font-size: 1.05rem;
}

.help-card p {
    margin: 0;
    color: #5b5e62;
    font-size: .95rem;
}

.help-steps li {
    margin-bottom: .5rem;
}

.help-figure {
    margin: 1.5rem 0;
}

.help-figure img {
    max-width: 100%;
    border: 1px solid #e3e4e6;
    border-radius: 8px;
}

.help-figure figcaption {
    margin-top: .5rem;
    font-size: .9rem;
    color: #5b5e62;
}

.help-note {
    background: #fdf3ec;
    border-left: 4px solid #C2410C;
    border-radius: 4px;
    padding: .9rem 1.1rem;
    margin-top: 1.5rem;
}

.help-note p {
    margin: 0;
}

button.link-like {
    background: none;
    border: none;
    padding: 0;
    color: #C2410C;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}
