/* =========================================================
   IAAI Consulting — Estilos
   Marca: avance, rapidez, movimiento continuo
   Paleta: Índigo #4F46E5 → Cian #22D3EE, fondo Navy #0B1220
   ========================================================= */

:root {
  --navy: #0B1220;
  --navy-soft: #121B2E;
  --ink: #0F172A;
  --paper: #F8FAFC;
  --paper-alt: #EEF2FF;
  --indigo: #4F46E5;
  --violet: #7C6CF6;
  --cyan: #22D3EE;
  --muted: #5B6478;
  --line: #E2E8F0;
  --success: #16A34A;

  --gradient: linear-gradient(120deg, var(--indigo), var(--violet) 55%, var(--cyan));

  --font-display: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 45px -20px rgba(15, 23, 42, 0.25);
  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; color: var(--muted); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { left: 16px; top: 16px; }

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--indigo);
  margin: 0 0 .6em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 12px 24px -10px rgba(79, 70, 229, .55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(79, 70, 229, .6); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
}
.brand-logo { height: 32px; width: auto; }
.main-nav {
  display: flex;
  gap: 28px;
  font-weight: 500;
  font-size: .95rem;
}
.main-nav a:hover { color: var(--indigo); }
.header-cta { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted, #64748b);
  font-family: inherit;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .02em;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-btn:hover { color: var(--indigo); }
.lang-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  padding: 120px 0 90px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 85% 10%, rgba(34, 211, 238, .25), transparent 60%),
    radial-gradient(50% 50% at 10% 90%, rgba(124, 108, 246, .3), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.04) 0 2px, transparent 2px 40px);
}
.hero-inner { position: relative; max-width: 760px; }
.hero .eyebrow { color: var(--cyan); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); color: #fff; }
.hero-lead { color: rgba(255,255,255,.75); font-size: 1.1rem; max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 48px; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.hero-stats strong { display: block; font-family: var(--font-display); color: var(--cyan); margin-bottom: 6px; }
.hero-stats span { color: rgba(255,255,255,.7); font-size: .92rem; }

/* Trust strip */
.trust { padding: 28px 0; background: var(--paper-alt); }
.trust-inner p { margin: 0; text-align: center; color: var(--ink); font-weight: 500; }
.trust-inner strong { color: var(--indigo); }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--paper-alt); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.section-lead { font-size: 1.05rem; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border-radius: 14px;
  background: var(--gradient);
  margin-bottom: 18px;
}
.service-card h3 { font-size: 1.15rem; }
.service-card p { margin: 0; }

/* Service cards as interactive buttons */
button.service-card {
  display: block;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
button.service-card:hover,
button.service-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--indigo);
  box-shadow: 0 24px 40px -18px rgba(79, 70, 229, .35);
  outline: none;
}
.card-link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .88rem;
  color: var(--indigo);
}
.services-hint {
  text-align: center;
  font-size: .88rem;
  color: var(--muted);
  margin: 28px 0 0;
}

/* Modal: casos de uso por servicio */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 18, 32, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.4);
  padding: 40px 36px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.modal-close:hover { border-color: var(--indigo); color: var(--indigo); }
.modal-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border-radius: 14px;
  background: var(--gradient);
  margin-bottom: 18px;
}
.modal h3 { font-size: 1.4rem; margin-bottom: 10px; }
.modal-desc { margin: 0 0 20px; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.modal-list { display: grid; gap: 14px; margin: 0 0 28px; }
.modal-list li {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper-alt);
  font-size: .95rem;
  color: var(--ink);
}

.modal-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.sector-card { padding: 24px; }
.sector-card .card-icon { width: 46px; height: 46px; font-size: 1.2rem; margin-bottom: 14px; }
.sector-card h3 { font-size: 1.05rem; }
.sector-card p { margin: 0; font-size: .92rem; }

.case-card { position: relative; }
.case-tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--indigo);
  background: var(--paper-alt);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}
.case-card h3 { font-size: 1.1rem; }
.case-card p { margin: 0; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: start;
}
.about-list { display: grid; gap: 18px; }
.about-list li {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
}
.about-list strong { font-family: var(--font-display); color: var(--indigo); }
.about-list span { color: var(--muted); font-size: .92rem; }

