/* =========================================================
   Dodotico — estilos
   ========================================================= */

:root {
  --navy-900: #0b1f3a;
  --navy-800: #12294b;
  --navy-700: #1b365f;
  --blue-600: #1d4ed8;
  --blue-500: #2563eb;
  --blue-100: #dbe6fd;
  --blue-50: #eef3fe;

  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --success: #15803d;
  --danger: #b91c1c;
  --whatsapp: #128c4a;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, .06);
  --shadow: 0 1px 2px rgba(11, 31, 58, .05), 0 8px 24px rgba(11, 31, 58, .06);
  --shadow-lg: 0 2px 4px rgba(11, 31, 58, .05), 0 18px 40px rgba(11, 31, 58, .10);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 72px;
  --container: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--navy-900); }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 3px; border-radius: 6px; }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.container-narrow { max-width: 820px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; color: #fff; }

.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-600); margin-bottom: 14px;
}
.text-accent { color: var(--blue-600); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 600; font-size: .98rem; line-height: 1;
  padding: 15px 24px; border-radius: 12px; border: 1.5px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.btn .icon { width: 1.1em; height: 1.1em; transition: transform .2s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn-sm { padding: 11px 18px; font-size: .92rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(29, 78, 216, .22); }
.btn-primary:hover { background: var(--navy-900); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--navy-900); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy-900); color: var(--navy-900); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--blue-50); color: var(--navy-900); transform: translateY(-1px); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #0e6f3a; color: #fff; }
.btn-whatsapp .icon { width: 1.3em; height: 1.3em; }
.btn-whatsapp:hover .icon { transform: none; }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; color: var(--navy-900); }
.brand-logo { height: 40px; width: auto; object-fit: contain; }
.brand-logo-footer { height: 44px; }
.brand-name { color: inherit; font-size: 1.35rem; font-weight: 800; line-height: 1; letter-spacing: -.055em; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: .95rem; font-weight: 500; color: var(--text);
  transition: color .2s, background-color .2s;
}
.nav-link:hover { color: var(--navy-900); background: var(--bg-alt); }
.nav-link.is-active { color: var(--blue-600); }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle-bar { display: block; width: 20px; height: 2px; background: var(--navy-900); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px);
  background:
    radial-gradient(900px 420px at 85% 10%, var(--blue-50), transparent 70%),
    var(--bg);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 56px; }
.hero-lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text); max-width: 34em; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .92rem; color: var(--muted); }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { color: var(--blue-600); width: 1.05em; height: 1.05em; }
.hero-visual { position: relative; }
.flow-svg { width: 100%; height: auto; aspect-ratio: 520 / 440; }
.flow-line { stroke-dasharray: 6 7; animation: flow 1.6s linear infinite; }
.pulse { transform-origin: 260px 220px; animation: pulse 3s var(--ease) infinite; }
@keyframes flow { to { stroke-dashoffset: -26; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: .55; } }

