/* ============================================================
   Grupo ECA — Estilos web corporativa
   Estilo: profesional y moderno · con fotos y animaciones
   ============================================================ */

:root {
  --color-primary: #0e3a5f;
  --color-primary-dark: #08243d;
  --color-primary-light: #1d5a8a;
  --color-accent: #19b8a6;
  --color-accent-dark: #0f9488;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-bg: #ffffff;
  --color-bg-soft: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08);
  --shadow-md: 0 8px 30px rgba(15,23,42,0.10);
  --shadow-lg: 0 20px 50px rgba(15,23,42,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Botones ---------- */
.btn-primary, .btn-accent, .btn-ghost {
  padding: 0.85rem 1.75rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-block;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--color-accent); color: #fff; box-shadow: 0 4px 14px rgba(25,184,166,0.35); }
.btn-accent:hover { background: var(--color-accent-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(25,184,166,0.45); }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid #e2e8f0;
  transition: padding 0.25s;
}
.nav-link {
  font-size: 0.92rem; font-weight: 500;
  color: var(--color-muted); transition: color 0.15s;
}
.nav-link:hover { color: var(--color-primary); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(8,36,61,0.93) 0%, rgba(14,58,95,0.88) 55%, rgba(15,148,136,0.82) 100%),
    url('https://images.unsplash.com/photo-1581578731548-c64695cc6952?w=1600&q=80') center/cover fixed no-repeat;
  color: #fff;
  overflow: hidden;
}
/* blobs flotantes decorativos */
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  z-index: 0;
}
.hero::before {
  width: 380px; height: 380px;
  background: var(--color-accent);
  top: -120px; right: -80px;
  animation: float1 14s ease-in-out infinite;
}
.hero::after {
  width: 300px; height: 300px;
  background: #2563eb;
  bottom: -100px; left: -60px;
  animation: float2 18s ease-in-out infinite;
}
@keyframes float1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-40px,50px) scale(1.15); }
}
@keyframes float2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(50px,-40px) scale(1.2); }
}
.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.4rem 1rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 4rem);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -0.02em; margin-bottom: 1.25rem;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.3rem);
  opacity: 0.92; max-width: 640px;
  margin: 0 auto 2rem;
}
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%;
  transform: translateX(-50%); z-index: 1;
  font-size: 1.5rem; color: rgba(255,255,255,0.7);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* entrada escalonada del hero */
.hero-anim { opacity: 0; transform: translateY(30px); animation: heroUp 0.8s ease forwards; }
.hero-anim.d1 { animation-delay: 0.1s; }
.hero-anim.d2 { animation-delay: 0.3s; }
.hero-anim.d3 { animation-delay: 0.5s; }
.hero-anim.d4 { animation-delay: 0.7s; }
@keyframes heroUp { to { opacity: 1; transform: translateY(0); } }

/* ---------- Stats / contadores ---------- */
.stats-band {
  background: #fff;
  margin-top: -3.5rem;
  position: relative; z-index: 2;
}
.stat-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid #eef2f6;
}
.stat-num {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat-label { font-size: 0.85rem; color: var(--color-muted); margin-top: 0.5rem; font-weight: 500; }

/* ---------- Secciones ---------- */
.section { padding: 5.5rem 1rem; }
.section-eyebrow {
  color: var(--color-accent); font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800; letter-spacing: -0.02em;
  color: var(--color-primary); margin: 0.5rem 0;
}
.section-subtitle { color: var(--color-muted); font-size: 1.05rem; }

/* ---------- Cards de servicios (con foto) ---------- */
.service-card {
  background: #fff;
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e9eef3;
  transition: transform 0.25s, box-shadow 0.25s;
}
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.service-photo {
  height: 220px;
  overflow: hidden;
  position: relative;
}
.service-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.service-card:hover .service-photo img { transform: scale(1.1); }
.service-photo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14,58,95,0.35), transparent 60%);
}
.service-body { padding: 1.75rem; }
.service-icon {
  width: 56px; height: 56px;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  margin-top: -3rem; margin-bottom: 1rem;
  position: relative; z-index: 1;
  box-shadow: var(--shadow-md);
}
.service-body h3 { font-size: 1.3rem; font-weight: 700; color: var(--color-primary); margin-bottom: 0.5rem; }
.service-body p { color: var(--color-muted); }

