/* ===========================================
   JFM — Servicios Integrales Empresariales SpA
   Identidad: Patagonia Austral Premium
   =========================================== */

:root {
  --austral-deep: #0F3D2E;
  --austral-dark: #0A2A1F;
  --austral-night: #061712;
  --glacier-gold: #C9A24A;
  --glacier-gold-soft: #E0BE6E;
  --ice: #F4F1EC;
  --fog: #E8E4DC;
  --mist: #D4CFC4;
  --text: #1A1F1C;
  --muted: #5C625E;
  --white: #FFFFFF;
  --max: 1240px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --shadow-sm: 0 4px 14px rgba(10,31,24,.08);
  --shadow-md: 0 12px 40px rgba(10,31,24,.12);
  --shadow-lg: 0 24px 60px rgba(10,31,24,.18);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--ice);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--austral-night);
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); font-weight: 700; }

p { color: var(--text); max-width: 65ch; }

a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }

img { max-width: 100%; display: block; }

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

/* ===== HEADER ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 0;
  background: transparent;
  transition: background .35s var(--ease), padding .35s var(--ease), box-shadow .35s var(--ease);
}
.site-header.scrolled {
  background: rgba(244,241,236,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 0;
  box-shadow: 0 1px 0 rgba(10,31,24,.06);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 48px; width: auto; transition: filter .3s var(--ease); }
.brand-text {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--white);
  transition: color .35s var(--ease);
}
.brand-text small { display: block; font-size: .7rem; font-weight: 500; letter-spacing: .15em; opacity: .8; text-transform: uppercase; }
.site-header.scrolled .brand-text { color: var(--austral-deep); }

.nav { display: flex; align-items: center; gap: 36px; }
.nav a {
  font-weight: 500;
  font-size: .95rem;
  color: var(--white);
  position: relative;
  padding: 6px 0;
  transition: color .25s var(--ease);
}
.site-header.scrolled .nav a { color: var(--austral-deep); }
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--glacier-gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.nav-cta {
  background: var(--glacier-gold);
  color: var(--austral-night) !important;
  padding: 10px 22px !important;
  border-radius: 999px;
  font-weight: 700;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.nav-cta:hover { transform: translateY(-2px); background: var(--glacier-gold-soft); }
.nav-cta::after { display: none; }

.menu-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 26px; height: 2px; background: var(--white); margin: 6px 0; transition: all .3s var(--ease); }
.site-header.scrolled .menu-toggle span { background: var(--austral-deep); }
.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(6px,6px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(6px,-6px); }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  background: var(--austral-night);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.hero-bg video, .hero-bg .hero-fallback {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-fallback {
  background:
    linear-gradient(180deg, rgba(6,23,18,.55) 0%, rgba(10,42,31,.4) 50%, rgba(6,23,18,.7) 100%),
    radial-gradient(ellipse at 30% 20%, rgba(201,162,74,.15), transparent 50%),
    url('../img/oficina.jpg') center/cover no-repeat;
  transition: transform 12s ease-out;
  transform: scale(1.02);
}
.hero:hover .hero-fallback { transform: scale(1.07); }
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,23,18,.55) 0%, rgba(6,23,18,.35) 50%, rgba(6,23,18,.85) 100%);
}

/* Animated mountain silhouette */
.mountains {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  pointer-events: none;
}
.mountains svg { width: 100%; height: auto; display: block; }
.mountain-far { opacity: .35; transform: translateY(0); }
.mountain-near { opacity: .55; }