/* ---------- Secciones ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid #edf1f6; }
.section-head { max-width: 760px; margin: 0 auto clamp(36px, 5vw, 56px); text-align: center; }
.section-lead { font-size: 1.08rem; color: var(--muted); margin: 0; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-services { grid-template-columns: repeat(3, 1fr); gap: 22px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.card:hover { box-shadow: var(--shadow); border-color: #d6dee9; }
.card h3 { margin-bottom: .45em; }
.card p { color: var(--muted); margin: 0; font-size: .97rem; }

.card-icon {
  display: inline-grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px;
  border-radius: 12px; background: var(--blue-50); color: var(--blue-600);
}
.card-icon .icon { width: 22px; height: 22px; }
.card-icon-solid { background: var(--navy-900); color: #fff; }

.problem-card:hover { transform: translateY(-3px); }

.service-card { display: flex; flex-direction: column; }
.service-dl { margin: 6px 0 0; display: grid; gap: 14px; }
.service-dl div { padding-top: 14px; border-top: 1px dashed var(--line); }
.service-dl dt { font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--blue-600); margin-bottom: 3px; }
.service-dl dd { margin: 0; font-size: .95rem; color: var(--text); }
.service-card-cta {
  background: var(--navy-900); border-color: var(--navy-900); color: #cbd5e1;
  justify-content: center; gap: 4px;
  background-image: radial-gradient(500px 240px at 100% 0%, rgba(37, 99, 235, .35), transparent 70%);
}
.service-card-cta h3 { color: #fff; font-size: 1.3rem; }
.service-card-cta p { color: #cbd5e1; margin-bottom: 22px; }
.service-card-cta .btn { align-self: flex-start; }

/* ---------- Demostraciones ---------- */
.demos { display: grid; gap: 28px; }
.demo {
  display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.demo:nth-child(even) { grid-template-columns: 1fr 1.35fr; }
.demo:nth-child(even) .demo-media { order: 2; }
.demo-media { position: relative; background: var(--navy-900); aspect-ratio: 16 / 9; }
.demo-video { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--navy-900); }
.demo-body { padding: clamp(24px, 3.5vw, 44px); }
.demo-body h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.demo-body p { color: var(--muted); margin: 0; }
.demo-tag {
  display: inline-block; margin-bottom: 14px; padding: 5px 11px; border-radius: 999px;
  background: var(--blue-50); color: var(--blue-600); font-size: .78rem; font-weight: 650; letter-spacing: .02em;
}
.video-missing {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center;
  background: rgba(11, 31, 58, .88); color: #e2e8f0; font-size: .92rem;
}
.video-missing strong { color: #fff; display: block; margin-bottom: 4px; }
.video-missing code { font-size: .85em; background: rgba(255, 255, 255, .1); padding: 2px 6px; border-radius: 4px; }

.cta-band {
  margin-top: 40px; padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  border-radius: var(--radius-lg); background: var(--navy-900); color: #cbd5e1;
  background-image: radial-gradient(600px 260px at 100% 100%, rgba(37, 99, 235, .4), transparent 70%);
}
.cta-band h3 { color: #fff; font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin-bottom: .3em; }
.cta-band p { margin: 0; }

/* ---------- Pasos ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 52px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--blue-100) 0 8px, transparent 8px 14px);
  z-index: 0;
}
.step {
  position: relative; z-index: 1; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 22px;
  box-shadow: var(--shadow-sm);
}
.step-num { position: absolute; top: 14px; right: 16px; font-size: .8rem; font-weight: 700; color: #b6c3d6; }
.step-icon {
  display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px;
  border-radius: 50%; background: var(--blue-600); color: #fff; box-shadow: 0 0 0 7px var(--blue-50);
}
.step-icon .icon { width: 22px; height: 22px; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, box-shadow .2s; }
.faq-item.is-open { border-color: #c9d6f3; box-shadow: var(--shadow-sm); }
.faq-q { margin: 0; font-size: 1rem; }
.faq-q button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; background: none; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 1.02rem; color: var(--ink); text-align: left;
}
.faq-q button:hover { color: var(--blue-600); }
.faq-q .icon { color: var(--blue-600); transition: transform .3s var(--ease); }
.faq-q button[aria-expanded="true"] .icon { transform: rotate(180deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.faq-a > div { overflow: hidden; }
.faq-a p { padding: 0 22px 20px; margin: 0; color: var(--text); }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
/* Sin JS: respuestas visibles */
html:not(.js) .faq-a { grid-template-rows: 1fr; }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact-intro .section-lead { margin-bottom: 26px; }
.contact-list { display: grid; gap: 12px; margin-bottom: 32px; }
.contact-list li { display: flex; gap: 10px; align-items: flex-start; }
.contact-list .icon { color: var(--blue-600); margin-top: 3px; width: 1.1em; height: 1.1em; }
.whatsapp-box { padding: 24px; border-radius: var(--radius); background: var(--bg-alt); border: 1px solid var(--line); }
.whatsapp-box > p:first-child { font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.whatsapp-note { margin: 12px 0 0; font-size: .9rem; color: var(--muted); }

.contact-form { padding: clamp(24px, 3.5vw, 36px); box-shadow: var(--shadow); }
.contact-form:hover { box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .93rem; color: var(--ink); margin-bottom: 7px; }
.req { color: var(--danger); }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder, .field textarea::placeholder { color: #94a3b8; }
.field input:hover, .field textarea:hover { border-color: #cbd5e1; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field.has-error input:focus, .field.has-error textarea:focus { box-shadow: 0 0 0 4px rgba(185, 28, 28, .12); }
.field-error { margin: 6px 0 0; font-size: .86rem; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }
.form-hint { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; padding: 14px 16px; border-radius: 10px; font-size: .94rem; }
.form-status.is-success { background: #ecfdf3; color: var(--success); border: 1px solid #bbf7d0; }
.form-status.is-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.form-status.is-info { background: var(--blue-50); color: var(--navy-800); border: 1px solid var(--blue-100); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #b8c4d6; padding-top: 64px; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer-brand p { max-width: 26em; margin: 18px 0 0; font-size: .95rem; }
.footer-title { color: #fff; font-size: .82rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.site-footer ul { display: grid; gap: 10px; }
.site-footer a { color: #b8c4d6; font-size: .95rem; transition: color .2s; }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: #93b4f5; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 22px; font-size: .88rem; }
.footer-bottom p { margin: 0; }

/* ---------- Animaciones de aparición ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-3, .grid-services { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps::before { display: none; }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px 24px 24px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link { padding: 12px; font-size: 1rem; }
  .nav-cta { width: 100%; padding: 14px; }

  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 560px; margin-inline: auto; width: 100%; }

  .demo, .demo:nth-child(even) { grid-template-columns: 1fr; }
  .demo:nth-child(even) .demo-media { order: 0; }

  .contact { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .container { padding-inline: 18px; }
  .brand-logo { height: 34px; }
  .grid-3, .grid-services, .steps { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
  .section-head { text-align: left; }
  .cta-band .btn { width: 100%; }
  .card { padding: 22px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
