/* =========================================================
   VIXAN SYSTEMS — Hoja de estilos
   Base clara, azul marino del logo para el texto,
   un único acento plano (turquesa oscuro).
   ========================================================= */

:root {
  /* Marca */
  --ink: #0C2340;          /* azul marino del logo: texto y bloques oscuros */
  --ink-soft: #2D3F54;
  --muted: #52647A;
  --logo-gray: #B8C1CC;

  /* Paleta SB-2026 en uso */
  --accent: #028183;       /* botones y enlaces */
  --accent-hover: #016A6C;
  --teal: #0FA69D;
  --green: #1DBD8E;        /* confirmaciones, estado activo */
  --green-soft: #E3F6EF;
  --cyan: #00D4C6;
  --blue: #006ECF;

  /* Neutros */
  --white: #FFFFFF;
  --paper: #F2F5F7;
  --line: #D9E1E8;
  --error: #C2372F;

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 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: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -.022em; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

svg[viewBox="0 0 24 24"] { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 200; background: var(--ink); color: var(--white); padding: .6rem 1rem; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 1rem; color: var(--white); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.35rem; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); color: var(--white); }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { background: var(--green-soft); color: var(--ink); }
.btn-link { padding-left: .4rem; padding-right: .4rem; color: var(--ink); text-decoration: underline; text-decoration-color: var(--logo-gray); text-underline-offset: .3em; }
.btn-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.btn-sm { padding: .6rem 1rem; font-size: .95rem; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* =========================================================
   CABECERA
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand img { height: 38px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav ul { display: flex; gap: 1.6rem; }
.main-nav ul a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .97rem; }
.main-nav ul a:hover, .main-nav ul a.active { color: var(--accent); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   PORTADA
   ========================================================= */
.hero { padding: 64px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 4.8vw, 3.9rem); font-weight: 600; letter-spacing: -.032em; line-height: 1.04; max-width: 14ch; }
.hero-lead { margin-top: 1.6rem; font-size: 1.2rem; line-height: 1.6; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 2.2rem; }
.hero-note { margin-top: 1.4rem; font-size: .95rem; color: var(--muted); padding-left: 1.1rem; position: relative; }
.hero-note::before { content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.hero-media { position: relative; padding-bottom: 48px; }
.hero-photo { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; object-position: 60% center; border-radius: 18px; }

/* Conversación (elemento protagonista) */
.chat {
  position: absolute; left: -56px; bottom: 0; width: min(360px, 82%); margin: 0;
  background: #EFEAE2; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 48px -16px rgba(12, 35, 64, .35), 0 2px 6px rgba(12, 35, 64, .08);
}
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; background: var(--ink); color: var(--white); }
.chat-head strong { display: block; font-size: .95rem; font-weight: 600; line-height: 1.25; }
.chat-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); font-weight: 700; font-size: .8rem; }
.chat-online { font-size: .78rem; color: #A9E9D3; }
.chat-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 8px; min-height: 280px; }
.msg { max-width: 84%; padding: .5rem .7rem .35rem; border-radius: 10px; font-size: .9rem; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.msg time { display: block; text-align: right; font-size: .68rem; color: #6B7A8A; margin-top: 2px; }
.msg.in { align-self: flex-start; background: var(--white); border-top-left-radius: 3px; }
.msg.out { align-self: flex-end; background: #D6F5E8; border-top-right-radius: 3px; }
.msg.out time::after { content: " ✓✓"; color: var(--blue); }
.chat figcaption { padding: 0 12px 10px; font-size: .72rem; color: #6B7A8A; text-align: center; }

.js .msg { opacity: 0; transform: translateY(6px); }
.js .msg.shown { opacity: 1; transform: none; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.typing { align-self: flex-start; background: var(--white); border-radius: 10px; border-top-left-radius: 3px; padding: .65rem .8rem; display: flex; gap: 4px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: #9AA7B4; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* =========================================================
   DECLARACIÓN (cualquier sector)
   ========================================================= */
.statement { background: var(--ink); color: var(--white); padding: 88px 0; }
.statement p { font-size: clamp(1.6rem, 3.1vw, 2.5rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 500; max-width: 30ch; color: var(--logo-gray); }
.statement p span { display: block; margin-top: 1.2rem; color: var(--white); }

/* =========================================================
   SECCIONES
   ========================================================= */
.section { padding: 112px 0; }
.section-paper { background: var(--paper); }
.section-head { max-width: 640px; margin-bottom: 64px; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.section-head p { margin-top: 1rem; font-size: 1.15rem; color: var(--muted); }

/* Sectores: filas alternas foto / texto */
.sector { display: grid; grid-template-columns: 1.1fr 1fr; gap: 72px; align-items: center; }
.sector + .sector { margin-top: 96px; }
.sector img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
.sector-flip img { order: 2; }
.sector h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.sector-text > p { margin-top: .9rem; font-size: 1.12rem; color: var(--muted); max-width: 32em; }
.ticks { margin-top: 1.6rem; border-top: 1px solid var(--line); }
.ticks li { position: relative; padding: .85rem 0 .85rem 2rem; border-bottom: 1px solid var(--line); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 1.2rem; width: 11px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.sector-open { background: var(--paper); border-radius: 18px; padding: 40px; gap: 56px; }
.sector-open .btn { margin-top: 1.8rem; }

/* Servicios como lista de definición */
.services { display: grid; grid-template-columns: .8fr 1.2fr; gap: 72px; align-items: start; }
.services .section-head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 40px); }
.service-list > div { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.service-list > div:last-child { border-bottom: 1px solid var(--line); }
.service-list dt { font-weight: 600; font-size: 1.15rem; }
.service-list dd { color: var(--muted); }

/* Método: secuencia real, numeración justificada */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; counter-reset: paso; }
.steps li { counter-increment: paso; border-top: 2px solid var(--ink); padding-top: 24px; }
.steps li::before { content: counter(paso); display: block; font-size: 3rem; font-weight: 600; line-height: 1; color: var(--accent); margin-bottom: 1.2rem; letter-spacing: -.04em; }
.steps h3 { font-size: 1.25rem; }
.steps p { margin-top: .6rem; color: var(--muted); }

/* Fundador */
.founder { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; align-items: center; }
.founder-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; }
.founder-photo.placeholder {
  display: grid; place-content: center; justify-items: center; gap: 14px;
  background: repeating-linear-gradient(135deg, #E7ECF0 0 14px, #EDF1F4 14px 28px);
  border: 2px dashed var(--logo-gray); color: var(--muted); font-weight: 600;
}
.founder-photo.placeholder img { width: 64px; height: 64px; border-radius: 14px; }
.founder-text h2 { font-size: clamp(2rem, 3.4vw, 2.6rem); }
.founder-quote { margin-top: 1.6rem; font-size: 1.3rem; line-height: 1.55; color: var(--ink-soft); max-width: 34em; }
.promises { margin-top: 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; }
.promises li { color: var(--muted); font-size: 1rem; }
.promises strong { display: block; color: var(--ink); margin-bottom: .2rem; }
.signature { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); color: var(--muted); }
.signature strong { color: var(--ink); font-size: 1.1rem; }

/* Calculadora */
.calc { display: grid; grid-template-columns: 1.1fr .9fr; gap: 72px; align-items: center; }
.calc-inputs h2 { font-size: clamp(2rem, 3.4vw, 2.6rem); max-width: 16ch; }
.calc-inputs > p { margin-top: 1rem; font-size: 1.12rem; color: var(--muted); max-width: 32em; }
.range { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: .7rem 1rem; margin-top: 2.2rem; }
.range label { font-weight: 500; }
.range output { font-weight: 700; font-size: 1.25rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.range input { grid-column: 1 / -1; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) var(--fill, 50%), var(--line) var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(12,35,64,.2); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--white); border: 2px solid var(--accent); }
.calc-result { background: var(--ink); color: var(--white); border-radius: 18px; padding: 36px; }
.calc-result dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.calc-result dt { color: var(--logo-gray); }
.calc-result dd { font-weight: 600; font-size: 1.4rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-result .total { border-bottom: 0; padding-top: 18px; }
.calc-result .total dd { font-size: 2.3rem; color: #7FE3C1; letter-spacing: -.02em; }
.calc-note { font-size: .85rem; color: var(--logo-gray); margin: 10px 0 22px; }

/* Preguntas */
.faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: 72px; align-items: start; }
.faq .section-head { margin-bottom: 0; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { list-style: none; cursor: pointer; position: relative; padding: 22px 48px 22px 0; font-weight: 600; font-size: 1.1rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before, .faq-list summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 14px; height: 2px; background: var(--accent); transition: transform .25s var(--ease); }
.faq-list summary::after { transform: rotate(90deg); }
.faq-list details[open] summary::after { transform: rotate(0); }
.faq-list summary:hover { color: var(--accent); }
.faq-list details p { padding: 0 48px 24px 0; color: var(--muted); max-width: 40em; }

/* Contacto */
.contact { background: var(--ink); color: var(--white); padding: 112px 0; }
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: start; }
.contact h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.contact-copy > p { margin-top: 1.2rem; font-size: 1.15rem; color: var(--logo-gray); max-width: 30em; }
.contact-direct { margin-top: 2.4rem; display: flex; flex-direction: column; gap: 14px; }
.contact-direct a { display: inline-flex; align-items: center; gap: .7rem; color: var(--white); font-weight: 500; text-decoration: none; font-size: 1.08rem; }
.contact-direct a:hover { color: #7FE3C1; }
.contact-direct svg { width: 22px; height: 22px; color: #7FE3C1; }

.contact-form { background: var(--white); color: var(--ink); border-radius: 18px; padding: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; margin-bottom: 18px; min-width: 0; }
.field label { font-size: .93rem; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: .75rem .9rem; border-radius: 8px;
  border: 1px solid #C5D0DA; background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(2,129,131,.18); }
.field-error { display: none; margin-top: 6px; font-size: .86rem; color: var(--error); }
.field.invalid input, .field.invalid select { border-color: var(--error); }
.field.invalid .field-error { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; color: var(--muted); margin: 6px 0 24px; cursor: pointer; }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.consent.invalid span { color: var(--error); }
.form-status { margin-top: 14px; font-size: .95rem; font-weight: 500; text-align: center; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: var(--error); }

/* Pie */
.site-footer { background: #081A30; color: var(--logo-gray); padding: 72px 0 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 56px; }
.footer-grid > div, .footer-grid > nav { display: flex; flex-direction: column; gap: 10px; }
.footer-grid h2 { font-size: .95rem; color: var(--white); letter-spacing: 0; margin-bottom: .3rem; }
.footer-grid a { color: var(--logo-gray); text-decoration: none; width: fit-content; }
.footer-grid a:hover { color: var(--white); }
.footer-brand img { height: 36px; width: auto; margin-bottom: 8px; }
.footer-brand p { max-width: 300px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 22px; padding-bottom: 22px; font-size: .88rem; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: var(--white);
  box-shadow: 0 10px 24px -8px rgba(12,35,64,.45);
}
.wa-float:hover { background: var(--teal); color: var(--white); }
.wa-float svg { width: 30px; height: 30px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero h1 { max-width: 18ch; }
  .hero-media { max-width: 640px; margin-left: auto; }
  .chat { left: -28px; }
  .services, .faq, .calc, .contact-grid, .founder { grid-template-columns: 1fr; gap: 48px; }
  .services .section-head { position: static; }
  .founder-photo { max-width: 420px; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 1.2rem;
    background: var(--white); padding: 12px 28px 28px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 32px -20px rgba(12,35,64,.25);
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav ul a { display: block; padding: .9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .sector, .sector-open { grid-template-columns: 1fr; gap: 28px; }
  .sector-flip img { order: 0; }
  .sector + .sector { margin-top: 72px; }
  .service-list > div { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 1rem; }
  .wrap { padding: 0 20px; }
  .brand img { height: 32px; }
  .hero { padding: 36px 0 72px; }
  .hero-lead { font-size: 1.08rem; }
  .hero-actions .btn-primary { width: 100%; }
  .hero-media { padding-bottom: 0; }
  .hero-photo { aspect-ratio: 4 / 3; }
  .chat { position: relative; left: auto; bottom: auto; width: auto; margin: -64px 12px 0; }
  .statement { padding: 64px 0; }
  .section, .contact { padding: 80px 0; }
  .section-head { margin-bottom: 44px; }
  .sector-open { padding: 24px; }
  .steps { grid-template-columns: 1fr; }
  .promises { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form { padding: 26px 20px; }
  .calc-result { padding: 26px 22px; }
  .calc-result .total dd { font-size: 1.9rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .msg { opacity: 1; transform: none; }
}
