/* ============================================
   MAYORAZGO GPT — Styles
   Fuente: Montserrat
   Colores: #4EB1B6 (teal), #444444 (gris), #FFFFFF
   ============================================ */

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

:root {
  --teal:          #4a8fb5;
  --teal-dark:     #3a7a9e;
  --teal-vibrant:  #2cb5c0;
  --teal-light:    #eaf3f8;
  --navy:          #1a2f44;
  --gray-text:     #444444;
  --gray-light:    #888888;
  --gray-border:   #e4e8ea;
  --gray-bg:       #f7f9fa;
  --warm-bg:       #f5f2ef;
  --white:         #ffffff;
  --green-wa:      #25D366;
  --red-hang:      #ef4444;
  --red-hang-dark: #dc2626;

  --font:          'Montserrat', sans-serif;
  --font-display:  'DM Serif Display', serif;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:     0 2px 12px rgba(0,0,0,0.09);
  --shadow-lg:     0 6px 24px rgba(0,0,0,0.11);

  --header-h:      64px;
  --content-max:   760px;
}

html {
  height: 100%;
  height: 100dvh;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  color: var(--gray-text);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(91, 180, 240, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(28, 123, 190, 0.12) 0%, transparent 65%),
    linear-gradient(180deg, #F4F9FE 0%, #FAFAF8 100%);
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   INTRO ANIMATION
   ============================================ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #87CEEB;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.intro video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-skip {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 7px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.intro-skip:hover {
  background: rgba(255, 255, 255, 0.28);
}

.intro--fade-out {
  opacity: 0;
  pointer-events: none;
}

/* App elements — hidden until intro ends */
.app--hidden {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.app--hidden.app--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance for page elements */
.header.app--hidden.app--visible {
  transition-delay: 0s;
}

.main-content.app--hidden.app--visible {
  transition-delay: 0.1s;
}

/* Phase 2: Logo dramatic reveal */
.intro-logo-target {
  opacity: 0;
  transform: scale(0.85);
}

.intro-logo-target.logo--revealed {
  animation: logoReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logoReveal {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   HEADER (unified with tabs)
   ============================================ */
.header {
  flex-shrink: 0;
  height: var(--header-h);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(91, 180, 240, 0.28);
  z-index: 10;
  position: sticky;
  top: 0;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.header-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.header-tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: none;
  border: none;
  border-radius: 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-light);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.2s;
  user-select: none;
  position: relative;
}

.tab-btn:hover {
  color: #1C7BBE;
  background: rgba(91, 180, 240, 0.10);
}

.tab-btn.active {
  color: var(--white);
  background: linear-gradient(135deg, #1C7BBE 0%, #5BB4F0 100%);
  box-shadow: 0 4px 12px rgba(28, 123, 190, 0.25);
}

/* Voice tab — "live" pulse dot */
.tab-btn__live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  position: relative;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: live-pulse 2s ease-out infinite;
  margin-left: 2px;
}

.tab-btn.active .tab-btn__live-dot {
  background: #FFFFFF;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0);   }
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1C7BBE 0%, #5BB4F0 100%);
  color: var(--white);
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(28, 123, 190, 0.25);
}

.btn-whatsapp:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(28, 123, 190, 0.32);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ============================================
   PANELS
   ============================================ */
.panel {
  display: none;
  flex: 1;
  overflow: hidden;
}

.panel.active {
  display: flex;
  flex-direction: column;
}

/* ============================================
   CHAT LAYOUT
   ============================================ */
.chat-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ============================================
   CHAT EMPTY STATE
   ============================================ */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 36px;
  background: transparent;
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: relative;
  overflow: hidden;
}

/* Video background */
.chat-empty__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

.chat-empty.exit-anim {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.chat-empty__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Brand logo — HTML/CSS */
.brand-logo-img {
  max-width: 280px;
  height: auto;
  animation: breathe 3s ease-in-out infinite;
}

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

/* Greeting */
.chat-empty__greeting {
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 8px;
  letter-spacing: -0.01em;
}

.chat-empty__subtitle {
  font-size: 15px;
  color: var(--gray-text);
  max-width: 420px;
  line-height: 1.55;
  min-height: 23px;
  letter-spacing: 0.01em;
}

/* Typewriter cursor */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--teal);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Voice nudge — invites users to try the voice assistant */
.chat-voice-nudge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(91, 180, 240, 0.35);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: #1C7BBE;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  z-index: 2;
}

.chat-voice-nudge:hover {
  background: linear-gradient(135deg, rgba(28, 123, 190, 0.08) 0%, rgba(91, 180, 240, 0.12) 100%);
  border-color: rgba(28, 123, 190, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(28, 123, 190, 0.15);
}

.chat-voice-nudge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: live-pulse 2s ease-out infinite;
  flex-shrink: 0;
}

/* FAQ Grid — 2x2 */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 540px;
  position: relative;
  z-index: 1;
}