.hero-content {
  position: relative; z-index: 2;
  width: 100%;
  padding: 140px 0 120px;
}
.eyebrow {
  display: inline-block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--glacier-gold);
  padding: 8px 16px;
  border: 1px solid rgba(201,162,74,.4);
  border-radius: 999px;
  margin-bottom: 28px;
  background: rgba(201,162,74,.08);
}
.hero h1 {
  color: var(--white);
  max-width: 900px;
  margin-bottom: 28px;
}
.hero h1 .accent { color: var(--glacier-gold); font-style: italic; font-weight: 300; }
.hero .lead {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: rgba(244,241,236,.85);
  max-width: 640px;
  margin-bottom: 44px;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  cursor: pointer; border: 0;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-primary { background: var(--glacier-gold); color: var(--austral-night); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(201,162,74,.4); background: var(--glacier-gold-soft); }
.btn-ghost { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
.btn-arrow { transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* Scroll indicator */
.scroll-hint {
  position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(244,241,236,.6); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase;
}
.scroll-hint::after {
  content: ''; width: 1px; height: 40px;
  background: linear-gradient(180deg, rgba(244,241,236,.6), transparent);
  animation: scrollHint 2s var(--ease) infinite;
}
@keyframes scrollHint {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ===== SECTIONS BASE ===== */
section { padding: 120px 0; position: relative; }
.section-label {
  display: inline-block;
  font-size: .8rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--glacier-gold);
  margin-bottom: 16px;
}
.section-head { max-width: 720px; margin-bottom: 64px; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin-top: 16px; }

/* ===== VALOR / PILARES ===== */
.pillars { background: var(--white); }
.pillars-grid {
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.pillar {
  padding: 36px 32px;
  border-radius: 20px;
  background: var(--ice);
  border: 1px solid transparent;
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.pillar:hover {
  transform: translateY(-6px);
  border-color: rgba(201,162,74,.3);
  box-shadow: var(--shadow-md);
}
.pillar-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--austral-deep);
  display: grid; place-items: center;
  margin-bottom: 24px;
  color: var(--glacier-gold);
  transition: transform .4s var(--ease);
}
.pillar:hover .pillar-icon { transform: rotate(-8deg) scale(1.05); }
.pillar h3 { margin-bottom: 12px; }
.pillar p { color: var(--muted); font-size: .95rem; }

/* ===== SERVICIOS ===== */
.services { background: var(--ice); }
.services-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.service-card {
  position: relative;
  background: var(--white);
  border-radius: 22px;
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  cursor: pointer;
  border: 1px solid rgba(15,61,46,.06);
}
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.service-image { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.service-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease);
}
.service-card:hover .service-image img { transform: scale(1.08); }
.service-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(6,23,18,.4) 100%);
}
.service-body { padding: 28px 28px 32px; }
.service-tag {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--glacier-gold);
  margin-bottom: 12px;
}
.service-card h3 { margin-bottom: 12px; }
.service-card p { color: var(--muted); font-size: .94rem; }
.service-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px;
  font-weight: 600; font-size: .9rem;
  color: var(--austral-deep);
}
.service-link::after { content: '→'; transition: transform .25s var(--ease); }
.service-card:hover .service-link::after { transform: translateX(4px); }

