/* =========================================================================
   FamilyHealthVIP - estilos personalizados (complemento de Tailwind CDN)
   Paleta: blanco/arena + dorado suave + grises calidos. Modo claro y oscuro.
   ========================================================================= */

:root {
  --gold-300: #DDC082;
  --gold-400: #D0AC62;
  --gold-500: #C2A05E;
  --gold-600: #A9863F;
  --ink: #1B1813;
  --muted: #6B6354;
  --line: #ECE6D9;
  --surface: #ffffff;
  --bg: #FAF8F3;
  --cream: #F4EFE4;
  --card: 0 1px 2px rgba(28,26,23,0.04), 0 16px 36px -22px rgba(40,33,20,0.22);
  --glass-bg: rgba(255,255,255,0.62);
  --glass-border: rgba(255,255,255,0.7);
  --glass-shadow: 0 24px 60px -26px rgba(20,16,8,0.40);
}
html.dark {
  --ink: #F4F0E7;
  --muted: #A39A86;
  --line: #2C2618;
  --surface: #1E1A12;
  --bg: #15120C;
  --cream: #221C12;
  --glass-bg: rgba(30,26,18,0.55);
  --glass-border: rgba(255,255,255,0.10);
  --glass-shadow: 0 26px 64px -24px rgba(0,0,0,0.7);
}

* { -webkit-tap-highlight-color: transparent; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

/* ---------- Scrollbars ---------- */
.scroll-elegant { scrollbar-width: thin; scrollbar-color: var(--gold-400) transparent; }
.scroll-elegant::-webkit-scrollbar { width: 9px; height: 9px; }
.scroll-elegant::-webkit-scrollbar-track { background: transparent; }
.scroll-elegant::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gold-400), var(--gold-600));
  border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------- Glassmorphism (con refraccion de borde) ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), var(--glass-shadow);
}
html.dark .glass { box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), var(--glass-shadow); }
.glass-soft {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--glass-border);
}

/* ---------- Animaciones ---------- */
@keyframes fhvFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fhvBubbleIn { 0% { opacity: 0; transform: translateY(12px) scale(.96); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fhvPop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }
@keyframes fhvFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes fhvShimmer { 0% { background-position: -480px 0; } 100% { background-position: 480px 0; } }
@keyframes fhvSpin { to { transform: rotate(360deg); } }
@keyframes fhvLivePulse { 0% { box-shadow: 0 0 0 0 rgba(225,29,72,0.55); } 70% { box-shadow: 0 0 0 9px rgba(225,29,72,0); } 100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); } }
@keyframes fhvGlow { 0%,100% { opacity:.55; } 50% { opacity:1; } }

.animate-fade-up { animation: fhvFadeUp .6s cubic-bezier(.16,1,.3,1) both; }
.reveal { opacity: 0; }
.reveal.in { animation: fhvFadeUp .7s cubic-bezier(.16,1,.3,1) both; }
[data-reveal-delay] { animation-delay: var(--rd, 0ms); }
.animate-float { animation: fhvFloat 6s ease-in-out infinite; }

.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 37%, rgba(0,0,0,0.04) 63%);
  background-size: 960px 100%; animation: fhvShimmer 1.4s linear infinite; border-radius: 12px;
}
html.dark .skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.05) 63%); background-size: 960px 100%; }

.spinner { width: 1.05em; height: 1.05em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: fhvSpin .7s linear infinite; display: inline-block; }