.faq-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  text-align: left;
  font-size: 13px;
  border: 1px solid rgba(91, 180, 240, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    background 0.3s ease;
  color: var(--gray-text);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(28, 123, 190, 0.04);
}

.faq-card:hover {
  border-color: rgba(28, 123, 190, 0.4);
  transform: translateY(-3px);
  box-shadow:
    0 8px 20px rgba(28, 123, 190, 0.10),
    0 2px 6px rgba(28, 123, 190, 0.06);
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(91, 180, 240, 0.05) 100%);
}

.faq-card__icon {
  flex-shrink: 0;
  color: var(--teal);
  margin-top: 1px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.faq-card:hover .faq-card__icon {
  color: #1C7BBE;
  transform: scale(1.08);
}

.faq-card__text {
  flex: 1;
}

/* ============================================
   MESSAGES AREA
   ============================================ */
.messages-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

/* ============================================
   MESSAGES — Row style (Figma design)
   ============================================ */
.message {
  width: 100%;
  padding: 20px 24px;
  animation: msgIn 0.2s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message--user {
  background: rgba(91, 180, 240, 0.10);
}

.message--ai {
  background: var(--white);
}

.message__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.message__avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.message--user .message__avatar {
  background: #2d3748;
  color: var(--white);
}

.message--ai .message__avatar {
  background: var(--teal-light);
  overflow: hidden;
}

.message--ai .message__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.message__body {
  flex: 1;
  min-width: 0;
}

.message__role {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-text);
  margin-bottom: 6px;
}

.message__text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-text);
}

.message__text p + p {
  margin-top: 8px;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--gray-light);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

.typing-status {
  font-size: 0.8rem;
  color: var(--gray-light);
  margin-top: 6px;
  min-height: 1.2em;
}

/* ============================================
   PROMPT BOX — ChatGPT-style input
   ============================================ */
.prompt-box-wrapper {
  padding: 14px 24px 16px;
  background: var(--white);
}

@property --prompt-gradient-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.prompt-box {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: var(--white);
  padding: 8px;
  position: relative;
  cursor: text;
  filter: drop-shadow(0 0 10px rgba(91, 180, 240, 0.18));
}

/* Flowing gradient border — Mayorazgo blue + celeste */
.prompt-box::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 30px;
  padding: 2px;
  background: conic-gradient(
    from var(--prompt-gradient-angle),
    #1C7BBE,
    #5BB4F0,
    #7DD3FC,
    #5BB4F0,
    #1C7BBE,
    #5BB4F0,
    #1C7BBE
  );
  -webkit-mask:
    linear-gradient(#000, #000) content-box,
    linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: prompt-flow 10s linear infinite;
  pointer-events: none;
}

/* Traveling light — subtle dot drifting along the input border */
.prompt-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(125, 211, 252, 0.55) 30%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(125, 211, 252, 0.55) 70%,
    transparent 100%
  );
  filter: blur(1.5px) drop-shadow(0 0 5px rgba(91, 180, 240, 0.75)) drop-shadow(0 0 10px rgba(28, 123, 190, 0.55));
  offset-path: rect(-3px calc(100% + 3px) calc(100% + 3px) -3px round 30px);
  offset-distance: 0%;
  offset-rotate: auto;
  animation: prompt-travel 8s linear infinite;
  pointer-events: none;
}

@keyframes prompt-flow {
  to { --prompt-gradient-angle: 360deg; }
}