/* ===== ISO BADGES ===== */
.iso-strip { background: var(--austral-deep); color: var(--white); padding: 80px 0; }
.iso-strip h2 { color: var(--white); }
.iso-strip .section-label { color: var(--glacier-gold); }
.iso-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 48px;
}
.iso-card {
  text-align: center;
  padding: 36px 24px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(201,162,74,.2);
  border-radius: 18px;
  transition: background .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.iso-card:hover { background: rgba(201,162,74,.08); border-color: var(--glacier-gold); transform: translateY(-4px); }
.iso-number {
  font-family: 'Manrope', sans-serif;
  font-size: 2.2rem; font-weight: 800;
  color: var(--glacier-gold);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.iso-card h4 { color: var(--white); font-size: .95rem; font-weight: 600; }
.iso-card p { color: rgba(244,241,236,.6); font-size: .85rem; margin-top: 8px; }

/* ===== PROCESO ===== */
.process { background: var(--white); }
.process-steps {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 56px;
  position: relative;
}
.step {
  padding: 32px 24px;
  position: relative;
}
.step-num {
  font-family: 'Manrope', sans-serif;
  font-size: 3.2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--glacier-gold) 0%, var(--austral-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 16px;
}
.step h4 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { font-size: .92rem; color: var(--muted); }

/* ===== EQUIPO ===== */
.team { background: var(--ice); }
.team-grid {
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.team-card {
  background: var(--white);
  border-radius: 22px;
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.team-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.team-photo { aspect-ratio: 3/4; overflow: hidden; position: relative; background: var(--fog); }
.team-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  transition: transform .8s var(--ease), filter .5s var(--ease);
  filter: grayscale(.15);
}
.team-card:hover .team-photo img { transform: scale(1.04); filter: grayscale(0); }
.team-body { padding: 28px; }
.team-role {
  font-size: .75rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--glacier-gold);
  margin-bottom: 8px;
}
.team-card h3 { margin-bottom: 12px; text-transform: capitalize; }
.team-card p { font-size: .92rem; color: var(--muted); }
.team-linkedin {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 18px; font-size: .85rem; font-weight: 600;
  color: var(--austral-deep);
}
.team-linkedin svg { width: 18px; height: 18px; }

/* ===== CTA FINAL ===== */
.cta-final {
  background: linear-gradient(135deg, var(--austral-deep) 0%, var(--austral-night) 100%);
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-final::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(201,162,74,.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(201,162,74,.1), transparent 50%);
}
.cta-final .container { position: relative; }
.cta-final h2 { color: var(--white); max-width: 800px; margin: 0 auto 24px; }
.cta-final p { color: rgba(244,241,236,.8); max-width: 600px; margin: 0 auto 40px; }

/* ===== FOOTER ===== */
.footer { background: var(--austral-night); color: rgba(244,241,236,.7); padding: 80px 0 32px; }
.footer-grid {
  display: grid; gap: 48px;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  margin-bottom: 56px;
}
.footer-brand img { height: 56px; margin-bottom: 20px; filter: brightness(0) invert(1); opacity: .9; }
.footer-brand p { font-size: .9rem; max-width: 280px; color: rgba(244,241,236,.7); }
.footer h5 {
  color: var(--white); font-family: 'Manrope', sans-serif;
  font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 20px;
}
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; font-size: .9rem; }
.footer a:hover { color: var(--glacier-gold); }
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background .25s var(--ease);
}
.footer-social a:hover { background: var(--glacier-gold); color: var(--austral-night); }
.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .82rem; color: rgba(244,241,236,.5);
}

/* ===== PAGE HERO (interior) ===== */
.page-hero {
  padding: 180px 0 80px;
  background: linear-gradient(135deg, var(--austral-deep) 0%, var(--austral-night) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(201,162,74,.12), transparent 40%);
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { color: var(--white); max-width: 800px; }
.page-hero .lead { color: rgba(244,241,236,.85); max-width: 640px; margin-top: 20px; font-size: 1.15rem; }

/* ===== PAGE HERO con video de fondo ===== */
.page-hero--video { background: var(--austral-night); }
.page-hero--video::before { display: none; }
.page-hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  /* Difuminado: el video es ambiente, no protagonista */
  filter: blur(10px) brightness(.55) saturate(.85);
  transform: scale(1.06); /* compensa los bordes que deja el blur */
  opacity: .85;
}
.page-hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(11,28,40,.88) 0%, rgba(11,28,40,.74) 50%, rgba(11,28,40,.92) 100%),
    radial-gradient(circle at 80% 20%, rgba(201,162,74,.14), transparent 55%);
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .page-hero__video { display: none; }
}

/* ===== QUIÉNES SOMOS — historia ===== */
.story { background: var(--white); }
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.story-image { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 4/5; }
.story-image img { width: 100%; height: 100%; object-fit: cover; }
.story-text h2 { margin-bottom: 24px; }
.story-text p { margin-bottom: 16px; color: var(--text); }

.values { background: var(--ice); }
.values-grid {
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.value-card {
  padding: 36px 28px;
  background: var(--white); border-radius: 18px;
  border-left: 4px solid var(--glacier-gold);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.value-card h4 { margin-bottom: 12px; color: var(--austral-deep); }
.value-card p { color: var(--muted); font-size: .94rem; }

/* ===== CONTACTO ===== */
.contact { background: var(--white); }
.contact-grid {
  display: grid; gap: 64px;
  grid-template-columns: 1fr 1.3fr;
  align-items: start;
}
.contact-info h2 { margin-bottom: 20px; }
.contact-info > p { color: var(--muted); margin-bottom: 40px; }
.contact-item {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 18px 0; border-top: 1px solid var(--fog);
}
.contact-item:last-child { border-bottom: 1px solid var(--fog); }
.contact-item-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--ice); color: var(--austral-deep);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.contact-item-icon svg { width: 22px; height: 22px; }
.contact-item h5 { font-size: .75rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--glacier-gold); margin-bottom: 4px; }
.contact-item a, .contact-item span { color: var(--text); font-weight: 500; }

