:root {
  --primary: #1e6091;
  --primary-dark: #154866;
  --primary-light: #e8f1f8;
  --accent: #4ea674;
  --bg: #fafbfc;
  --surface: #ffffff;
  --text: #1a2332;
  --text-soft: #5a6878;
  --border: #e3e8ee;
  --shadow: 0 2px 12px rgba(20, 40, 70, 0.06);
  --shadow-lg: 0 12px 32px rgba(20, 40, 70, 0.10);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; }
.logo { font-size: 20px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--primary); }
nav { display: flex; align-items: center; gap: 24px; }
nav a { color: var(--text-soft); font-size: 14px; }
nav a:hover { color: var(--primary); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s;
  text-decoration: none; font-family: inherit;
}
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: white; color: var(--primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); }

/* Hero */
.hero { padding: 80px 0 100px; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center; }
.hero-text h1 { font-size: 48px; line-height: 1.1; font-weight: 700; letter-spacing: -1px; margin-bottom: 20px; }
.lead { font-size: 18px; color: var(--text-soft); margin-bottom: 32px; max-width: 540px; }
.cta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hours { font-size: 14px; color: var(--text-soft); }

.hero-card {
  background: var(--surface); padding: 32px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.hero-card-icon { font-size: 40px; margin-bottom: 12px; }
.hero-card h3 { font-size: 18px; margin-bottom: 8px; }
.hero-card p { color: var(--text-soft); font-size: 14px; }

/* Services */
.services { background: var(--surface); padding: 80px 0; border-top: 1px solid var(--border); }
.services h2, .equipo h2, .contacto h2 { font-size: 32px; margin-bottom: 40px; text-align: center; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.service-card {
  background: var(--bg); padding: 28px; border-radius: var(--radius); border: 1px solid var(--border);
  transition: all 0.2s;
}
.service-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.service-icon { font-size: 32px; margin-bottom: 12px; }
.service-card h3 { font-size: 17px; margin-bottom: 8px; }
.service-card p { color: var(--text-soft); font-size: 14px; }

/* Features */
.equipo { padding: 80px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.feature { padding: 24px 0; }
.feature-num {
  display: inline-block; font-size: 14px; font-weight: 600; color: var(--primary);
  background: var(--primary-light); padding: 4px 12px; border-radius: 100px; margin-bottom: 12px;
}
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--text-soft); }

/* Contacto */
.contacto { background: var(--primary); color: white; padding: 60px 0; }
.contacto-inner { display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap; }
.contacto h2 { color: white; text-align: left; margin-bottom: 8px; }
.contacto p { opacity: 0.9; max-width: 480px; }
.contacto .btn-primary { background: white; color: var(--primary); }
.contacto .btn-primary:hover { background: var(--primary-light); }

/* Footer */
.footer { padding: 32px 0; text-align: center; color: var(--text-soft); font-size: 14px; border-top: 1px solid var(--border); }

/* Chat widget */
.chat-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 60px; height: 60px; border-radius: 50%; border: none;
  background: var(--primary); color: white; font-size: 24px;
  cursor: pointer; box-shadow: var(--shadow-lg); z-index: 100;
  transition: transform 0.15s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab.hidden { display: none; }

.chat-widget {
  position: fixed; bottom: 24px; right: 24px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 580px; max-height: calc(100vh - 60px);
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  z-index: 100; border: 1px solid var(--border);
  transition: opacity 0.2s, transform 0.2s;
}
.chat-widget.hidden { opacity: 0; transform: translateY(20px) scale(0.98); pointer-events: none; }

.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; background: var(--primary); color: white;
  border-radius: var(--radius) var(--radius) 0 0;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 36px; height: 36px; background: rgba(255,255,255,0.2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.chat-header strong { display: block; font-size: 15px; }
.chat-status { font-size: 12px; opacity: 0.85; }
.chat-status::before { content: "● "; color: #4ade80; }
.chat-close {
  background: none; border: none; color: white; font-size: 28px; line-height: 1;
  cursor: pointer; opacity: 0.8; padding: 0 8px;
}
.chat-close:hover { opacity: 1; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  background: var(--bg); display: flex; flex-direction: column; gap: 12px;
}
.msg { padding: 10px 14px; border-radius: 14px; max-width: 80%; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg-bot { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-typing { color: var(--text-soft); font-style: italic; }
.msg-typing::after {
  content: "."; animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60% { content: "..."; }
  80%, 100% { content: ""; }
}

.chat-form {
  display: flex; padding: 12px; gap: 8px; border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
}
.chat-form input:focus { border-color: var(--primary); }
.chat-form button {
  background: var(--primary); color: white; border: none; padding: 10px 16px;
  border-radius: 8px; cursor: pointer; font-size: 16px;
}
.chat-form button:hover { background: var(--primary-dark); }
.chat-form button:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-icon-btn {
  background: transparent !important; color: var(--text-soft) !important;
  padding: 8px 10px !important; font-size: 18px !important;
  transition: all 0.15s;
}
.chat-icon-btn:hover { color: var(--primary) !important; background: var(--primary-light) !important; }
.chat-icon-btn.active { color: var(--primary) !important; background: var(--primary-light) !important; }
.chat-icon-btn.recording { color: #dc2626 !important; background: #fee2e2 !important; animation: pulse 1s ease-in-out infinite; }
.chat-speaker-off { opacity: 0.45; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 760px) {
  .hero { padding: 50px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-text h1 { font-size: 34px; }
  nav a { display: none; }
  .chat-widget { right: 16px; bottom: 16px; left: 16px; width: auto; }
}
