/* ==========================================================
   ExpertApps - Estilos complementarios a Tailwind
   Ruta: /assets/css/app.css
   ========================================================== */

[x-cloak] { display: none !important; }

html { -webkit-tap-highlight-color: transparent; }
body { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; }

/* ---------- Botones ---------- */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; gap: .5rem;
  border-radius: .625rem; padding: .55rem 1rem;
  font-size: .875rem; font-weight: 600; line-height: 1.25rem;
  transition: all .15s ease; white-space: nowrap; cursor: pointer;
}
.btn-primary { background: #4f46e5; color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.08), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: #4338ca; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: #fff; color: #27272a; border: 1px solid #e4e4e7; }
.btn-secondary:hover { background: #f4f4f5; border-color: #d4d4d8; }
.dark .btn-secondary { background: #18181b; color: #e4e4e7; border-color: #3f3f46; }
.dark .btn-secondary:hover { background: #27272a; }
.btn-ghost { color: #52525b; }
.btn-ghost:hover { background: #f4f4f5; color: #18181b; }
.dark .btn-ghost { color: #a1a1aa; }
.dark .btn-ghost:hover { background: #27272a; color: #fafafa; }
.btn-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.btn-danger:hover { background: #ffe4e6; }
.dark .btn-danger { background: rgba(244,63,94,.1); color: #fda4af; border-color: rgba(244,63,94,.25); }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }

/* ---------- Formularios ---------- */
.label { display: block; font-size: .875rem; font-weight: 500; color: #3f3f46; margin-bottom: .375rem; }
.dark .label { color: #d4d4d8; }
.input {
  display: block; width: 100%; border-radius: .625rem; border: 1px solid #e4e4e7; background: #fff;
  padding: .6rem .8rem; font-size: .875rem; color: #18181b; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #a1a1aa; }
.input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.dark .input { background: #09090b; border-color: #3f3f46; color: #f4f4f5; }
.dark .input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.25); }
.input-error { border-color: #fda4af !important; }
.field-error { margin-top: .35rem; font-size: .8rem; color: #e11d48; }
.help { margin-top: .35rem; font-size: .78rem; color: #71717a; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right .6rem center; background-repeat: no-repeat; background-size: 1.25em; padding-right: 2.25rem; }
.checkbox { height: 1rem; width: 1rem; border-radius: .3rem; accent-color: #4f46e5; }

/* ---------- Tarjetas / navegación ---------- */
.card { border-radius: 1rem; border: 1px solid rgba(228,228,231,.8); background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06); }
.dark .card { border-color: #27272a; background: #18181b; }
.card-pad { padding: 1.25rem; }
@media (min-width: 640px) { .card-pad { padding: 1.5rem; } }

.nav-item { display: flex; align-items: center; gap: .75rem; border-radius: .625rem; padding: .55rem .75rem; font-size: .875rem; font-weight: 500; color: #52525b; transition: all .15s; }
.nav-item:hover { background: #f4f4f5; color: #18181b; }
.dark .nav-item { color: #a1a1aa; }
.dark .nav-item:hover { background: #27272a; color: #fafafa; }
.nav-item-active { background: #eef2ff !important; color: #4338ca !important; }
.dark .nav-item-active { background: rgba(99,102,241,.12) !important; color: #a5b4fc !important; }
.nav-public { border-radius: .5rem; padding: .45rem .75rem; color: #52525b; transition: all .15s; }
.nav-public:hover { color: #18181b; background: #f4f4f5; }
.dark .nav-public { color: #a1a1aa; }
.dark .nav-public:hover { color: #fafafa; background: #27272a; }
.menu-item { display: flex; align-items: center; gap: .6rem; border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; color: #3f3f46; }
.menu-item:hover { background: #f4f4f5; }
.dark .menu-item { color: #d4d4d8; }
.dark .menu-item:hover { background: #27272a; }

.tab { border-bottom: 2px solid transparent; padding: .6rem .25rem; font-size: .875rem; font-weight: 500; color: #71717a; white-space: nowrap; }
.tab:hover { color: #18181b; }
.dark .tab:hover { color: #fafafa; }
.tab-active { border-color: #4f46e5; color: #4338ca; }
.dark .tab-active { color: #a5b4fc; border-color: #818cf8; }

.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; border: 1px solid #e4e4e7; padding: .35rem .8rem; font-size: .8rem; font-weight: 500; color: #52525b; background: #fff; transition: all .15s; white-space: nowrap; }
.chip:hover { border-color: #c7d2fe; color: #4338ca; }
.chip-active { background: #4f46e5; border-color: #4f46e5; color: #fff !important; }
.dark .chip { background: #18181b; border-color: #3f3f46; color: #a1a1aa; }
.dark .chip-active { background: #6366f1; border-color: #6366f1; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .1rem .55rem; font-size: .72rem; font-weight: 600; }
.badge-green { background: #ecfdf5; color: #047857; } .dark .badge-green { background: rgba(16,185,129,.12); color: #6ee7b7; }
.badge-red { background: #fff1f2; color: #be123c; } .dark .badge-red { background: rgba(244,63,94,.12); color: #fda4af; }
.badge-gray { background: #f4f4f5; color: #52525b; } .dark .badge-gray { background: #27272a; color: #a1a1aa; }
.badge-brand { background: #eef2ff; color: #4338ca; } .dark .badge-brand { background: rgba(99,102,241,.14); color: #a5b4fc; }
.badge-amber { background: #fffbeb; color: #b45309; } .dark .badge-amber { background: rgba(245,158,11,.12); color: #fcd34d; }

/* ---------- Tablas ---------- */
.table { width: 100%; font-size: .875rem; }
.table th { text-align: left; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #71717a; padding: .75rem 1rem; border-bottom: 1px solid #e4e4e7; white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid #f4f4f5; vertical-align: middle; }
.dark .table th { border-color: #27272a; }
.dark .table td { border-color: #1f1f23; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- Barra de progreso ---------- */
.progress { height: .45rem; border-radius: 999px; background: #f4f4f5; overflow: hidden; }
.dark .progress { background: #27272a; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width .6s ease; }

/* ---------- Resultado (Markdown) ---------- */
.ea-prose { font-size: .95rem; line-height: 1.7; color: #27272a; overflow-wrap: anywhere; }
.dark .ea-prose { color: #d4d4d8; }
.ea-prose > :first-child { margin-top: 0; }
.ea-prose h1, .ea-prose h2, .ea-prose h3, .ea-prose h4 { color: #18181b; font-weight: 700; line-height: 1.3; margin: 1.6em 0 .6em; }
.dark .ea-prose h1, .dark .ea-prose h2, .dark .ea-prose h3, .dark .ea-prose h4 { color: #fafafa; }
.ea-prose h1 { font-size: 1.5rem; } .ea-prose h2 { font-size: 1.25rem; } .ea-prose h3 { font-size: 1.08rem; }
.ea-prose p { margin: .8em 0; }
.ea-prose ul, .ea-prose ol { margin: .8em 0; padding-left: 1.4em; }
.ea-prose ul { list-style: disc; } .ea-prose ol { list-style: decimal; }
.ea-prose li { margin: .3em 0; } .ea-prose li::marker { color: #a1a1aa; }
.ea-prose strong { color: #18181b; font-weight: 650; } .dark .ea-prose strong { color: #fafafa; }
.ea-prose a { color: #4f46e5; text-decoration: underline; text-underline-offset: 2px; }
.ea-prose blockquote { border-left: 3px solid #c7d2fe; padding: .2em 0 .2em 1em; color: #52525b; margin: 1em 0; }
.dark .ea-prose blockquote { border-color: #4338ca; color: #a1a1aa; }
.ea-prose code { background: #f4f4f5; border-radius: .35rem; padding: .1em .35em; font-size: .85em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dark .ea-prose code { background: #27272a; }
.ea-prose pre { background: #18181b; color: #e4e4e7; border-radius: .75rem; padding: 1rem 1.1rem; overflow-x: auto; margin: 1em 0; font-size: .85rem; }
.ea-prose pre code { background: transparent; padding: 0; color: inherit; }
.ea-prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .875rem; display: block; overflow-x: auto; }
.ea-prose th, .ea-prose td { border: 1px solid #e4e4e7; padding: .5rem .7rem; text-align: left; }
.ea-prose th { background: #fafafa; font-weight: 600; }
.dark .ea-prose th, .dark .ea-prose td { border-color: #3f3f46; }
.dark .ea-prose th { background: #27272a; }
.ea-prose hr { border: 0; border-top: 1px solid #e4e4e7; margin: 1.5em 0; }
.dark .ea-prose hr { border-color: #3f3f46; }

/* ---------- Animaciones ---------- */
@keyframes ea-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: ea-fade-up .45s ease both; }
@keyframes ea-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton { border-radius: .5rem; background: linear-gradient(90deg, #f4f4f5 0%, #e4e4e7 50%, #f4f4f5 100%); background-size: 800px 100%; animation: ea-shimmer 1.4s linear infinite; }
.dark .skeleton { background: linear-gradient(90deg, #27272a 0%, #3f3f46 50%, #27272a 100%); background-size: 800px 100%; }

/* Scrollbar sutil */
* { scrollbar-width: thin; scrollbar-color: #d4d4d8 transparent; }
.dark * { scrollbar-color: #3f3f46 transparent; }

@media print {
  aside, header, footer, .no-print { display: none !important; }
  .lg\:pl-64 { padding-left: 0 !important; }
}

/* Inputs con icono (la utilidad de Tailwind debe ganar al padding de .input) */
.input.pl-9 { padding-left: 2.25rem; }
.input.pr-10 { padding-right: 2.5rem; }

/* ---------- Tutoriales: capturas dentro del texto ---------- */
.ea-prose img.md-img { display: block; max-width: 100%; height: auto; margin: 1rem 0 1.4rem; border: 1px solid #e4e4e7; border-radius: .9rem; box-shadow: 0 10px 30px -12px rgba(24, 24, 27, .25); }
.dark .ea-prose img.md-img { border-color: #3f3f46; }
.howto-n { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; background: #eef2ff; color: #4f46e5; font-size: .8rem; font-weight: 700; }
.dark .howto-n { background: rgba(99, 102, 241, .15); color: #a5b4fc; }

/* ---------- Menús editables: enlaces destacados ---------- */
.nav-public.is-active { color: #18181b; }
.dark .nav-public.is-active { color: #fafafa; }
.nav-highlight { background: #eef2ff; color: #4338ca !important; font-weight: 600; border-radius: 999px; }
.nav-highlight:hover { background: #e0e7ff !important; }
.dark .nav-highlight { background: rgba(99, 102, 241, .16); color: #c7d2fe !important; }
.nav-highlight-m { background: #eef2ff; color: #4338ca; font-weight: 600; }
.dark .nav-highlight-m { background: rgba(99, 102, 241, .16); color: #c7d2fe; }
.footer-highlight { color: #4f46e5; font-weight: 600; }
.dark .footer-highlight { color: #a5b4fc; }

/* ---------- VSL de la portada ---------- */
.vsl { position: relative; width: 100%; border-radius: 1.25rem; overflow: hidden; background: #0f0d2e; box-shadow: 0 30px 80px -30px rgba(67, 56, 202, .55), 0 0 0 1px rgba(255, 255, 255, .06); text-align: center; outline: none; }
.vsl:focus-visible { box-shadow: 0 0 0 3px #818cf8; }
.vsl-stage { position: relative; aspect-ratio: 16 / 9; container-type: inline-size; cursor: pointer; color: #fff; user-select: none;
  background: radial-gradient(120% 90% at 15% 10%, #4338ca 0%, transparent 55%), radial-gradient(90% 80% at 90% 90%, #7c3aed 0%, transparent 55%), linear-gradient(135deg, #1e1b4b, #0f0d2e); }
.vsl-scene { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.6cqw; padding: 5cqw 7cqw 9cqw; }
.vsl-h1 { margin: 0; font-size: 5.2cqw; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.vsl-h2 { margin: 0; font-size: 3.6cqw; font-weight: 700; color: #e0e7ff; text-wrap: balance; }
.vsl-kicker { margin: 0; font-size: max(9px, 1.7cqw); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #a5b4fc; }
.vsl-small { margin: 0; font-size: max(9px, 1.7cqw); color: #c7d2fe; opacity: .85; }
.vsl-bigplay { display: inline-flex; align-items: center; justify-content: center; width: 11cqw; height: 11cqw; border-radius: 999px; background: #fff; color: #4f46e5; box-shadow: 0 0 0 1.6cqw rgba(255, 255, 255, .15); animation: vslPulse 2s ease-in-out infinite; }
.vsl-bigplay svg { width: 4.8cqw; height: 4.8cqw; margin-left: .6cqw; }
.vsl-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2cqw; }
.vsl-chip { padding: .9cqw 1.8cqw; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); font-size: max(9px, 2cqw); font-weight: 600; backdrop-filter: blur(6px); }
.vsl-clock { font-size: 8cqw; line-height: 1; }
.vsl-emoji { font-size: 5cqw; line-height: 1; }
.vsl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; width: 100%; max-width: 76cqw; }
.vsl-card { display: flex; flex-direction: column; align-items: center; gap: 1.2cqw; padding: 3.2cqw 2.4cqw; border-radius: 2.2cqw; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.vsl-card b { font-size: 3cqw; line-height: 1.15; }
.vsl-card span { font-size: max(9px, 2.1cqw); color: #c7d2fe; }
.vsl-card .vsl-emoji { font-size: 5cqw; }
.vsl-logo { display: inline-flex; align-items: center; gap: 1.4cqw; font-size: 6.4cqw; font-weight: 800; letter-spacing: -.02em; }
.vsl-logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 8cqw; height: 8cqw; border-radius: 2cqw; background: linear-gradient(135deg, #818cf8, #a855f7); font-size: 4.6cqw; }
.vsl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1cqw; width: 100%; max-width: 80cqw; }
.vsl-tile { padding: 1.2cqw .8cqw; border-radius: 1.2cqw; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); font-size: max(8px, 1.6cqw); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vsl-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.6cqw; width: 100%; max-width: 84cqw; }
.vsl-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1.6cqw; padding: 3.6cqw 2cqw; border-radius: 2.2cqw; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.vsl-step b { font-size: 2.7cqw; line-height: 1.2; text-wrap: balance; }
.vsl-num { position: absolute; top: -1.8cqw; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; width: 3.8cqw; height: 3.8cqw; border-radius: 999px; background: #fff; color: #4f46e5; font-size: 2cqw; font-weight: 800; }
.vsl-window { width: 100%; max-width: 64cqw; border-radius: 1.8cqw; background: #fff; color: #18181b; text-align: left; overflow: hidden; box-shadow: 0 2cqw 5cqw -1cqw rgba(0, 0, 0, .45); }
.vsl-bar { display: flex; align-items: center; gap: .7cqw; padding: 1.1cqw 1.6cqw; background: #f4f4f5; font-size: 1.6cqw; font-weight: 600; color: #52525b; }
.vsl-bar i { width: 1.1cqw; height: 1.1cqw; border-radius: 999px; background: #d4d4d8; }
.vsl-bar span { margin-left: 1cqw; }
.vsl-field { margin: 1.6cqw 1.6cqw 0; padding: 1.2cqw 1.4cqw; border: 2px solid #6366f1; border-radius: 1cqw; font-size: 1.9cqw; }
.vsl-type { display: inline-block; overflow: hidden; white-space: nowrap; border-right: 2px solid #4f46e5; width: 0; animation: vslType 1.4s steps(30, end) .3s forwards, vslCaret .8s step-end infinite; vertical-align: bottom; }
.vsl-result { padding: 1.4cqw 1.6cqw 1.8cqw; }
.vsl-line { margin: .5cqw 0; font-size: 1.9cqw; opacity: 0; animation: vslIn .5s ease-out forwards; }
.vsl-label { font-size: 1.9cqw !important; text-transform: uppercase; letter-spacing: .1em; color: #a5b4fc !important; font-weight: 700; }
.vsl-big { font-size: 7cqw !important; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.vsl-ok { font-size: 1.9cqw !important; color: #6ee7b7 !important; font-weight: 600; }
.vsl-bars { display: flex; align-items: flex-end; gap: 1cqw; height: 10cqw; width: 80%; }
.vsl-bars i { flex: 1; border-radius: .6cqw .6cqw 0 0; background: linear-gradient(180deg, #a5b4fc, #6366f1); transform-origin: bottom; transform: scaleY(0); animation: vslGrow .6s ease-out forwards; }
.vsl-cta { display: inline-flex; align-items: center; padding: 2cqw 4.4cqw; border-radius: 999px; background: #fff; color: #4338ca; font-size: 3cqw; font-weight: 800; box-shadow: 0 0 0 1.2cqw rgba(255, 255, 255, .15); text-decoration: none; }
.vsl-cta:hover { background: #eef2ff; }
.vsl-url { margin: 0; font-size: 2.6cqw; font-weight: 700; color: #e0e7ff; }
.vsl-cc { position: absolute; left: 50%; bottom: 3cqw; transform: translateX(-50%); width: max-content; max-width: 90cqw; margin: 0; padding: max(3px, .9cqw) max(8px, 1.8cqw); border-radius: max(6px, 1cqw); background: rgba(0, 0, 0, .66); font-size: max(10.5px, 2.05cqw); line-height: 1.35; font-weight: 500; text-wrap: balance; }
.vsl-replay { position: absolute; top: 3cqw; right: 3cqw; padding: max(4px, 1cqw) max(10px, 2cqw); border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-size: max(11px, 1.8cqw); font-weight: 600; border: 1px solid rgba(255, 255, 255, .3); }
.vsl-controls { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: #0b0a24; color: #e0e7ff; }
.vsl-controls > button { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 .4rem; border-radius: .5rem; font-size: .72rem; font-weight: 800; color: #c7d2fe; }
.vsl-controls > button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.vsl-controls > button.is-on { background: rgba(255, 255, 255, .16); color: #fff; }
.vsl-controls svg { width: 1.15rem; height: 1.15rem; }
.vsl-segs { flex: 1; display: flex; gap: 4px; }
.vsl-seg { flex: 1; height: 6px; padding: 0; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.vsl-seg i { display: block; height: 100%; background: #a5b4fc; border-radius: 99px; }
.vsl-in { opacity: 0; animation: vslIn .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.vsl-pop { opacity: 0; animation: vslPop .55s cubic-bezier(.2, .9, .3, 1.3) forwards; }
.vsl-float { opacity: 0; animation: vslIn .6s ease-out forwards, vslBob 3s ease-in-out 1.2s infinite; }
@keyframes vslIn { from { opacity: 0; transform: translateY(2.4cqw); } to { opacity: 1; transform: none; } }
@keyframes vslPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes vslBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.8cqw); } }
@keyframes vslPulse { 0%, 100% { box-shadow: 0 0 0 1.6cqw rgba(255, 255, 255, .15); } 50% { box-shadow: 0 0 0 2.6cqw rgba(255, 255, 255, .06); } }
@keyframes vslType { to { width: 100%; } }
@keyframes vslCaret { 50% { border-color: transparent; } }
@keyframes vslGrow { to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .vsl-in, .vsl-pop, .vsl-float, .vsl-line { animation-duration: .01s !important; animation-delay: 0s !important; } .vsl-type { animation: none; width: auto; } .vsl-bars i { animation: none; transform: none; } }
.home-video { position: relative; width: 100%; max-width: 860px; margin: 2.5rem auto 0; }
.home-video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 1.25rem; overflow: hidden; background: #000; box-shadow: 0 30px 80px -30px rgba(67, 56, 202, .55); }
.home-video-frame iframe, .home-video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