/* ---------- Galería "Nuestro trabajo" ---------- */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.galeria-item {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  height: 240px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.galeria-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.galeria-item:hover img { transform: scale(1.12); }
.galeria-cap {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: 1rem;
  background: linear-gradient(to top, rgba(8,36,61,0.85), transparent 55%);
  color: #fff; font-weight: 600;
  opacity: 0; transition: opacity 0.3s;
}
.galeria-item:hover .galeria-cap { opacity: 1; }

/* ---------- Feature ---------- */
.feature {
  display: flex; gap: 1rem; align-items: flex-start;
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e9eef3;
  transition: transform 0.22s, box-shadow 0.22s;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.feature-icon {
  flex-shrink: 0; width: 52px; height: 52px;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.feature h3 { font-size: 1.1rem; font-weight: 700; color: var(--color-primary); margin-bottom: 0.25rem; }
.feature p { color: var(--color-muted); font-size: 0.95rem; }

/* ---------- Banda CTA con foto ---------- */
.cta-band {
  position: relative;
  border-radius: 1.5rem;
  padding: 4rem 2rem;
  text-align: center;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.cta-band::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(14,58,95,0.92), rgba(15,148,136,0.88)),
    url('https://images.unsplash.com/photo-1628177142898-93e36e4e3a50?w=1400&q=80') center/cover;
  z-index: 0;
}
.cta-band > * { position: relative; z-index: 1; }

/* ---------- Contacto ---------- */
.contact-item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem; border-radius: 0.85rem;
  transition: background 0.15s, transform 0.15s;
}
.contact-item:hover { background: var(--color-bg-soft); transform: translateX(4px); }
.contact-icon {
  flex-shrink: 0; width: 46px; height: 46px;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.contact-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); font-weight: 600; }