@keyframes prompt-travel {
  to { offset-distance: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-box::before,
  .prompt-box::after {
    animation: none;
  }
}

/* Fallback: when @property is not supported, gradient is static */
@supports not (background: conic-gradient(from var(--x))) {
  .prompt-box::before {
    background: linear-gradient(135deg, #1C7BBE, #5BB4F0, #1C7BBE);
  }
}

/* File preview */
.prompt-preview {
  position: relative;
  margin: 8px 8px 0;
  padding: 8px 32px 8px 10px;
  background: rgba(44, 181, 192, 0.08);
  border: 1px solid rgba(44, 181, 192, 0.2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prompt-preview-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.prompt-preview-file__icon {
  flex-shrink: 0;
  color: var(--teal);
}

.prompt-preview-file__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.prompt-preview-file__size {
  font-size: 11px;
  color: var(--gray-light);
  flex-shrink: 0;
}

.prompt-preview-disclaimer {
  font-size: 11px;
  color: var(--gray-light);
  margin: 0;
  line-height: 1.3;
  padding-left: 28px;
}

.prompt-preview-remove {
  position: absolute;
  top: 8px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--gray-text);
}

.prompt-preview-remove:hover {
  background: rgba(255,255,255,0.85);
}

/* Textarea */
.prompt-textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-text);
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}

.prompt-textarea::placeholder {
  color: #bbbec2;
}

/* Toolbar */
.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 0;
}

.prompt-toolbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tool buttons (generic) */
.prompt-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gray-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.prompt-tool-btn:hover {
  background: var(--teal-light);
  color: var(--teal);
}

/* Tools toggle (has label) */
.prompt-tools-toggle {
  width: auto;
  padding: 0 10px;
  gap: 6px;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 13px;
}

.prompt-tools-label {
  color: inherit;
  font-weight: 500;
}

/* Tools dropdown */
.prompt-tools-dropdown {
  position: relative;
}

.prompt-tools-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 220px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  animation: menuIn 0.15s ease-out;
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.prompt-tools-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-text);
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}

.prompt-tools-item:hover {
  background: var(--teal-light);
  color: var(--teal);
}

/* Active tool chip */
.prompt-active-tool {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-tool-divider {
  width: 1px;
  height: 16px;
  background: var(--gray-border);
}

.prompt-active-tool-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  border: none;
  background: var(--teal-light);
  color: var(--teal);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.prompt-active-tool-chip:hover {
  background: #d5e8f2;
}

/* Send button */
.prompt-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: var(--white);
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}

.prompt-send-btn:hover:not(:disabled) {
  background: var(--teal-dark);
  transform: scale(1.07);
}

.prompt-send-btn:disabled {
  background: var(--gray-border);
  color: #bbbec2;
  cursor: default;
}

/* Trust footer */
.prompt-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #b0b5b9;
  margin-top: 8px;
  letter-spacing: 0.1px;
}

/* ============================================
   VOICE LAYOUT — VS Orb-style (Mayorazgo palette)
   ============================================ */
.voice-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 30% 20%, rgba(125, 211, 252, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 75% 80%, rgba(91, 180, 240, 0.15) 0%, transparent 65%),
    linear-gradient(180deg, #F4F9FE 0%, #FAFAF8 100%);
}

/* Background blobs */
.voice-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}

.voice-blob--1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: -80px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.45) 0%, transparent 70%);
  animation: blob-drift-1 18s ease-in-out infinite;
}

.voice-blob--2 {
  width: 460px;
  height: 460px;
  bottom: -80px;
  right: -80px;
  background: radial-gradient(circle, rgba(91, 180, 240, 0.4) 0%, transparent 70%);
  animation: blob-drift-2 22s ease-in-out infinite;
}

@keyframes blob-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, 30px) scale(1.08); }
}

@keyframes blob-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-30px, -40px) scale(1.06); }
}

/* Ambient particles */
.voice-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.voice-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--teal);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s infinite ease-in-out;
}