.contact-form {
  background: var(--ice);
  padding: 48px;
  border-radius: 24px;
}
.contact-form h3 { margin-bottom: 8px; }
.contact-form > p { font-size: .9rem; color: var(--muted); margin-bottom: 28px; }
.form-row { display: grid; gap: 18px; margin-bottom: 18px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.field label {
  display: block;
  font-size: .8rem; font-weight: 600;
  color: var(--austral-deep);
  margin-bottom: 8px;
  letter-spacing: .02em;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--white);
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-family: inherit; font-size: .95rem;
  color: var(--text);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--glacier-gold);
  box-shadow: 0 0 0 4px rgba(201,162,74,.15);
}
.form-submit { width: 100%; justify-content: center; margin-top: 8px; }

/* ===== REVEAL ANIMATIONS ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  section { padding: 80px 0; }
  .nav { position: fixed; top: 0; right: -100%; bottom: 0;
    width: 80%; max-width: 360px;
    background: var(--white);
    flex-direction: column; align-items: flex-start;
    padding: 100px 32px 32px;
    gap: 8px;
    box-shadow: -20px 0 60px rgba(10,31,24,.2);
    transition: right .4s var(--ease);
  }
  .nav.open { right: 0; }
  .nav a, .site-header.scrolled .nav a { color: var(--austral-deep); font-size: 1.05rem; padding: 12px 0; width: 100%; }
  .nav-cta { margin-top: 16px; }
  .menu-toggle { display: block; }
  .hero-content { padding: 110px 0 80px; }
  .story-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .form-row.two { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .contact-form { padding: 32px 24px; }
  .section-head { margin-bottom: 40px; }
}
@media (max-width: 520px) {
  h1 { font-size: 2.2rem; }
  .hero .lead { font-size: 1rem; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   CHATBOT FLOTANTE — Asistente JFM con IA
   ============================================================ */
#jfm-chat-root { position: fixed; bottom: 24px; right: 24px; z-index: 9999; font-family: 'Inter', system-ui, sans-serif; }

/* Botón flotante */
.jfm-chat-fab {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--glacier-gold) 0%, #B58D2F 100%);
  color: var(--austral-night);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 12px 32px rgba(201,162,74,.4), 0 4px 12px rgba(0,0,0,.15);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.jfm-chat-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 20px 40px rgba(201,162,74,.55); }
.jfm-chat-fab:active { transform: translateY(0) scale(.98); }
.jfm-chat-icon-open { display: none; }
.jfm-chat-fab.open .jfm-chat-icon-closed { display: none; }
.jfm-chat-fab.open .jfm-chat-icon-open { display: block; }
.jfm-chat-fab.open .jfm-chat-pulse { display: none; }

/* Halo pulsante */
.jfm-chat-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  background: var(--glacier-gold);
  opacity: .6;
  animation: jfmPulse 2.4s ease-out infinite;
  z-index: -1;
}
@keyframes jfmPulse {
  0%   { transform: scale(1);   opacity: .6; }
  70%  { transform: scale(1.6); opacity: 0;  }
  100% { transform: scale(1.6); opacity: 0;  }
}