/* ---------- Footer ---------- */
.footer { background: var(--color-primary-dark); color: #94a3b8; }

/* ---------- Animación de aparición al scroll ---------- */
.reveal {
  opacity: 0; transform: translateY(34px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }
.reveal.d4 { transition-delay: 0.4s; }

.reveal-zoom {
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-zoom.visible { opacity: 1; transform: scale(1); }

/* ============================================================
   CHATBOT
   ============================================================ */
.chatbot-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; font-size: 28px; border: none; cursor: pointer;
  box-shadow: 0 8px 28px rgba(14,58,95,0.45);
  z-index: 9998; transition: transform 0.2s;
  animation: fabPulse 2.5s infinite;
}
.chatbot-fab:hover { transform: scale(1.1) rotate(8deg); }
@keyframes fabPulse {
  0%,100% { box-shadow: 0 8px 28px rgba(14,58,95,0.45); }
  50% { box-shadow: 0 8px 28px rgba(14,58,95,0.45), 0 0 0 14px rgba(25,184,166,0.12); }
}
.chatbot-window {
  position: fixed; bottom: 100px; right: 24px;
  width: 372px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 140px);
  background: #fff; border-radius: 1.25rem;
  box-shadow: var(--shadow-lg); z-index: 9999;
  display: none; flex-direction: column; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.chatbot-window.open { display: flex; animation: chatIn 0.25s ease; }
@keyframes chatIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chatbot-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff; padding: 1.1rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
}
.chatbot-messages { flex: 1; overflow-y: auto; padding: 1.1rem; background: var(--color-bg-soft); }
.msg-bot {
  background: #fff;
  border-radius: 0.5rem 0.95rem 0.95rem 0.95rem;
  padding: 0.8rem 1rem; margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm); max-width: 92%; font-size: 0.92rem;
  animation: msgIn 0.3s ease;
}
.msg-user {
  background: var(--color-primary); color: #fff;
  border-radius: 0.95rem 0.5rem 0.95rem 0.95rem;
  padding: 0.65rem 1rem; margin-bottom: 0.75rem;
  max-width: 82%; margin-left: auto; font-size: 0.92rem;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chatbot-options { padding: 0.8rem; border-top: 1px solid #e5e7eb; background: #fff; }
.chatbot-option {
  display: block; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid #e2e8f0;
  padding: 0.65rem 0.95rem; border-radius: 0.6rem;
  margin-bottom: 0.45rem; cursor: pointer;
  font-size: 0.88rem; font-weight: 500; transition: all 0.15s;
}
.chatbot-option:hover {
  background: var(--color-primary); color: #fff;
  border-color: var(--color-primary); transform: translateX(3px);
}
.chatbot-back {
  font-size: 0.82rem; color: var(--color-muted);
  background: none; border: none; cursor: pointer;
  padding: 0.5rem; width: 100%; text-align: center; font-weight: 500;
}
.chatbot-back:hover { color: var(--color-primary); }
.chatbot-form input, .chatbot-form textarea {
  width: 100%; border: 1.5px solid #d1d5db; border-radius: 0.6rem;
  padding: 0.55rem 0.8rem; margin-bottom: 0.5rem;
  font-size: 0.9rem; font-family: inherit;
}
.chatbot-form input:focus, .chatbot-form textarea:focus { outline: none; border-color: var(--color-accent); }
.chatbot-form button[type=submit] {
  width: 100%; background: var(--color-accent); color: #fff;
  border: none; padding: 0.7rem; border-radius: 0.6rem;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.chatbot-form button[type=submit]:hover { background: var(--color-accent-dark); }
.chatbot-form button:disabled { opacity: 0.5; cursor: wait; }

/* ---------- Lightbox de galería ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(8,15,25,0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 10000; padding: 2rem;
}
.lightbox.open { display: flex; animation: chatIn 0.2s ease; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 0.75rem; }
.lightbox-close {
  position: absolute; top: 20px; right: 28px;
  color: #fff; font-size: 2.5rem; cursor: pointer;
  background: none; border: none; line-height: 1;
}

@media (max-width: 640px) {
  .hero { background-attachment: scroll; }
  .stats-band { margin-top: -2rem; }
}

/* ---------- Sección Trabajá con nosotros ---------- */
.empleo-section {
  background:
    linear-gradient(135deg, rgba(8,36,61,0.96) 0%, rgba(14,58,95,0.93) 50%, rgba(13,148,136,0.88) 100%),
    url('https://images.unsplash.com/photo-1600880292203-757bb62b4baf?w=1600&q=80') center/cover fixed;
  color: #fff;
}
@media (max-width: 640px) { .empleo-section { background-attachment: scroll; } }

.empleo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
@media (max-width: 768px) { .empleo-grid { grid-template-columns: 1fr; gap: 3rem; } }

.empleo-beneficios { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.empleo-beneficios li { display: flex; gap: 1rem; align-items: flex-start; }
.beneficio-icon {
  flex-shrink: 0; width: 46px; height: 46px;
  border-radius: 0.8rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.empleo-beneficios strong { display: block; font-weight: 700; color: #fff; margin-bottom: 0.2rem; }
.empleo-beneficios p { font-size: 0.88rem; color: rgba(255,255,255,0.65); margin: 0; }

.empleo-form-card {
  background: #fff;
  border-radius: 1.4rem;
  padding: 2.25rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  color: var(--color-text);
}
.empleo-form-card h3 {
  font-size: 1.45rem; font-weight: 800;
  color: var(--color-primary); margin-bottom: 0.35rem;
}
.empleo-form-card > p { color: var(--color-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

#cvFormPagina .form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-bottom: 0.7rem;
}
@media (max-width: 480px) { #cvFormPagina .form-row { grid-template-columns: 1fr; } }

#cvFormPagina input, #cvFormPagina textarea {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 0.6rem;
  padding: 0.7rem 0.9rem; font-size: 0.92rem; font-family: inherit;
  background: #f8fafc; transition: border-color 0.15s, background 0.15s;
}
#cvFormPagina input:focus, #cvFormPagina textarea:focus {
  outline: none; border-color: var(--color-accent); background: #fff;
}
#cvFormPagina textarea { display: block; margin-bottom: 0.7rem; resize: vertical; }

.cv-upload-label { display: block; margin-bottom: 1.25rem; cursor: pointer; }
.cv-upload-label input[type="file"] { display: none; }
.cv-upload-label span {
  display: block; border: 2px dashed #d1d5db; border-radius: 0.75rem;
  padding: 1rem 1.25rem; text-align: center; font-size: 0.88rem;
  color: var(--color-muted); transition: border-color 0.15s, background 0.15s; line-height: 1.6;
}
.cv-upload-label:hover span, .cv-upload-label.tiene-archivo span {
  border-color: var(--color-accent); background: #f0fdfb; color: var(--color-accent-dark);
}

#cvFormPagina button[type="submit"] {
  width: 100%; padding: 0.9rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; border: none; border-radius: 0.75rem;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(25,184,166,0.35);
}
#cvFormPagina button[type="submit"]:hover { opacity: 0.9; transform: translateY(-1px); }
#cvFormPagina button[type="submit"]:disabled { opacity: 0.5; cursor: wait; transform: none; }

.empleo-success { text-align: center; padding: 2rem 1rem; }
.empleo-success .success-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }
.empleo-success h4 { font-size: 1.3rem; font-weight: 800; color: var(--color-primary); margin-bottom: 0.5rem; }
.empleo-success p { color: var(--color-muted); font-size: 0.95rem; }