/* ---------- LIVE badge ---------- */
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: #ef4444; animation: fhvLivePulse 1.8s infinite; }
.live-badge { background: #B8341F; }

/* ---------- Botones tactiles (color plano, sin gradiente) ---------- */
.btn { transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .25s, background .25s, color .2s; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-gold {
  background: var(--gold-500);
  color: #fff; box-shadow: 0 10px 22px -12px rgba(169,134,63,0.8);
}
.btn-gold:hover { background: var(--gold-600); box-shadow: 0 14px 28px -10px rgba(169,134,63,0.85); transform: translateY(-1px); }

/* ---------- Tarjetas ---------- */
.card-surface { background: var(--surface); border: 1px solid var(--line); }

/* ---------- Reproductor de video personalizado ---------- */
.player-shell { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0c0a06; }
.player-shell iframe, .player-shell video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Capa que oculta el branding inferior de YouTube cuando no se interactua */
.player-veil { position: absolute; inset: 0; pointer-events: none; }
.player-overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: rgba(10,8,4,0.80);
  color: #fff; padding: 1.5rem; }
.player-controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px;
  background: rgba(6,5,3,0.55); display: flex; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(8px); transition: .3s cubic-bezier(.16,1,.3,1); }
.player-shell:hover .player-controls, .player-shell.show-controls .player-controls { opacity: 1; transform: translateY(0); }
.player-controls .ctrl { color: #fff; opacity: .85; transition: .2s; cursor: pointer; }
.player-controls .ctrl:hover { opacity: 1; transform: scale(1.08); }

/* ---------- Chat ---------- */
.chat-scroll { overflow-y: auto; }
.chat-msg { animation: fhvBubbleIn .42s cubic-bezier(.16,1,.3,1) both; }
.chat-bubble { background: var(--surface); border: 1px solid var(--line); }
.chat-bubble-me { background: var(--gold-500); color: #fff; border: none; }

/* ---------- Sidebar (rail que se expande al hover) ---------- */
.nav-rail { width: 76px; transition: width .35s cubic-bezier(.16,1,.3,1); }
.nav-rail .nav-label { opacity: 0; transform: translateX(-6px); white-space: nowrap; transition: opacity .2s, transform .3s; }
.nav-rail.is-open { width: 256px; }
.nav-rail.is-open .nav-label { opacity: 1; transform: translateX(0); }
@media (min-width: 1024px) {
  .nav-rail:hover { width: 256px; }
  .nav-rail:hover .nav-label { opacity: 1; transform: translateX(0); }
}
.nav-item { transition: background .2s, color .2s; }
.nav-item .nav-ico { flex: 0 0 auto; }

/* ---------- Dock movil flotante (capsula glass) ---------- */
.mobile-dock { box-shadow: 0 18px 50px -18px rgba(20,16,8,0.5); }

/* ---------- Menu fullscreen movil ---------- */
.fullmenu { transition: opacity .35s, visibility .35s; }
.fullmenu.hidden-menu { opacity: 0; visibility: hidden; }
.fullmenu .fm-item { animation: fhvFadeUp .5s cubic-bezier(.16,1,.3,1) both; }

/* ---------- Toasts ---------- */
.toast { pointer-events: auto; animation: fhvPop .35s cubic-bezier(.16,1,.3,1) both; }
.toast.leaving { animation: fhvFadeUp .3s reverse both; opacity: 0; }

/* ---------- Forms ---------- */
.field-input {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field-input::placeholder { color: var(--muted); opacity: .8; }
.field-input:focus { outline: none; border-color: var(--gold-400); box-shadow: 0 0 0 4px rgba(194,160,94,0.18); }

/* ---------- Arbol unilevel ---------- */
.tree-node { animation: fhvFadeUp .4s cubic-bezier(.16,1,.3,1) both; }
.tree-children { position: relative; }
.tree-connector { position: absolute; left: 22px; top: 0; bottom: 0; width: 1px; background: var(--line); }

/* ---------- Utilidades varias ---------- */
.text-balance { text-wrap: balance; }
.divider-grad { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.mesh-gold {
  background:
    radial-gradient(40% 50% at 12% 18%, rgba(194,160,94,0.20), transparent 70%),
    radial-gradient(45% 55% at 88% 12%, rgba(221,192,130,0.18), transparent 70%),
    radial-gradient(60% 60% at 70% 90%, rgba(169,134,63,0.12), transparent 70%);
}
html.dark .mesh-gold {
  background:
    radial-gradient(40% 50% at 12% 18%, rgba(194,160,94,0.16), transparent 70%),
    radial-gradient(45% 55% at 88% 12%, rgba(221,192,130,0.10), transparent 70%),
    radial-gradient(60% 60% at 70% 90%, rgba(169,134,63,0.12), transparent 70%);
}
.grain { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* =========================================================================
   REDISEÑO LANDING — paleta dorado + celeste, showcase y video inmersivo
   ========================================================================= */

/* ---------- Fondo plano cálido (sin gradientes) ---------- */
.bg-stage { background: var(--bg); }
.surface-2 { background: var(--cream); }
html.dark .surface-2 { background: #1A1610; }

/* ---------- Badge / pill superior ---------- */
.hero-badge {
  background: var(--surface);
  border: 1px solid var(--line);
}

/* ---------- Tarjeta showcase (color plano) ---------- */
.showcase {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 40px 100px -55px rgba(40,33,20,0.45);
}
html.dark .showcase { background: var(--surface); border: 1px solid var(--line); }

/* ---------- Video inmersivo (ambilight / iluminacion cinematografica) ---------- */
.player-immersive { position: relative; isolation: isolate; }
/* Modo inmersivo REAL: copia desenfocada de la imagen que se ve (poster en offline,
   miniatura del directo cuando hay video). Estable, sin colores aleatorios. */
.player-immersive .ambient {
  position: absolute; inset: -5% -4%; z-index: -1; border-radius: 40px;
  background-size: cover; background-position: center;
  filter: blur(46px) saturate(1.45) brightness(1.02); opacity: .82; transform: scale(1.03);
  transition: background-image .8s ease, opacity .8s ease;
  will-change: opacity;
}
.player-immersive .ambient.is-strong { opacity: .92; }
/* El shell del video por encima del ambient */
.player-immersive .player-shell { z-index: 1; box-shadow: 0 24px 60px -28px rgba(10,8,4,.7); }

/* ---------- Barra de progreso del reproductor ---------- */
.vid-progress { height: 4px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.vid-progress > span { display:block; height:100%; width:64%; background: var(--gold-400); border-radius:999px; }
.vid-progress > span::after { content:""; }

/* ---------- Chat: like + badge médico ---------- */
.chat-like { display:inline-flex; align-items:center; gap:3px; font-size:11px; color: var(--muted); cursor:pointer; transition: color .15s, transform .15s; }
.chat-like:hover { color:#e11d48; }
.chat-like.liked { color:#e11d48; }
.chat-like.liked svg { fill: currentColor; }
.chat-like:active { transform: scale(1.2); }
.badge-medico { font-size:9px; font-weight:800; letter-spacing:.04em; padding:2px 6px; border-radius:6px; background: var(--gold-500); color:#fff; text-transform:uppercase; }
.bubble-medico { background: rgba(194,160,94,0.12); border:1px solid rgba(194,160,94,0.4); }

/* ---------- Barra inferior móvil (crear cuenta) ---------- */
.mobile-cta { box-shadow: 0 -10px 30px -12px rgba(20,16,8,.25); }

/* ---------- Mini thumbnails de transmisiones ---------- */
.thumb { position: relative; overflow: hidden; border-radius: 14px; background: #C2A05E; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb::after { content:""; position:absolute; inset:0; background:rgba(8,6,3,.30); }

/* ---------- Línea de pulso / latido (SVG animado) ---------- */
.pulse-line { stroke-dasharray: 320; stroke-dashoffset: 320; animation: fhvDraw 3.2s cubic-bezier(.16,1,.3,1) infinite; }
@keyframes fhvDraw { 0% { stroke-dashoffset: 320; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -320; } }
/* Anillos concentricos animados */
.ring-ping { animation: fhvRing 2.8s cubic-bezier(0,0,.2,1) infinite; }
@keyframes fhvRing { 0% { transform: scale(.6); opacity:.7;} 80%,100% { transform: scale(1.6); opacity:0;} }

/* ---------- Chips de acceso rapido (tonos dorado / amarillo) ---------- */
.chip-gold { background: rgba(194,160,94,0.14); color: var(--gold-600); }
html.dark .chip-gold { color: var(--gold-300); }
.chip-amber { background: rgba(234,179,8,0.16); color: #9A6E12; }
html.dark .chip-amber { color: #FACC15; }

/* ---------- Aside auth con imagen ---------- */
.auth-aside-img { position:absolute; inset:0; background-size:cover; background-position:center; }
.auth-aside-grad { position:absolute; inset:0; background: rgba(18,14,7,.52); }

/* ---------- Marquesina de confianza ---------- */
.trust-strip { border-top:1px solid var(--line); border-bottom:1px solid var(--line); }

/* ---------- Nav estilo concepto ---------- */
.nav-link { position: relative; }
.nav-link.is-active { color: var(--gold-600); font-weight: 600; }
.nav-link.is-active::after { content:""; position:absolute; left:14px; right:14px; bottom:-2px; height:2px; border-radius:2px; background: var(--gold-500); }
html.dark .nav-link.is-active { color: var(--gold-300); }
.nav-search { background: var(--cream); border:1px solid var(--line); }
html.dark .nav-search { background: rgba(255,255,255,0.05); }

/* ---------- Lower-third del reproductor (doctor) ---------- */
.lower-third { position:absolute; left:14px; bottom:64px; z-index:9; transition: opacity .3s, transform .3s; }
.player-shell:hover .lower-third, .player-shell.show-controls .lower-third { opacity:0; transform: translateY(6px); }
.viewers-pill { background: rgba(8,6,3,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------- Ilustraciones flotantes (SVG/imagen) ---------- */
.float-soft { animation: fhvFloat 7s ease-in-out infinite; }
.float-soft.d1 { animation-delay: .6s; }
.float-soft.d2 { animation-delay: 1.2s; }
.illus-halo { position:absolute; inset:0; margin:auto; width:72%; height:72%; border-radius:999px; background: rgba(194,160,94,0.14); filter: blur(14px); z-index:0; }

/* ---------- Tarjetas próximos directos ---------- */
.upcoming-card { background: var(--surface); border:1px solid var(--line); transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .25s; }
.upcoming-card:hover { transform: translateY(-4px); box-shadow: var(--card); border-color: rgba(208,172,98,0.55); }
.date-chip { background: var(--cream); border:1px solid var(--line); }
html.dark .date-chip { background: rgba(255,255,255,0.05); }

/* ---------- Card premium ---------- */
.premium-card { background: var(--cream); border:1px solid rgba(208,172,98,0.4); }
html.dark .premium-card { background: #1A1610; border:1px solid rgba(208,172,98,0.3); }

/* ---------- Indicador "escribiendo" ---------- */
.typing-dot { width:5px; height:5px; border-radius:999px; background: var(--gold-500); display:inline-block; animation: fhvType 1.2s infinite; }
.typing-dot:nth-child(2){ animation-delay:.18s } .typing-dot:nth-child(3){ animation-delay:.36s }
@keyframes fhvType { 0%,60%,100%{ transform: translateY(0); opacity:.5 } 30%{ transform: translateY(-4px); opacity:1 } }

/* ---------- Nav integrado (full-width, estilo concepto) ---------- */
.nav-bar {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 30px -24px rgba(20,16,8,.5);
}
@supports not (background: color-mix(in srgb, white, black)) {
  .nav-bar { background: var(--surface); }
}
.nav-icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  color: var(--muted); transition: background .2s, color .2s;
}
.nav-icon-btn:hover { background: var(--cream); color: var(--ink); }
html.dark .nav-icon-btn:hover { background: rgba(255,255,255,.06); }

/* ---------- Servicios (tarjetas estilo concepto, halo de color por tema) ---------- */
.svc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s;
}
.svc-card:hover { transform: translateY(-7px); box-shadow: 0 30px 60px -32px rgba(40,33,20,.5); border-color: color-mix(in srgb, var(--svc) 45%, var(--line)); }
.svc-media { position: relative; height: 210px; display: grid; place-items: center; overflow: hidden; }
.svc-halo {
  position: absolute; width: 240px; height: 240px; border-radius: 999px;
  background: var(--svc-halo); filter: blur(42px); opacity: .85; z-index: 0;
  transition: transform .5s ease;
}
.svc-card:hover .svc-halo { transform: scale(1.12); }
.svc-ring { position: absolute; width: 196px; height: 196px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--svc) 40%, transparent); z-index: 0; animation: fhvSpin 26s linear infinite; }
.svc-img { position: relative; z-index: 1; height: 150px; width: auto; object-fit: contain; filter: drop-shadow(0 16px 26px rgba(20,16,8,.18)); }
.svc-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
}
.svc-badge .svc-ico {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--surface); color: var(--svc); box-shadow: 0 8px 20px -10px rgba(20,16,8,.5);
}
.svc-badge .svc-lbl { font-size: 9px; font-weight: 700; letter-spacing: .03em; color: var(--svc); text-align: center; max-width: 70px; line-height: 1.15; }
.svc-title-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--svc-tint); color: var(--svc); }
.svc-more { color: var(--svc); }
.svc-more svg { transition: transform .25s; }
.svc-card:hover .svc-more svg { transform: translateX(4px); }
@keyframes fhvSpin { to { transform: rotate(360deg); } }

/* ---------- Destellos / hojas decorativas (SVG animado) ---------- */
.spark { position: absolute; color: var(--gold-400); opacity: .7; animation: fhvTwinkle 3.4s ease-in-out infinite; }
.spark.d1 { animation-delay: .8s; } .spark.d2 { animation-delay: 1.6s; } .spark.d3 { animation-delay: 2.2s; }
@keyframes fhvTwinkle { 0%,100% { transform: scale(.7) rotate(0deg); opacity: .35; } 50% { transform: scale(1) rotate(15deg); opacity: .9; } }
.leaf-float { position: absolute; color: #2f9e6e; opacity: .55; animation: fhvLeaf 6s ease-in-out infinite; }
@keyframes fhvLeaf { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(10deg); } }

/* ---------- CTA final (tarjeta clara + foto circular, estilo concepto) ---------- */
.cta-card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 90px -50px rgba(40,33,20,.5); }
.cta-dots {
  position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--gold-500) 55%, transparent) 1.4px, transparent 1.4px);
  background-size: 18px 18px; opacity: .35;
  -webkit-mask-image: radial-gradient(circle at 70% 50%, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at 70% 50%, #000 0%, transparent 62%);
}
.cta-photo { position: relative; z-index: 1; border-radius: 999px; overflow: hidden; aspect-ratio: 1/1; box-shadow: 0 30px 70px -34px rgba(40,33,20,.6); border: 6px solid var(--surface); }
.cta-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.cta-feat-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }

/* ---------- Pastilla avatares (prueba social) ---------- */
.ava-stack > * { margin-left: -10px; border: 2px solid var(--surface); }
.ava-stack > *:first-child { margin-left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
