:root {
  --navy: #0b234a;
  --navy-deep: #061632;
  --navy-soft: #173b70;
  --red: #df1f3f;
  --gold: #b99646;
  --ink: #101d32;
  --muted: #69778d;
  --cloud: #f3f6fa;
  --line: #dbe3ed;
  --white: #fff;
  --shadow: 0 24px 70px rgba(6, 22, 50, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: linear-gradient(180deg, #f8fafc 0, #fff 46%, #eef3f9 100%); font-family: "Manrope", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0,0,0,0); overflow: hidden; white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -70px; left: 16px; z-index: 50; padding: 12px 16px; border-radius: 10px; background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

.topbar { min-height: 88px; padding: 10px max(24px, calc((100vw - 1220px) / 2)); display: flex; align-items: center; gap: 24px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); position: relative; z-index: 5; }
.brand img { width: 118px; height: 68px; object-fit: contain; }
.topbar-copy { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #25a76b; box-shadow: 0 0 0 5px rgba(37,167,107,.12); }
.back-link { padding: 11px 17px; border: 1px solid var(--line); border-radius: 13px; color: var(--navy); font-weight: 800; font-size: 13px; }
.back-link:hover { border-color: var(--navy); }

main { width: min(1220px, calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 520px; padding: 72px 0 56px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(390px, .75fr); align-items: center; gap: 72px; }
.eyebrow { display: inline-block; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.hero h1 { max-width: 760px; margin: 16px 0 24px; color: var(--navy); font: 800 clamp(48px, 6.3vw, 88px)/.93 "Source Serif 4", Georgia, serif; letter-spacing: -.05em; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero-lead { max-width: 690px; margin: 0; color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.7; }
.trust-row { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.trust-row span { padding: 10px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-size: 12px; font-weight: 800; }

.avatar-stage { position: relative; isolation: isolate; width: min(100%, 470px); aspect-ratio: 1; justify-self: end; border-radius: 48% 48% 46% 46%; overflow: hidden; background: #eaf1f9; box-shadow: var(--shadow); border: 8px solid #fff; }
.avatar-stage::after { content: ""; position: absolute; inset: auto -15% -18% -15%; height: 45%; z-index: 1; border-radius: 50%; background: var(--navy); transform: rotate(-5deg); }
.avatar-face-stack { position: absolute; inset: 0; z-index: 1; transform-origin: 50% 76%; animation: avatar-idle 5.4s ease-in-out infinite; }
.avatar-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-frame-speaking { opacity: var(--mouth-open, 0); transition: opacity 55ms linear; }
.avatar-stage.is-speaking .avatar-face-stack { animation: avatar-speaking 1.15s ease-in-out infinite; }
.avatar-stage.is-speaking { box-shadow: 0 24px 70px rgba(11,35,74,.18), 0 0 calc(18px + 26px * var(--voice-energy, 0)) rgba(223,31,63,.15); }
@keyframes avatar-idle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.006); }
}
@keyframes avatar-speaking {
  0%, 100% { transform: translateY(0) rotate(-.12deg) scale(1.003); }
  45% { transform: translateY(-2px) rotate(.12deg) scale(1.009); }
}
.orbit { position: absolute; z-index: 0; border: 1px solid rgba(11,35,74,.14); border-radius: 50%; }
.orbit-one { inset: 10%; }
.orbit-two { inset: 22%; }
.avatar-badge { position: absolute; z-index: 3; left: 28px; right: 28px; bottom: 22px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 16px; color: #fff; background: rgba(6,22,50,.9); backdrop-filter: blur(8px); }
.avatar-badge strong { font-size: 14px; }
.avatar-badge span { color: rgba(255,255,255,.72); font-size: 10px; font-weight: 700; }
.hero-start {
  width: fit-content; min-height: 44px; margin-top: 22px; padding: 11px 16px;
  display: inline-flex; align-items: center; gap: 9px; border-radius: 12px;
  color: #fff; background: var(--red); font-size: 12px; font-weight: 900;
  box-shadow: 0 12px 28px rgba(223,31,63,.2);
}

.assistant-shell { margin: 0 0 38px; min-height: 620px; display: grid; grid-template-columns: 330px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 34px; background: #fff; box-shadow: var(--shadow); }
.topics-panel { padding: 36px 26px; color: #fff; background: radial-gradient(circle at 10% 0, #1c4b8d 0, transparent 38%), var(--navy-deep); }
.panel-heading h2 { margin: 9px 0 26px; font: 800 28px/1.08 "Source Serif 4", Georgia, serif; }
.topic-list { display: grid; gap: 9px; }
.topic-button { width: 100%; padding: 13px 14px; display: grid; grid-template-columns: 38px 1fr 18px; align-items: center; gap: 11px; text-align: left; color: #fff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; cursor: pointer; transition: .2s ease; }
.topic-button:hover, .topic-button:focus-visible, .topic-button.active { background: #fff; color: var(--navy); transform: translateX(3px); outline: none; }
.topic-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(223,31,63,.18); color: #ff6c83; font-size: 19px; }
.topic-button:hover .topic-icon, .topic-button.active .topic-icon { background: #fff0f3; color: var(--red); }
.topic-button strong { display: block; font-size: 13px; }
.topic-button small { display: block; margin-top: 2px; opacity: .68; font-size: 10px; }
.privacy-card { margin-top: 28px; padding: 16px; display: flex; gap: 12px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.privacy-icon { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #0b604e; background: #bff4e7; font-weight: 900; }
.privacy-card strong { font-size: 12px; }
.privacy-card p { margin: 5px 0 0; color: rgba(255,255,255,.65); font-size: 10px; line-height: 1.5; }

.conversation-panel { min-width: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, #fff, #f8fafc); }
.conversation-header { min-height: 112px; padding: 20px 28px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.mini-avatar { width: 58px; height: 58px; overflow: hidden; border-radius: 17px; background: #eaf1f9; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.online-label { color: #1f9b65; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.conversation-header h2 { margin: 3px 0; color: var(--navy); font: 800 22px/1 "Source Serif 4", Georgia, serif; }
.conversation-header p { margin: 0; color: var(--muted); font-size: 11px; }
.reset-button { margin-left: auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.reset-button:hover { color: var(--navy); border-color: var(--navy); }

.messages { min-height: 260px; max-height: 380px; padding: 28px; overflow-y: auto; scrollbar-width: thin; }
.message { margin-bottom: 17px; display: flex; align-items: flex-end; gap: 10px; animation: message-in .25s ease both; }
.message-mark { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--navy); font-size: 9px; font-weight: 900; }
.message-bubble { max-width: min(650px, 84%); padding: 15px 17px; color: var(--ink); background: #eef3f8; border-radius: 18px 18px 18px 5px; font-size: 14px; line-height: 1.6; }
.message-bubble p { margin: 0 0 7px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message.user-message { justify-content: flex-end; }
.user-message .message-bubble { color: #fff; background: var(--navy); border-radius: 18px 18px 5px 18px; }
.response-meta { margin-top: 11px; padding-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid rgba(11,35,74,.12); color: var(--muted); font-size: 12px; line-height: 1.45; }
.media-button { min-height: 44px; padding: 8px 11px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy); font-size: 12px; font-weight: 800; cursor: pointer; }
.answer-review { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; font-weight: 700; }
.answer-media { width: 100%; margin-top: 12px; border-radius: 12px; background: #000; }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } }

.suggestions { min-height: 77px; padding: 0 28px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.suggestion-button { min-height: 44px; padding: 9px 12px; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 800; cursor: pointer; }
.suggestion-button:hover, .suggestion-button:focus-visible { color: #fff; background: var(--navy); outline: none; }
.question-form { margin: auto 28px 14px; padding: 7px; display: grid; grid-template-columns: 1fr auto; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px rgba(6,22,50,.07); }
.question-form:focus-within { border-color: var(--navy-soft); box-shadow: 0 0 0 4px rgba(23,59,112,.08); }
.question-form input { min-width: 0; padding: 11px 12px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.question-form button { padding: 11px 17px; border: 0; border-radius: 11px; color: #fff; background: var(--red); font-size: 12px; font-weight: 900; cursor: pointer; }
.question-form button:hover { background: #bc1531; }
.form-hint { margin: 0 28px 22px; color: var(--muted); font-size: 9px; text-align: center; }

.disclaimer { margin: 0 0 54px; padding: 24px 28px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 18px; border: 1px solid #e8d8ad; border-radius: 20px; background: #fffbef; }
.disclaimer-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--gold); font: 800 20px Georgia, serif; }
.disclaimer h2 { margin: 0 0 5px; color: var(--navy); font-size: 15px; }
.disclaimer p { margin: 0; color: #665c45; font-size: 11px; line-height: 1.55; }
.disclaimer a { padding: 11px 14px; border-radius: 11px; color: #fff; background: var(--navy); font-size: 11px; font-weight: 800; }

footer { padding: 24px 20px; color: rgba(255,255,255,.7); background: var(--navy-deep); text-align: center; font-size: 10px; line-height: 1.7; }
footer p { margin: 0; }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr 340px; gap: 34px; }
  .hero h1 { font-size: clamp(46px, 7vw, 68px); }
  .assistant-shell { grid-template-columns: 270px 1fr; }
}

@media (max-width: 760px) {
  .topbar { min-height: 72px; padding-inline: 18px; }
  .brand img { width: 92px; height: 52px; }
  .topbar-copy { display: none; }
  .back-link { margin-left: auto; }
  main { width: min(100% - 24px, 620px); }
  .hero { min-height: 0; padding: 46px 0 36px; grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .hero h1 { margin-inline: auto; font-size: clamp(43px, 13vw, 66px); }
  .hero-lead { margin-inline: auto; }
  .trust-row { justify-content: center; }
  .hero-start { margin-inline: auto; }
  .avatar-stage { width: min(74vw, 300px); justify-self: center; }
  .avatar-badge { left: 18px; right: 18px; }
  .assistant-shell { grid-template-columns: 1fr; border-radius: 24px; }
  .topics-panel { padding: 26px 20px; }
  .panel-heading h2 { font-size: 24px; }
  .topic-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topic-button { grid-template-columns: 34px 1fr; }
  .topic-button > span:last-child { display: none; }
  .privacy-card { margin-top: 18px; }
  .conversation-header { padding: 17px 18px; }
  .conversation-header p { display: none; }
  .messages { min-height: 240px; max-height: 360px; padding: 20px 16px; }
  .message-bubble { max-width: 89%; }
  .suggestions { padding-inline: 16px; }
  .question-form { margin-inline: 16px; }
  .form-hint { margin-inline: 16px; }
  .disclaimer { grid-template-columns: 42px 1fr; }
  .disclaimer a { grid-column: 1 / -1; text-align: center; }
}

@media (max-width: 470px) {
  .back-link { padding: 9px 11px; font-size: 11px; }
  .hero { padding-top: 36px; }
  .hero h1 { font-size: clamp(39px, 13vw, 56px); }
  .hero-lead { font-size: 15px; }
  .trust-row span { flex: 1 1 42%; }
  .avatar-badge { display: block; text-align: left; }
  .avatar-badge span { display: block; margin-top: 3px; }
  .topic-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topic-button { min-height: 58px; padding: 9px; grid-template-columns: 30px minmax(0,1fr); gap: 8px; }
  .topic-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
  .topic-button strong { font-size: 11px; line-height: 1.25; }
  .topic-button small { display: none; }
  .question-form { grid-template-columns: 1fr; }
  .question-form button { min-height: 44px; }
  .conversation-header h2 { font-size: 19px; }
  .reset-button { padding: 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-face-stack,
  .avatar-stage.is-speaking .avatar-face-stack { animation: none; }
  .avatar-frame-speaking { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Guía corporal animada · contextura oficial aprobada 2026-08-04 */
.avatar-stage {
  --parallax-x: 0px;
  --parallax-y: 0px;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  width: min(100%, 440px);
  aspect-ratio: 4 / 5.15;
  border-radius: 42px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.98) 0 22%, rgba(235,242,250,.92) 54%, rgba(214,226,241,.92) 100%);
  perspective: 1000px;
}
.avatar-stage::after {
  inset: auto -18% -13% -18%;
  height: 31%;
  transform: rotate(-4deg);
}
.stage-depth { position: absolute; inset: 0; pointer-events: none; }
.stage-depth-back {
  background:
    radial-gradient(circle at 18% 18%, rgba(223,31,63,.13), transparent 24%),
    radial-gradient(circle at 84% 74%, rgba(185,150,70,.16), transparent 25%);
  animation: guide-atmosphere 9s ease-in-out infinite alternate;
}
.stage-depth-mid {
  inset: 9%;
  border: 1px solid rgba(11,35,74,.09);
  border-radius: 44% 56% 48% 52%;
  transform: rotate(-7deg);
}
.guide-rig {
  position: absolute;
  z-index: 2;
  inset: 2% 2% 10%;
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 260ms cubic-bezier(.2,.75,.25,1);
}
.guide-frame-stack {
  position: absolute;
  inset: 0;
  transform-origin: 50% 84%;
  animation: guide-breathe 4.8s ease-in-out infinite;
}
.guide-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  filter: drop-shadow(0 20px 18px rgba(6,22,50,.16));
  transition: opacity 120ms linear, filter 180ms ease;
}
.avatar-stage[data-pose="1"] .guide-pose-1,
.avatar-stage[data-pose="2"] .guide-pose-2,
.avatar-stage[data-pose="3"] .guide-pose-3,
.avatar-stage[data-pose="4"] .guide-pose-4 { opacity: 1; }
.avatar-stage:not(.is-speaking)[data-pose="1"] .guide-pose-4 {
  animation: guide-idle-pose 7.4s ease-in-out infinite;
}
.avatar-stage.is-speaking .guide-frame { filter: drop-shadow(0 22px 22px rgba(6,22,50,.19)); }
.avatar-stage.is-speaking .guide-frame-stack { animation: guide-speaking-body 1.1s ease-in-out infinite; }
.voice-indicator {
  position: absolute;
  z-index: 4;
  right: 25px;
  bottom: 83px;
  height: 28px;
  display: flex;
  align-items: end;
  gap: 3px;
  opacity: 0;
  transition: opacity .2s ease;
}
.voice-indicator span {
  width: 3px;
  height: calc(5px + 18px * var(--voice-energy, 0));
  border-radius: 999px;
  background: var(--red);
  animation: guide-voice-bar .72s ease-in-out infinite alternate;
}
.voice-indicator span:nth-child(2) { animation-delay: -.18s; }
.voice-indicator span:nth-child(3) { animation-delay: -.36s; }
.voice-indicator span:nth-child(4) { animation-delay: -.54s; }
.voice-indicator span:nth-child(5) { animation-delay: -.28s; }
.avatar-stage.is-speaking .voice-indicator { opacity: 1; }

@keyframes guide-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.006); }
}
@keyframes guide-speaking-body {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-2px) scale(1.008); }
}
@keyframes guide-idle-pose {
  0%, 43%, 69%, 100% { opacity: 0; }
  49%, 62% { opacity: 1; }
}
@keyframes guide-atmosphere {
  from { opacity: .78; transform: translate3d(-3px, 0, 0) scale(1); }
  to { opacity: 1; transform: translate3d(4px, -3px, 0) scale(1.025); }
}
@keyframes guide-voice-bar {
  from { transform: scaleY(.55); }
  to { transform: scaleY(1.08); }
}

@media (max-width: 760px) {
  .avatar-stage { width: min(82vw, 330px); aspect-ratio: 4 / 5.1; }
  .guide-rig { inset: 2% 0 11%; }
  .voice-indicator { right: 18px; bottom: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-rig,
  .guide-frame-stack,
  .avatar-stage.is-speaking .guide-frame-stack,
  .stage-depth-back,
  .voice-indicator span,
  .avatar-stage:not(.is-speaking)[data-pose="1"] .guide-pose-4 { animation: none; transform: none; }
}

/* Imagen corporativa seleccionada para el acceso “Pregúntele a Luis Fernando”. */
.avatar-stage.assistant-photo-stage {
  width: min(100%, 470px);
  aspect-ratio: 472 / 753;
  border-radius: 42px;
  background: #eaf1f9;
}
.assistant-photo-stage::after,
.assistant-photo-stage .stage-depth,
.assistant-photo-stage .orbit,
.assistant-photo-stage .guide-rig,
.assistant-photo-stage .voice-indicator { display: none; }
.assistant-hero-photo {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 48%;
}
.assistant-photo-stage .avatar-badge { z-index: 4; }

/* La fotografía original permanece intacta; el escudo oficial se integra únicamente
   dentro del marco iluminado de la pared. */
.assistant-office-stage {
  isolation: isolate;
  box-shadow: 0 24px 70px rgba(11,35,74,.18), inset 0 0 0 1px rgba(11,35,74,.08);
}
.assistant-office-stage .assistant-hero-photo {
  object-fit: cover;
  object-position: center;
}
@media (max-width: 760px) {
  .avatar-stage.assistant-photo-stage { width: min(88vw, 360px); }
}

/* Ajuste final 2026-08-05: identidad oficial en la cabecera del asistente. */
.avatar-stage.assistant-logo-stage {
  width: min(100%, 470px);
  aspect-ratio: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 42px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.98) 0 31%, rgba(243,247,252,.96) 74%, rgba(232,239,248,.98) 100%);
  box-shadow: 0 24px 70px rgba(11,35,74,.16), inset 0 0 0 1px rgba(11,35,74,.08);
}
.assistant-logo-stage::after { display: none; }
.assistant-hero-logo {
  position: relative;
  z-index: 2;
  width: min(82%, 370px);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(11,35,74,.14));
}

@media (max-width: 760px) {
  .avatar-stage.assistant-logo-stage { width: min(88vw, 360px); border-radius: 32px; }
  .assistant-hero-logo { width: 80%; }
}