.voice-particle:nth-child(1)  { left: 10%; top: 20%; animation-delay: 0s;    animation-duration: 7s;  }
.voice-particle:nth-child(2)  { left: 25%; top: 60%; animation-delay: 1s;    animation-duration: 9s;  }
.voice-particle:nth-child(3)  { left: 45%; top: 15%; animation-delay: 2s;    animation-duration: 6s;  }
.voice-particle:nth-child(4)  { left: 70%; top: 40%; animation-delay: 0.5s;  animation-duration: 8s;  }
.voice-particle:nth-child(5)  { left: 85%; top: 70%; animation-delay: 3s;    animation-duration: 10s; }
.voice-particle:nth-child(6)  { left: 55%; top: 80%; animation-delay: 1.5s;  animation-duration: 7s;  }
.voice-particle:nth-child(7)  { left: 15%; top: 75%; animation-delay: 4s;    animation-duration: 9s;  }
.voice-particle:nth-child(8)  { left: 90%; top: 15%; animation-delay: 2.5s;  animation-duration: 6s;  }
.voice-particle:nth-child(9)  { left: 35%; top: 45%; animation-delay: 3.5s;  animation-duration: 11s; }
.voice-particle:nth-child(10) { left: 60%; top: 25%; animation-delay: 0.8s;  animation-duration: 8s;  }
.voice-particle:nth-child(11) { left: 80%; top: 55%; animation-delay: 5s;    animation-duration: 7s;  }
.voice-particle:nth-child(12) { left: 5%;  top: 45%; animation-delay: 2.2s;  animation-duration: 9s;  }

@keyframes particleFloat {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(1);
  }
  20% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.15;
    transform: translateY(-30px) scale(1.3);
  }
  80% {
    opacity: 0.1;
  }
}

/* Background glow */
.voice-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 460px;
  height: 460px;
  transform: translate(-50%, -55%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 123, 190, 0.18) 0%, rgba(91, 180, 240, 0.08) 40%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 5s ease-in-out infinite;
  z-index: 0;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -55%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -55%) scale(1.12); }
}

/* Voice hero */
.voice-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 18px;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ============================================
   VOICE ORB — VS-inspired Mayorazgo edition
   ============================================ */
.voice-orb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 240px;
  height: 240px;
  margin-bottom: 8px;
}

.call-btn {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: none;
  background: #0E5C8E;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  padding: 0;
  min-width: auto;
  overflow: hidden;
  clip-path: circle(50%);
  -webkit-clip-path: circle(50%);
  box-shadow:
    inset 0 0 70px rgba(14, 92, 142, 0.45),
    0 14px 44px rgba(28, 123, 190, 0.35),
    0 4px 14px rgba(28, 123, 190, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  isolation: isolate;
  will-change: transform;
}

.call-btn:hover {
  transform: scale(1.03);
  box-shadow:
    inset 0 0 70px rgba(14, 92, 142, 0.45),
    0 18px 56px rgba(28, 123, 190, 0.45),
    0 6px 18px rgba(28, 123, 190, 0.22);
}

/* Mesh layer 1 — slow clockwise */
.call-btn::before {
  content: '';
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(circle at 28% 30%, #7DD3FC 0%, transparent 38%),
    radial-gradient(circle at 75% 72%, #3B9AD8 0%, transparent 42%);
  animation: mesh-orbit-1 14s linear infinite;
  z-index: 1;
}

/* Mesh layer 2 — slow counter-clockwise + slight scale */
.call-btn::after {
  content: '';
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(circle at 65% 28%, #5BB4F0 0%, transparent 40%),
    radial-gradient(circle at 30% 75%, #1C7BBE 0%, transparent 45%);
  animation: mesh-orbit-2 18s linear infinite;
  mix-blend-mode: screen;
  z-index: 1;
}

@keyframes mesh-orbit-1 {
  to { transform: rotate(360deg); }
}

@keyframes mesh-orbit-2 {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(-180deg) scale(1.08); }
  100% { transform: rotate(-360deg) scale(1); }
}

/* Top-left highlight (glassy reflection) */
.call-btn__highlight {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
  z-index: 2;
}

/* Glass center button */
.call-btn__core {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 8px 20px rgba(14, 92, 142, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  z-index: 3;
  transition: transform 0.3s ease, background 0.3s ease;
}

.call-btn:hover .call-btn__core {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

/* Icon visibility logic */
.voice-orb__icon {
  color: var(--white);
  transition: opacity 0.25s, transform 0.25s;
}
.voice-orb__spinner { position: absolute; opacity: 0; }
.voice-orb__mic { opacity: 1; }

/* Idle state */
.call-btn--idle .voice-orb__mic { opacity: 1; }
.call-btn--idle .voice-orb__spinner { opacity: 0; }

/* Calling/connecting state */
.call-btn--calling { cursor: default; }
.call-btn--calling .voice-orb__mic { opacity: 0; }
.call-btn--calling .voice-orb__spinner {
  opacity: 1;
  animation: spinOrb 1s linear infinite;
}

/* Active call: speed up the mesh swirl */
.voice-orb.is-calling .call-btn::before {
  animation-duration: 5s;
}
.voice-orb.is-calling .call-btn::after {
  animation-duration: 7s;
}

@keyframes spinOrb {
  to { transform: rotate(360deg); }
}

.call-btn--active .voice-orb__mic { opacity: 1; }
.call-btn--active .voice-orb__spinner { opacity: 0; }

/* Pulse rings — continuous orbits (slow idle, fast active) */
.voice-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(91, 180, 240, 0.55);
  pointer-events: none;
  opacity: 0;
  animation: pulseRing 3.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.voice-pulse--delay {
  animation-delay: 1.2s;
}

.voice-pulse--delay2 {
  animation-delay: 2.4s;
}

/* When in call: faster + brighter cyan */
.voice-orb.is-calling .voice-pulse {
  animation-duration: 1.8s;
  border-color: rgba(125, 211, 252, 0.75);
}

.voice-orb.is-calling .voice-pulse--delay {
  animation-delay: 0.6s;
}

.voice-orb.is-calling .voice-pulse--delay2 {
  animation-delay: 1.2s;
}

@keyframes pulseRing {
  0%       { transform: scale(1);    opacity: 0.55; }
  90%, 100% { transform: scale(1.55); opacity: 0; }
}

/* Status text */
.voice-status-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--teal);
  min-height: 22px;
  transition: color 0.3s;
  animation: statusPulse 2.5s ease-in-out infinite;
}

.voice-status-text:empty {
  animation: none;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.voice-status-label {
  font-size: 13px;
  color: var(--gray-light);
  font-weight: 400;
}

/* AI badge */
.voice-ai-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-light);
  margin-top: 4px;
  animation: badgeFade 3.5s ease-in-out infinite;
}

.voice-ai-badge svg {
  color: var(--teal);
}

@keyframes badgeFade {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* Helper text — short instruction below the orb */
.voice-helper-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-text);
  text-align: center;
  max-width: 440px;
  margin: 4px auto 0;
  padding: 0 16px;
}

/* Features */
.voice-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  max-width: 340px;
  width: 100%;
}

.voice-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-text);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--gray-border);
}