/* Tooltip */
.jfm-chat-tooltip {
  position: absolute;
  bottom: 78px; right: 0;
  background: var(--white);
  color: var(--austral-deep);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(10,31,24,.18);
  opacity: 0;
  transform: translateY(8px) scale(.9);
  pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  cursor: pointer;
}
.jfm-chat-tooltip small { color: var(--muted); font-weight: 400; font-size: .78rem; }
.jfm-chat-tooltip::after {
  content: '';
  position: absolute; bottom: -6px; right: 24px;
  width: 14px; height: 14px;
  background: var(--white);
  transform: rotate(45deg);
}
.jfm-chat-tooltip.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* Panel del chat */
.jfm-chat-panel {
  position: absolute;
  bottom: 80px; right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--white);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(10,31,24,.25);
  display: flex; flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(.95);
  pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  overflow: hidden;
}
.jfm-chat-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* Header */
.jfm-chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--austral-deep) 0%, var(--austral-night) 100%);
  color: var(--white);
}
.jfm-chat-header-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--glacier-gold);
  color: var(--austral-night);
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(201,162,74,.35);
}
.jfm-chat-header-icon img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}
.jfm-chat-header-text { flex: 1; line-height: 1.25; }
.jfm-chat-header-text strong { font-size: .95rem; display: block; }
.jfm-chat-header-text small { font-size: .72rem; opacity: .75; display: flex; align-items: center; gap: 6px; }
.jfm-chat-header-text small::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 8px #4ade80;
}
.jfm-chat-min {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: var(--white);
  border: 0; cursor: pointer;
  font-size: 1.3rem; line-height: 1;
  transition: background .2s var(--ease);
}
.jfm-chat-min:hover { background: rgba(255,255,255,.22); }

/* Mensajes */
.jfm-chat-messages {
  flex: 1; overflow-y: auto;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--ice);
}
.jfm-chat-messages::-webkit-scrollbar { width: 6px; }
.jfm-chat-messages::-webkit-scrollbar-thumb { background: rgba(15,61,46,.25); border-radius: 3px; }

.jfm-msg { display: flex; }
.jfm-msg-user { justify-content: flex-end; }
.jfm-msg-assistant { justify-content: flex-start; }
.jfm-msg-system { justify-content: center; }

.jfm-bubble {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: .92rem;
  line-height: 1.45;
  word-wrap: break-word;
  animation: jfmIn .25s var(--ease);
}
.jfm-msg-user .jfm-bubble {
  background: var(--austral-deep);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.jfm-msg-assistant .jfm-bubble {
  background: var(--white);
  color: var(--text);
  border: 1px solid rgba(15,61,46,.08);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(10,31,24,.04);
}
.jfm-system-text {
  font-size: .82rem;
  color: var(--muted);
  background: rgba(201,162,74,.12);
  border: 1px solid rgba(201,162,74,.3);
  padding: 8px 14px;
  border-radius: 12px;
  max-width: 90%;
  text-align: center;
}
@keyframes jfmIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Typing indicator */
.jfm-typing .jfm-bubble { display: flex; gap: 4px; padding: 14px 16px; }
.jfm-typing .jfm-bubble span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: jfmType 1.2s ease-in-out infinite;
}
.jfm-typing .jfm-bubble span:nth-child(2) { animation-delay: .15s; }
.jfm-typing .jfm-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes jfmType {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* Input */
.jfm-chat-input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px;
  background: var(--white);
  border-top: 1px solid rgba(15,61,46,.08);
}
#jfm-input {
  flex: 1;
  border: 1.5px solid var(--fog);
  border-radius: 18px;
  padding: 10px 14px;
  font-family: inherit; font-size: .92rem;
  color: var(--text);
  resize: none; outline: 0;
  max-height: 120px;
  transition: border-color .2s var(--ease);
}
#jfm-input:focus { border-color: var(--glacier-gold); }
#jfm-send {
  width: 40px; height: 40px;
  background: var(--glacier-gold);
  color: var(--austral-night);
  border: 0; border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
#jfm-send:hover:not(:disabled) { background: var(--glacier-gold-soft); transform: scale(1.05); }
#jfm-send:disabled { opacity: .5; cursor: not-allowed; }

.jfm-chat-footer {
  text-align: center;
  font-size: .68rem;
  color: var(--muted);
  padding: 6px 0 8px;
  background: var(--white);
  border-top: 1px solid rgba(15,61,46,.06);
}

/* Responsive móvil */
@media (max-width: 520px) {
  #jfm-chat-root { bottom: 16px; right: 16px; }
  .jfm-chat-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 96px);
    bottom: 78px;
  }
  .jfm-chat-fab { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .jfm-chat-pulse { animation: none; opacity: 0; }
}
