/* ============================================================
   Dr. Jorge Forero · Psiquiatra Bogotá
   Sistema de diseño: editorial sereno, premium salud
   ============================================================ */

:root {
  --ink: #101935;          /* azul tinta profundo */
  --ink-soft: #46527a;
  --cream: #f7f9fd;        /* fondo claro frío */
  --cream-2: #edf1fa;
  --sage: #0aa6e8;         /* azul eléctrico (logo JF) */
  --sage-dark: #0873c4;
  --gold: #7b5cf0;         /* púrpura eléctrico */
  --white: #ffffff;
  --line: rgba(16, 25, 53, 0.12);

  --font-serif: "Space Grotesk", "Inter", sans-serif;
  --font-sans: "Inter", -apple-system, system-ui, sans-serif;

  --grad: linear-gradient(100deg, #0aa6e8 10%, #7b5cf0 90%);
  --radius: 18px;
  --shadow: 0 18px 50px -18px rgba(26, 49, 120, 0.3);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- utilidades ---------- */
.section__inner { max-width: 1180px; margin: 0 auto; padding: 96px 24px; }
.section__inner--narrow { max-width: 860px; }
.section__head { max-width: 720px; margin-bottom: 56px; }
.section__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 18px 0 20px;
}
.section__title em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.section__title--light { color: var(--cream); }
.section__title--light em {
  background: linear-gradient(100deg, #3fc6ff 10%, #b29bff 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.section__lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 60ch; }
.section__lead--light { color: rgba(250, 247, 241, 0.78); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--sage);
}
.eyebrow--light { color: #9f86ff; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #0aa6e8; flex: none;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(10, 166, 232, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(10, 166, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 166, 232, 0); }
}

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: all 0.25s var(--ease);
}
.btn--lg { padding: 16px 30px; font-size: 1rem; }
.btn--primary { background: var(--grad); color: var(--white); }
.btn--primary:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--sage); color: var(--sage); transform: translateY(-2px); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247, 249, 253, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 32px;
}
.nav__brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.nav__brand img { height: 44px; width: 38px; object-fit: cover; object-position: left center; }
.nav__wordmark {
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; line-height: 1.1;
  display: grid;
}
.nav__wordmark small {
  font-family: var(--font-sans); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a {
  text-decoration: none; font-size: 0.92rem; font-weight: 500; color: var(--ink-soft);
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--sage); }
.nav__cta { flex: none; }
.nav__burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: 0.3s; }
.nav__mobile { display: none; }

/* ---------- hero ---------- */
.hero { overflow: hidden; }
.hero__inner {
  max-width: 1180px; margin: 0 auto; padding: 72px 24px 80px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}
