/* =========================================================
   SecurAccess — Control de Acceso / CCTV landing page
   ========================================================= */

:root {
    --bg: #070b14;
    --bg-alt: #0c1220;
    --surface: #101828;
    --surface-2: #141d30;
    --border: rgba(255, 255, 255, .08);
    --text: #e7ecf7;
    --text-dim: #97a2b8;
    --accent: #22d3ee;
    --accent-2: #6366f1;
    --accent-3: #34d399;
    --gradient: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, #a78bfa);
    --radius: 18px;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

h1, h2, h3, .logo span {
    font-family: 'Space Grotesk', 'Poppins', sans-serif;
    margin: 0;
    line-height: 1.15;
}

p { color: var(--text-dim); line-height: 1.7; }

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

ul { list-style: none; margin: 0; padding: 0; }

img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

::selection { background: var(--accent); color: #04121a; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; border: 2px solid var(--bg); }

/* ===== Preloader ===== */
#preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring {
    width: 72px; height: 72px; border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    animation: spin 1s linear infinite;
    color: var(--accent);
    font-size: 22px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Cursor glow (desktop only) ===== */
.cursor-glow {
    position: fixed; top: 0; left: 0; width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(34,211,238,.10), transparent 70%);
    border-radius: 50%; pointer-events: none; z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity .3s ease;
    opacity: 0;
}
@media (hover: hover) and (pointer: fine) { .cursor-glow.active { opacity: 1; } }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 26px;
    border-radius: 100px;
    font-weight: 600;
    font-size: .95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease);
    white-space: nowrap;
}
.btn-primary {
    background: var(--gradient);
    color: #04121a;
    box-shadow: 0 12px 30px -10px rgba(34, 211, 238, .45);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -12px rgba(34, 211, 238, .6); }
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.btn-block { width: 100%; position: relative; }

/* ===== Reveal on scroll ===== */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: var(--d, 0s);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* ===== Navbar ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 500;
    padding: 20px 0;
    transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s var(--ease);
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    padding: 12px 0;
    background: rgba(7, 11, 20, .75);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; letter-spacing: .3px; }
.logo i { color: var(--accent); font-size: 1.3rem; }
.logo em { font-style: normal; color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
    padding: 9px 16px;
    border-radius: 100px;
    font-size: .92rem;
    font-weight: 500;
    color: var(--text-dim);
    position: relative;
    transition: color .3s ease, background .3s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.06); }
.nav-cta {
    background: var(--gradient) !important;
    color: #04121a !important;
    font-weight: 600;
    margin-left: 6px;
}

.burger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px;
    z-index: 20;
}
.burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center;
    padding: 140px 0 100px;
    overflow: hidden;
    background: radial-gradient(120% 90% at 50% -10%, #10192c 0%, var(--bg) 60%);
}
.hero-grid {
    position: absolute; inset: -2px;
    background-image:
        linear-gradient(rgba(34,211,238,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34,211,238,.08) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent 75%);
    animation: gridMove 18s linear infinite;
}
@keyframes gridMove { from { background-position: 0 0, 0 0; } to { background-position: 46px 46px, 46px 46px; } }

.hero-glow {
    position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none;
    animation: float 10s ease-in-out infinite;
}
.hero-glow-1 { width: 420px; height: 420px; background: rgba(99,102,241,.35); top: -120px; left: -120px; }
.hero-glow-2 { width: 380px; height: 380px; background: rgba(34,211,238,.28); bottom: -140px; right: -100px; animation-delay: -4s; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -20px); } }

.floating-icons { position: absolute; inset: 0; pointer-events: none; }
.fi { position: absolute; color: rgba(34,211,238,.18); font-size: 2.2rem; animation: drift 9s ease-in-out infinite; }
.fi-1 { top: 22%; left: 8%; animation-delay: 0s; }
.fi-2 { top: 68%; left: 14%; font-size: 2.6rem; animation-delay: -2s; color: rgba(99,102,241,.2); }
.fi-3 { top: 30%; right: 10%; animation-delay: -4s; }
.fi-4 { top: 74%; right: 16%; font-size: 2rem; animation-delay: -6s; color: rgba(52,211,153,.2); }
.fi-5 { top: 12%; left: 46%; font-size: 1.6rem; animation-delay: -3s; }
@keyframes drift { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-24px) rotate(8deg); } }

