/* ===== BASE ===== */
* { box-sizing: border-box; }
body { overflow-x: hidden; }
::selection { background: #0891b2; color: #fff; }

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}
.site-header .nav-link,
.site-header .logo-text,
.site-header .logo-eyebrow { color: rgba(255,255,255,0.92); }
.site-header .logo-eyebrow { color: rgba(255,255,255,0.65); }
.site-header .nav-link:hover { color: #67e8f9; }
.site-header .nav-link::after {
  content: '';
  display: block;
  height: 2px;
  width: 0;
  background: #22d3ee;
  transition: width 0.25s ease;
  margin-top: 4px;
}
.site-header .nav-link:hover::after { width: 100%; }

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.15);
  border-bottom-color: rgba(226, 232, 240, 0.8);
}
.site-header.scrolled .nav-link { color: #334155; }
.site-header.scrolled .nav-link:hover { color: #0e7490; }
.site-header.scrolled .logo-text { color: #0f172a; }
.site-header.scrolled .logo-eyebrow { color: #64748b; }

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.6);
  color: #fff;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}
.account-btn:hover { background: rgba(255,255,255,0.15); }
.site-header.scrolled .account-btn {
  border-color: #0891b2;
  color: #0e7490;
}
.site-header.scrolled .account-btn:hover { background: #0891b2; color: #fff; }

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
  width: 24px; height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: all 0.3s ease;
}
.site-header.scrolled .menu-toggle span { background: #0f172a; }
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-mobile-nav {
  max-height: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(226,232,240,0.8);
  transition: max-height 0.4s ease;
}
.site-mobile-nav.open { max-height: 88vh; }
.mobile-link {
  display: block;
  padding: 13px 4px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  -webkit-tap-highlight-color: transparent;
}
.mobile-link:active { color: #0e7490; }
.mobile-link:hover { color: #0e7490; }

.app-mini-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(120deg, #0891b2, #164e63);
  color: #fff;
  padding: 14px 16px;
  border-radius: 16px;
  text-decoration: none;
}
.app-mini-banner-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.app-mini-banner-text { flex: 1; min-width: 0; }
.app-mini-banner-text strong { display: block; font-size: 0.85rem; }
.app-mini-banner-text small { display: block; font-size: 0.72rem; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ===== HERO VIDEO ===== */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, rgba(15,23,42,0.96) 0%, rgba(15,23,42,0.55) 45%, rgba(15,23,42,0.55) 100%),
    linear-gradient(to right, rgba(15,23,42,0.75) 0%, rgba(15,23,42,0.25) 60%);
}

/* ===== MARQUEE ===== */
.marquee {
  background: #0f172a;
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  gap: 40px;
  animation: marquee 26s linear infinite;
}
.marquee-track span {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 40px;
}
.marquee-track span i { font-size: 5px; color: #22d3ee; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== REVEAL ON SCROLL ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== DESCARGA NUESTRA APP ===== */
.app-promo {
  position: relative;
  overflow: hidden;
  padding: 64px 0;
  background: linear-gradient(160deg, #0f172a 0%, #0f172a 55%, #083344 100%);
}
.app-promo-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(34,211,238,0.22) 0%, transparent 42%),
    radial-gradient(circle at 85% 80%, rgba(8,145,178,0.28) 0%, transparent 45%);
  pointer-events: none;
}
.app-store-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  padding: 10px 20px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.app-store-btn:hover { background: #1e293b; transform: translateY(-2px); border-color: rgba(255,255,255,0.3); }
.app-store-btn i { font-size: 1.6rem; flex-shrink: 0; }
.app-store-btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; font-weight: 700; font-size: 0.92rem; }
.app-store-btn span small { font-weight: 500; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; }

.app-phone-mockup {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 440px;
  background: #0f172a;
  border-radius: 36px;
  border: 6px solid #1e293b;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.6);
  padding: 14px;
  animation: widgetFloat 4s ease-in-out infinite;
}
.app-phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 70px; height: 18px;
  background: #000;
  border-radius: 10px;
  z-index: 2;
}
.app-phone-screen {
  background: linear-gradient(160deg, #0891b2, #164e63 60%, #0f172a);
  border-radius: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 18px;
  text-align: center;
}
.app-phone-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  border: 3px solid rgba(255,255,255,0.6);
}
.app-phone-screen strong { color: #fff; font-size: 1rem; }
.app-phone-screen span { color: rgba(255,255,255,0.75); font-size: 0.8rem; line-height: 1.4; }
.app-phone-chip {
  margin-top: 6px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
}
.app-phone-chip i { color: #34d399; }

/* ===== DR. MUELITAS CHAT WIDGET (grande) ===== */
.chat-widget {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 128px; height: 128px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.chat-widget-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,0.55) 0%, rgba(8,145,178,0.28) 45%, rgba(8,145,178,0) 72%);
  filter: blur(4px);
  animation: glowPulse 3.2s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.1); }
}
.chat-widget-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.45);
  animation: ringPulse 2.4s ease-out infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes ringPulse {
  0% { transform: scale(0.92); opacity: 0.8; }
  70% { transform: scale(1.22); opacity: 0; }
  100% { opacity: 0; }
}
.chat-widget-img {
  position: relative;
  z-index: 2;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
  border: 3px solid #fff;
  box-shadow: 0 18px 40px -10px rgba(8,145,178,0.55), 0 0 0 1px rgba(255,255,255,0.5);
  animation: widgetFloat 3.4s ease-in-out infinite;
  transition: transform 0.25s ease;
}
.chat-widget:hover .chat-widget-img { transform: scale(1.06) translateY(-4px); }
@keyframes widgetFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.chat-widget-status {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: #fff;
  color: #0f172a;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  box-shadow: 0 6px 14px -4px rgba(15,23,42,0.35);
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
  pointer-events: none;
}
.chat-widget-status i { color: #10b981; font-size: 6px; }
.chat-widget-tooltip {
  position: absolute;
  right: calc(100% + 16px);
  top: 18px;
  z-index: 3;
  background: #0f172a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 12px 26px -8px rgba(15,23,42,0.45);
  animation: tooltipFloat 3.4s ease-in-out infinite, tooltipIn 0.5s ease 0.8s both;
  pointer-events: none;
}
.chat-widget-tooltip::after {
  content: '';
  position: absolute;
  right: -6px; bottom: 12px;
  width: 12px; height: 12px;
  background: #0f172a;
  transform: rotate(45deg);
  border-radius: 2px;
}
@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes tooltipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== CHAT WINDOW ===== */
.chat-window {
  position: fixed;
  bottom: 174px; right: 26px;
  width: 380px;
  height: 540px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 60px -20px rgba(15,23,42,0.35);
  z-index: 199;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(24px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
.chat-header {
  background: linear-gradient(120deg, #0891b2, #0e7490 65%, #164e63);
  padding: 18px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}
.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

.msg { animation: msgIn 0.3s ease; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.typing-indicator {
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
}
.typing-indicator span {
  width: 6px; height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.2s ease infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ===== MODAL: CREAR CUENTA ===== */
.account-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.account-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.account-modal {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 40px 80px -20px rgba(15,23,42,0.45);
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.account-modal-overlay.open .account-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.account-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.account-modal-close:hover { background: #e2e8f0; color: #0f172a; }
.account-modal-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0891b2, #164e63);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 18px;
  box-shadow: 0 12px 26px -8px rgba(8,145,178,0.5);
}
.account-modal-title {
  text-align: center;
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
}
.account-modal-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.5;
}

/* ===== TOAST DE ÉXITO ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 400;
  background: #0f172a;
  color: #fff;
  padding: 16px 22px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 20px 44px -14px rgba(15,23,42,0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast i { color: #10b981; font-size: 1.3rem; flex-shrink: 0; }
.toast strong { display: block; font-size: 0.88rem; }
.toast span { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.7); margin-top: 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .app-phone-mockup { width: 180px; height: 340px; border-width: 5px; padding: 12px; }
  .app-phone-avatar { width: 54px; height: 54px; }
  .app-store-btn { padding: 9px 16px; }
  .app-store-btn i { font-size: 1.35rem; }
  .app-store-btn span { font-size: 0.82rem; }
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    height: 66vh;
    bottom: 118px;
  }
  .chat-widget { right: 16px; bottom: 16px; width: 88px; height: 88px; }
  .chat-widget-img { width: 76px; height: 76px; }
  .chat-widget-tooltip { display: none; }
  .chat-widget-status { font-size: 0.58rem; padding: 3px 9px; }
  .account-modal { padding: 32px 22px 26px; }
  .toast {
    padding: 13px 16px;
    gap: 10px;
    left: 12px;
    right: 12px;
    transform: translateY(-20px);
    max-width: none;
  }
  .toast.show { transform: translateY(0); }
}

@media (max-width: 360px) {
  .chat-widget { width: 76px; height: 76px; right: 12px; bottom: 12px; }
  .chat-widget-img { width: 66px; height: 66px; }
  .app-phone-mockup { width: 160px; height: 310px; }
}