.voice-feature svg {
  color: var(--teal);
  flex-shrink: 0;
}

/* ============================================
   WAVEFORM — Siri-style bars
   ============================================ */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  width: 100%;
  max-width: 320px;
}

.bar {
  flex: 1;
  max-width: 6px;
  border-radius: 3px;
  background: var(--teal);
  height: 6px;
  animation: waveBar 1s infinite ease-in-out;
}

/* Stagger animation across all 23 bars — symmetric from center */
.bar:nth-child(1)  { animation-delay: 0.0s;  }
.bar:nth-child(2)  { animation-delay: 0.06s; }
.bar:nth-child(3)  { animation-delay: 0.12s; }
.bar:nth-child(4)  { animation-delay: 0.18s; }
.bar:nth-child(5)  { animation-delay: 0.24s; }
.bar:nth-child(6)  { animation-delay: 0.30s; }
.bar:nth-child(7)  { animation-delay: 0.36s; }
.bar:nth-child(8)  { animation-delay: 0.42s; }
.bar:nth-child(9)  { animation-delay: 0.48s; }
.bar:nth-child(10) { animation-delay: 0.52s; }
.bar:nth-child(11) { animation-delay: 0.56s; }
.bar:nth-child(12) { animation-delay: 0.58s; }
.bar:nth-child(13) { animation-delay: 0.56s; }
.bar:nth-child(14) { animation-delay: 0.52s; }
.bar:nth-child(15) { animation-delay: 0.48s; }
.bar:nth-child(16) { animation-delay: 0.42s; }
.bar:nth-child(17) { animation-delay: 0.36s; }
.bar:nth-child(18) { animation-delay: 0.30s; }
.bar:nth-child(19) { animation-delay: 0.24s; }
.bar:nth-child(20) { animation-delay: 0.18s; }
.bar:nth-child(21) { animation-delay: 0.12s; }
.bar:nth-child(22) { animation-delay: 0.06s; }
.bar:nth-child(23) { animation-delay: 0.0s;  }

@keyframes waveBar {
  0%, 100% { height: 6px;  opacity: 0.35; }
  50%      { height: 40px; opacity: 1;    }
}

.waveform.agent-talking .bar {
  animation-duration: 0.5s;
  background: var(--teal);
}