.hero-inner { position: relative; z-index: 2; max-width: 760px; }

.badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 100px;
    background: rgba(34,211,238,.08);
    border: 1px solid rgba(34,211,238,.25);
    color: var(--accent);
    font-size: .82rem; font-weight: 600;
    margin-bottom: 22px;
}

.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 700; margin-bottom: 22px; }
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero-sub { font-size: 1.08rem; max-width: 600px; margin-bottom: 34px; }
.hero-sub strong { color: var(--text); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }

.scroll-indicator {
    position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 42px; border-radius: 20px; border: 2px solid var(--border);
    display: flex; justify-content: center; padding-top: 8px; z-index: 2;
}
.scroll-indicator span { width: 4px; height: 8px; border-radius: 4px; background: var(--accent); animation: scrollDot 1.6s ease-in-out infinite; }
@keyframes scrollDot { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

/* ===== Stats ===== */
.stats { padding: 60px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-card { padding: 10px; }
.stat-number, .stat-suffix {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--text);
}
.stat-suffix { color: var(--accent); }
.stat-card p { margin-top: 6px; font-size: .92rem; }

/* ===== Section heads ===== */
.eyebrow {
    display: inline-block; color: var(--accent); font-weight: 600; letter-spacing: 1.5px;
    text-transform: uppercase; font-size: .8rem; margin-bottom: 14px;
}
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: 16px; }
.section-head.light .eyebrow { color: #04121a; background: var(--accent); padding: 4px 12px; border-radius: 100px; }

/* ===== Quienes somos ===== */
.nosotros { padding: 120px 0; }
.nosotros-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: center; }
.nosotros-visual { display: flex; justify-content: center; }
.visual-card {
    position: relative; width: 300px; height: 300px; border-radius: 32px;
    background: linear-gradient(160deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
}
.visual-card i { font-size: 5.5rem; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.visual-ring {
    position: absolute; inset: -24px; border: 1px dashed rgba(34,211,238,.35); border-radius: 50%;
    animation: spin 22s linear infinite;
}
.eyebrow + h2 { margin-bottom: 20px; }
.check-list { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: .95rem; }
.check-list i { color: var(--accent-3); margin-top: 3px; }

/* ===== Servicios ===== */
.servicios { padding: 100px 0; background: var(--bg-alt); }
.servicios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.servicio-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px 28px;
    transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.servicio-card:hover { transform: translateY(-8px); border-color: rgba(34,211,238,.4); box-shadow: var(--shadow); }
.servicio-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px; font-size: 1.4rem; color: #04121a;
}
.servicio-card h3 { font-size: 1.15rem; margin-bottom: 12px; }
.servicio-card p { font-size: .92rem; }

/* ===== Marcas ===== */
.marcas { padding: 100px 0; }
.marcas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 56px; }
.marca-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    display: flex; flex-direction: column; gap: 8px;
    transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.marca-card:hover { transform: translateY(-6px) scale(1.02); border-color: var(--accent); }
.marca-nombre { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700; }
.marca-desc { font-size: .82rem; color: var(--text-dim); }

.marquee { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 18px 0; }
.marquee-track { display: flex; gap: 60px; width: max-content; animation: scrollLeft 18s linear infinite; }
.marquee-track span { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-dim); white-space: nowrap; font-size: .95rem; }
.marquee-track span i { color: var(--accent); }
@keyframes scrollLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== Proceso ===== */
.proceso { padding: 100px 0; background: var(--bg-alt); }
.proceso-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.paso-card { position: relative; padding: 28px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.paso-num {
    font-family: 'Space Grotesk', sans-serif; font-size: 2.2rem; font-weight: 700;
    background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
    display: block; margin-bottom: 14px;
}
.paso-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.paso-card p { font-size: .88rem; }

/* ===== Testimonios ===== */
.testimonios { padding: 100px 0; }
.slider { max-width: 720px; margin: 0 auto; text-align: center; }
.slider-track { position: relative; min-height: 220px; }
.slide {
    position: absolute; inset: 0;
    opacity: 0; transform: translateX(24px);
    transition: opacity .5s var(--ease), transform .5s var(--ease);
    pointer-events: none;
}
.slide.active { opacity: 1; transform: translateX(0); pointer-events: auto; position: relative; }
.quote-icon { font-size: 1.6rem; color: var(--accent); margin-bottom: 16px; }
.slide p { font-size: 1.15rem; color: var(--text); margin-bottom: 22px; }
.author-name { display: block; font-weight: 700; }
.author-role { font-size: .85rem; color: var(--text-dim); }
.slider-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 28px; }
.slider-controls button {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; transition: background .3s ease, border-color .3s ease, transform .3s ease;
}
.slider-controls button:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.08); }
.slider-dots { display: flex; gap: 8px; }
.slider-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background .3s ease, transform .3s ease; }
.slider-dots span.active { background: var(--accent); transform: scale(1.3); }