.hero__title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.05; letter-spacing: -0.015em;
  margin: 20px 0 22px;
}
.hero__title em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 56ch; margin-bottom: 30px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero__badges {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  border-top: 1px solid var(--line); padding-top: 26px;
}
.hero__badges strong {
  display: block; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; color: var(--sage);
}
.hero__badges span { font-size: 0.8rem; color: var(--ink-soft); }
.hero__media { position: relative; }
.hero__media img {
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; height: 480px; object-fit: cover; object-position: 70% 20%;
}
.hero__card {
  position: absolute; left: 20px; bottom: 20px; right: 20px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border-radius: 14px; padding: 14px 18px; font-size: 0.88rem; color: var(--ink-soft);
  box-shadow: 0 8px 30px -10px rgba(26, 49, 120, 0.3);
}
.hero__card strong { color: var(--ink); }
.hero__card-dot { width: 9px; height: 9px; border-radius: 50%; background: #0aa6e8; flex: none; animation: pulse 2s infinite; }

/* ---------- strip ---------- */
.strip { background: var(--ink); color: rgba(250, 247, 241, 0.75); }
.strip__inner {
  max-width: 1180px; margin: 0 auto; padding: 18px 24px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px;
  font-size: 0.82rem; letter-spacing: 0.04em;
}

/* ---------- servicios ---------- */
.services { background: var(--cream); }
.services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card h3 { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; }
.card p { font-size: 0.95rem; color: var(--ink-soft); flex: 1; }
.card__link {
  background: none; border: 0; cursor: pointer; text-align: left; padding: 0;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.92rem; color: var(--sage);
}
.card__link:hover { color: var(--sage-dark); text-decoration: underline; }
.card--accent { background: linear-gradient(135deg, #0873c4 0%, #6242d8 100%); border-color: transparent; color: var(--white); }
.card--accent p { color: rgba(255, 255, 255, 0.88); }
.card--accent .card__link { color: #aef0ff; }

.crisis {
  margin-top: 40px; background: var(--cream-2); border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 26px;
  font-size: 0.93rem; color: var(--ink-soft);
}
.crisis strong { color: var(--ink); }

/* ---------- sobre ---------- */
.about { background: var(--white); }
.about__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
.about__media { position: sticky; top: 110px; }
.about__media img { border-radius: var(--radius); height: 360px; width: 100%; object-fit: cover; object-position: 70% 20%; box-shadow: var(--shadow); }
.about__quote {
  margin-top: 24px; font-family: var(--font-serif); font-weight: 500;
  font-size: 1.25rem; line-height: 1.5; color: var(--sage-dark);
}
.about__quote cite { display: block; margin-top: 12px; font-family: var(--font-sans); font-style: normal; font-size: 0.85rem; color: var(--ink-soft); }
.about__timeline { list-style: none; margin-top: 36px; display: grid; gap: 0; }
.about__timeline li {
  position: relative; padding: 18px 0 18px 30px; border-left: 2px solid var(--line);
  font-size: 0.98rem; color: var(--ink-soft);
}
.about__timeline li::before {
  content: ""; position: absolute; left: -6px; top: 26px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--gold);
}
.about__timeline strong { color: var(--ink); }

/* ---------- publicaciones ---------- */
.books { background: var(--cream-2); }
.books__row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 36px;
}
.books__row img {
  border-radius: 12px; box-shadow: 0 10px 28px -12px rgba(26, 49, 120, 0.35);
  transition: transform 0.3s var(--ease);
}
.books__row img:hover { transform: translateY(-6px) scale(1.02); }
.books__media { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- EMA chatbot ---------- */
.ema { background: linear-gradient(160deg, #101935 0%, #1d2a6b 55%, #3a1f8a 100%); }
.ema__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.ema__trust { list-style: none; margin-top: 28px; display: grid; gap: 12px; }
.ema__trust li {
  position: relative; padding-left: 28px; color: rgba(250, 247, 241, 0.85); font-size: 0.95rem;
}
.ema__trust li::before {
  content: "✓"; position: absolute; left: 0; color: #3fc6ff; font-weight: 700;
}
.ema__powered { margin-top: 14px; text-align: center; font-size: 0.78rem; color: rgba(250, 247, 241, 0.5); }
.ema__powered a { color: #9f86ff; text-decoration: none; }
.ema__powered a:hover { text-decoration: underline; }

.chat {
  background: var(--cream); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; min-height: 520px;
}
.chat__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--white); border-bottom: 1px solid var(--line);
}
.chat__status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; color: var(--sage);
}
.chat__status-dot { width: 8px; height: 8px; border-radius: 50%; background: #0aa6e8; animation: pulse 2s infinite; }
.chat__bar-meta { font-size: 0.75rem; color: var(--ink-soft); letter-spacing: 0.06em; }
.chat__messages {
  flex: 1; padding: 22px 18px; display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; max-height: 380px;
}
.chat__msg {
  max-width: 85%; padding: 12px 16px; border-radius: 16px;
  font-size: 0.93rem; line-height: 1.5; animation: msgIn 0.4s var(--ease);
}
.chat__msg--agent { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat__msg--user { background: var(--sage); color: var(--white); border-bottom-right-radius: 4px; align-self: flex-end; }
.chat__msg--typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 18px; }
.chat__msg--typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); opacity: 0.4;
  animation: blink 1.2s infinite;
}
.chat__msg--typing i:nth-child(2) { animation-delay: 0.2s; }
.chat__msg--typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.chat__options { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.chat__option {
  background: var(--white); border: 1.5px solid var(--sage); color: var(--sage);
  border-radius: 999px; padding: 9px 16px; font-family: var(--font-sans);
  font-size: 0.87rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
  animation: msgIn 0.4s var(--ease);
}
.chat__option:hover { background: var(--sage); color: var(--white); }

.chat__booking { padding: 0 18px 16px; display: grid; gap: 8px; justify-items: center; }
.chat__booking[hidden] { display: none; }
.chat__booking .btn { width: 100%; }
.chat__booking-note { font-size: 0.78rem; color: var(--ink-soft); }

.chat__composer {
  display: flex; gap: 10px; padding: 14px 18px; background: var(--white);
  border-top: 1px solid var(--line);
}
.chat__input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px;
  font-family: var(--font-sans); font-size: 0.93rem; background: var(--cream);
  color: var(--ink); outline: none; transition: border-color 0.2s;
}
.chat__input:focus { border-color: var(--sage); }
.chat__send {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sage);
  color: var(--white); cursor: pointer; display: grid; place-items: center;
  transition: background 0.2s, transform 0.2s;
}
.chat__send:hover { background: var(--sage-dark); transform: scale(1.06); }

/* ---------- FAQ ---------- */
.faq { background: var(--white); }
.faq__item {
  border-bottom: 1px solid var(--line); padding: 6px 0;
}
.faq__item summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; padding: 20px 0;
  font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; font-family: var(--font-sans); font-size: 1.5rem; font-weight: 400;
  color: var(--sage); transition: transform 0.3s var(--ease); flex: none;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { padding: 0 0 22px; color: var(--ink-soft); max-width: 65ch; }
.faq__cta { margin-top: 44px; text-align: center; }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: rgba(250, 247, 241, 0.75); }
.footer__grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr 1fr; gap: 48px;
  padding-top: 72px; padding-bottom: 48px;
}
.footer__brand img { height: 56px; width: auto; margin-bottom: 18px; }
.footer__brand p { font-size: 0.9rem; }
.footer__links, .footer__contact { display: grid; gap: 12px; align-content: start; }
.footer__links a, .footer__contact a {
  text-decoration: none; font-size: 0.92rem; transition: color 0.2s;
}
.footer__links a:hover, .footer__contact a:hover { color: #3fc6ff; }
.footer__legal {
  border-top: 1px solid rgba(250, 247, 241, 0.12);
  padding: 22px 24px; text-align: center; font-size: 0.78rem;
  color: rgba(250, 247, 241, 0.5);
}

/* ---------- botón flotante ---------- */
.float-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--grad); color: var(--white); border: 0; cursor: pointer;
  border-radius: 999px; padding: 14px 22px; font-family: var(--font-sans);
  font-weight: 700; font-size: 0.92rem;
  box-shadow: 0 14px 40px -10px rgba(26, 49, 120, 0.55);
  transition: transform 0.25s var(--ease), filter 0.25s;
}
.float-btn:hover { filter: brightness(1.08); transform: translateY(-3px); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; margin-left: auto; }
  .nav__mobile {
    display: grid; gap: 6px; padding: 12px 24px 24px;
    border-top: 1px solid var(--line); background: var(--cream);
  }
  .nav__mobile[hidden] { display: none; }
  .nav__mobile a { text-decoration: none; padding: 12px 0; font-weight: 600; }
  .nav__mobile .btn { margin-top: 8px; }
  .hero__inner { grid-template-columns: 1fr; padding-top: 48px; }
  .hero__media img { height: 380px; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .about__media { position: static; }
  .books__row { grid-template-columns: repeat(3, 1fr); }
  .ema__grid { grid-template-columns: 1fr; gap: 44px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .section__inner { padding: 64px 20px; }
  .hero__badges { grid-template-columns: repeat(2, 1fr); }
  .services__grid { grid-template-columns: 1fr; }
  .books__row { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .float-btn span { display: none; }
  .float-btn { padding: 16px; }
}