.waveform.user-talking .bar {
  animation-duration: 0.75s;
  background: var(--navy);
}

.waveform.is-live .bar {
  animation: none;
  transition: height 0.06s ease-out, opacity 0.06s ease-out;
}

/* ============================================
   TRANSCRIPT
   ============================================ */
.transcript-box {
  width: 100%;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
  text-align: left;
}

.transcript-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--gray-bg);
  border-bottom: 1px solid var(--gray-border);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transcript-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: dotPulse 1.2s infinite;
  flex-shrink: 0;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.transcript-messages {
  max-height: 180px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.transcript-msg {
  display: flex;
  gap: 6px;
}

.transcript-msg__role {
  font-weight: 700;
  flex-shrink: 0;
  font-size: 12px;
}

.transcript-msg--agent .transcript-msg__role { color: var(--teal); }
.transcript-msg--user  .transcript-msg__role { color: var(--gray-text); }

.transcript-msg__text { color: var(--gray-text); }

.hidden { display: none !important; }

/* ============================================
   SCROLLBAR
   ============================================ */
.messages-area::-webkit-scrollbar {
  width: 5px;
}
.messages-area::-webkit-scrollbar-track {
  background: transparent;
}
.messages-area::-webkit-scrollbar-thumb {
  background: var(--gray-border);
  border-radius: 3px;
}
.messages-area::-webkit-scrollbar-thumb:hover {
  background: #c8cdd0;
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 600px) {
  .intro video {
    object-fit: cover;
  }
  .header-inner {
    padding: 0 12px;
    gap: 8px;
  }
  .header-logo {
    height: 40px;
  }
  /* Compact contact button on mobile */
  .btn-whatsapp {
    padding: 7px 13px;
    font-size: 13px;
    flex-shrink: 0;
    gap: 5px;
  }
  .btn-whatsapp svg {
    display: block;
    width: 14px;
    height: 14px;
  }
  /* Tighter header padding to give room to Contactanos */
  .header-tabs {
    gap: 2px;
  }
  .tab-btn {
    padding: 6px 12px;
  }
  .tab-btn {
    padding: 5px 12px;
    font-size: 12px;
  }
  .tab-btn svg {
    display: none;
  }
  .brand-logo-img {
    max-width: 200px;
  }
  /* Hide voice nudge on mobile — Voz tab is already visible in header */
  .chat-voice-nudge {
    display: none;
  }
  /* Compact footer text on mobile */
  .prompt-trust {
    font-size: 10px;
    gap: 4px;
    margin-top: 6px;
    color: #c4c8cc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .prompt-trust svg {
    width: 10px;
    height: 10px;
  }
  .trust-extra {
    display: none;
  }
  .chat-empty__greeting {
    font-size: 17px;
  }
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .message {
    padding: 16px;
  }
  .prompt-box-wrapper {
    padding: 10px 12px 12px;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .prompt-box {
    max-width: 100%;
  }
  .prompt-textarea {
    font-size: 16px;
  }
  .prompt-tools-label {
    display: none;
  }
  .voice-features {
    grid-template-columns: 1fr;
    max-width: 280px;
  }
  /* Voice orb scaled for mobile */
  .voice-orb {
    width: 180px;
    height: 180px;
  }
  .call-btn {
    width: 180px;
    height: 180px;
    box-shadow:
      inset 0 0 50px rgba(14, 92, 142, 0.45),
      0 10px 30px rgba(28, 123, 190, 0.30),
      0 3px 10px rgba(28, 123, 190, 0.15);
  }
  .call-btn__core {
    width: 58px;
    height: 58px;
  }
  .voice-orb__icon {
    width: 26px;
    height: 26px;
  }
  .voice-glow {
    width: 280px;
    height: 280px;
  }
  /* Smaller, repositioned background blobs so they fit the viewport */
  .voice-blob--1 {
    width: 280px;
    height: 280px;
    top: -60px;
    left: -80px;
  }
  .voice-blob--2 {
    width: 260px;
    height: 260px;
    bottom: -60px;
    right: -80px;
  }
  .voice-hero {
    padding: 24px 16px;
    gap: 14px;
  }
  .voice-helper-text {
    font-size: 13px;
    line-height: 1.45;
    padding: 0 20px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    overflow-wrap: break-word;
  }
  .waveform {
    max-width: 240px;
  }
}