/* ===== Contacto ===== */
.contacto { padding: 110px 0; background: var(--bg-alt); }
.contacto-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: flex-start; }
.contacto-info h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 14px 0 16px; }
.info-list { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.info-list li { display: flex; gap: 12px; align-items: center; color: var(--text); }
.info-list i { color: var(--accent); width: 20px; }
.social-links { display: flex; gap: 12px; margin-top: 28px; }
.social-links a {
    width: 42px; height: 42px; border-radius: 50%; background: var(--surface);
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
    transition: background .3s ease, transform .3s ease, color .3s ease;
}
.social-links a:hover { background: var(--gradient); color: #04121a; transform: translateY(-4px); }

.contacto-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { position: relative; margin-bottom: 20px; }
.field input, .field textarea {
    width: 100%; padding: 16px 14px 10px; font-family: inherit; font-size: .95rem;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text);
    outline: none; transition: border-color .3s ease, box-shadow .3s ease;
    resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
.field label {
    position: absolute; left: 14px; top: 15px; color: var(--text-dim); font-size: .95rem;
    pointer-events: none; transition: transform .2s var(--ease), font-size .2s var(--ease), color .2s var(--ease), top .2s var(--ease);
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
    top: 6px; font-size: .72rem; color: var(--accent);
}
.field-error { display: block; min-height: 16px; font-size: .76rem; color: #fb7185; margin-top: 4px; }
.field.invalid input, .field.invalid textarea { border-color: #fb7185; }

.btn-spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(4,18,26,.3); border-top-color: #04121a;
    animation: spin .7s linear infinite;
}
.btn-block.loading .btn-text { display: none; }
.btn-block.loading .btn-spinner { display: inline-block; }
.form-msg { margin-top: 14px; font-size: .88rem; min-height: 18px; }
.form-msg.ok { color: var(--accent-3); }
.form-msg.error { color: #fb7185; }

/* ===== Footer ===== */
.footer { padding: 50px 0; border-top: 1px solid var(--border); text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer p { margin: 0; font-size: .85rem; }
.footer-note { font-size: .78rem; opacity: .7; }

/* ===== Back to top ===== */
.back-to-top {
    position: fixed; bottom: 26px; right: 26px; z-index: 400;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--gradient); color: #04121a; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    box-shadow: 0 10px 25px -8px rgba(34,211,238,.5);
    opacity: 0; transform: translateY(16px); pointer-events: none;
    transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
    .nosotros-grid, .contacto-grid { grid-template-columns: 1fr; }
    .nosotros-visual { order: 2; }
    .servicios-grid { grid-template-columns: repeat(2, 1fr); }
    .marcas-grid, .proceso-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

@media (max-width: 760px) {
    .burger { display: flex; }
    .nav-links {
        position: fixed; top: 0; right: -100%; height: 100vh; width: min(78vw, 320px);
        background: var(--bg-alt); flex-direction: column; align-items: stretch;
        padding: 100px 28px 40px; gap: 6px; transition: right .45s var(--ease);
        border-left: 1px solid var(--border);
    }
    .nav-links.open { right: 0; }
    .nav-link { padding: 14px 16px; }
    .nav-cta { margin-left: 0; text-align: center; }

    .servicios-grid, .marcas-grid, .proceso-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