/* Chat widget — agente conversacional con texto libre + respuestas rápidas */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.chat-widget {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-window {
  max-height: 380px;
  min-height: 220px;
  overflow-y: auto;
  padding: 24px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  max-width: 88%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: .95rem;
  white-space: pre-wrap;
}
.chat-bubble.bot {
  align-self: flex-start;
  background: var(--paper-alt);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Bloque de campos estructurados incrustado en una burbuja del bot
   (p.ej. "nombre y empresa", o preguntas con dato concreto) */
.chat-bubble.bot-fields { max-width: 100%; background: transparent; padding: 0; }
.chat-fields-card {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.chat-fields-card label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 6px;
}
.chat-fields-card input,
.chat-fields-card textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}
.chat-fields-card .btn { justify-self: end; }

/* Respuestas rápidas (chips) — al estilo de sugerencias de Claude Desktop:
   siempre conviven con el campo de texto libre, nunca lo sustituyen. */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px 0;
}
.chat-quick-replies[hidden] { display: none; }
.chat-chip {
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chat-chip:hover { border-color: var(--indigo); color: var(--indigo); }
.chat-chip.selected { background: var(--gradient); color: #fff; border-color: transparent; }
.chat-chip.chip-continue { font-weight: 600; }

/* Campo de texto libre, siempre visible */
.chat-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.chat-input-row input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font: inherit;
}
.chat-input-row input[type="text"]:disabled { background: var(--paper-alt); color: var(--muted); }
.chat-input-row .btn { padding: 12px 22px; }

.chat-success { padding: 24px; text-align: center; color: var(--success); font-weight: 600; }
.hidden-field, .hidden { position: absolute; left: -9999px; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact-links { display: grid; gap: 14px; margin-top: 24px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color .15s ease, transform .15s ease;
}
.contact-link:hover { border-color: var(--indigo); transform: translateX(4px); }
.contact-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--paper-alt);
  font-size: 1.2rem;
}
.contact-link strong { display: block; font-family: var(--font-display); font-size: .95rem; }
.contact-link span span { color: var(--muted); font-size: .88rem; }

.contact-form { display: grid; gap: 16px; }
.contact-form label { display: block; font-weight: 600; font-size: .9rem; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font: inherit;
}
.form-note { color: var(--success); font-weight: 600; margin: 4px 0 0; }
.form-note.card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-size: 1.02rem;
}
.form-note.card[hidden] { display: none; }
.form-note.card::before {
  content: "✓";
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-weight: 700;
}

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,.7); padding: 44px 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-inner p { margin: 0; color: rgba(255,255,255,.6); font-size: .88rem; }
.footer-links { display: flex; gap: 20px; font-size: .88rem; }
.footer-links a:hover { color: var(--cyan); }

/* Responsive */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 16px 24px;
    gap: 14px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; gap: 18px; }
  .hero { padding: 96px 0 64px; }
}

/* WhatsApp floating bubble */
.whatsapp-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .28);
  transition: transform .18s ease, box-shadow .18s ease;
}
.whatsapp-bubble:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 14px 28px rgba(15, 23, 42, .34);
}
@media (max-width: 720px) {
  .whatsapp-bubble { right: 16px; bottom: 16px; width: 52px; height: 52px; }
}

/* =========================================================
   Páginas propias de servicio (services/<id>.html)
   ========================================================= */
.breadcrumb {
  font-size: .85rem;
  color: var(--muted);
  padding: 18px 0 0;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--indigo); }

.service-hero {
  padding: 28px 0 48px;
}
.service-hero .card-icon {
  width: 64px; height: 64px;
  font-size: 1.7rem;
  margin-bottom: 18px;
}
.service-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 14px; }
.service-hero .section-lead { max-width: 62ch; }

.service-explain { display: grid; gap: 14px; max-width: 72ch; }

.use-case-card {
  display: grid;
  gap: 18px;
  margin-top: 8px;
}
.use-case-card .uc-block { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--paper-alt); border: 1px solid var(--line); }
.use-case-card .uc-block h4 { margin: 0 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--indigo); }
.use-case-card .uc-block p { margin: 0; }

.diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin-top: 12px;
}
.diagram-step {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  position: relative;
}
.diagram-step .diagram-num {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
}
.diagram-step p { margin: 0; font-size: .92rem; color: var(--muted); }
.diagram-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: var(--indigo);
  font-size: 1.4rem;
  font-weight: 700;
}
@media (max-width: 860px) {
  .diagram { flex-direction: column; }
  .diagram-arrow { transform: rotate(90deg); padding: 4px 0; }
}

.service-cta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
