/* ==========================================================================
   Bento PREMIUM — rediseño de la sección #features (fintech 2026)
   Aislado a propósito. Usa la paleta de brand.css. Reversible.
   ========================================================================== */

:root {
  --mdf-font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

/* ---- Escenario con glows aurora detrás de la rejilla ---- */
.bento-stage {
  position: relative;
  isolation: isolate;
}

.bento-stage::before,
.bento-stage::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

.bento-stage::before {
  width: 480px;
  height: 480px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(72, 209, 191, 0.28), transparent 68%);
  animation: bentoFloatA 14s ease-in-out infinite;
}

.bento-stage::after {
  width: 420px;
  height: 420px;
  bottom: -140px;
  right: -60px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 68%);
  animation: bentoFloatB 18s ease-in-out infinite;
}

@keyframes bentoFloatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
}
@keyframes bentoFloatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-36px, -28px) scale(1.1); }
}

/* ---- Rejilla bento ---- */
.features-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 640px) {
  .features-bento { grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
}

@media (min-width: 1024px) {
  .features-bento {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(178px, auto);
    grid-auto-flow: row dense;
    gap: 1.2rem;
  }
}

/* ---- Celda base ---- */
.bento-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 1.5rem 1.55rem;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(28, 38, 54, 0.92), rgba(14, 19, 30, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 34px rgba(0, 0, 0, 0.34);
  color: var(--mdf-ink);
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease, box-shadow 0.35s ease, opacity 0.5s ease;
}

/* Entrada escalonada */
.bento-card.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Spotlight que sigue el cursor */
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx) var(--my), rgba(74, 251, 229, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

/* Anillo de borde con gradiente (aparece en hover) */
.bento-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: linear-gradient(135deg, rgba(74, 251, 229, 0.7), rgba(34, 211, 238, 0.15) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.bento-card > * { position: relative; z-index: 2; }

.bento-card:hover {
  transform: translateY(-6px) scale(1.012);
  border-color: rgba(74, 251, 229, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 26px 60px rgba(0, 0, 0, 0.5),
    0 0 44px rgba(39, 225, 193, 0.16);
}

.bento-card:hover::before,
.bento-card:hover::after { opacity: 1; }

.bento-card:focus-visible { outline: 2px solid var(--mdf-accent); outline-offset: 3px; }
.bento-card:active { transform: translateY(-2px) scale(1.004); }

/* ---- Spans ---- */
@media (min-width: 1024px) {
  .bento-card--feature { grid-column: span 2; }
  .bento-card--wide { grid-column: span 2; }
}

/* ---- Icono ---- */
.bento-card__icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: var(--mdf-accent-ui, #4afbe5);
  background: linear-gradient(160deg, rgba(74, 251, 229, 0.16), rgba(34, 211, 238, 0.06));
  border: 1px solid rgba(74, 251, 229, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.bento-card__icon svg { width: 23px; height: 23px; }

.bento-card:hover .bento-card__icon {
  transform: translateY(-2px) rotate(-4deg) scale(1.06);
  box-shadow: 0 8px 20px rgba(39, 225, 193, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ---- Chip numérico monospace ---- */
.bento-card__stat {
  align-self: flex-start;
  font-family: var(--mdf-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mdf-accent-bright, #5eead4);
  background: rgba(94, 234, 212, 0.09);
  border: 1px solid rgba(94, 234, 212, 0.18);
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bento-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bento-card__title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0.35rem 0 0;
  text-transform: none;
}

.bento-card__desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--mdf-muted, #b3b8c1);
  margin: 0;
}

/* ---- Celda destacada (Leila) ---- */
.bento-card--feature {
  justify-content: flex-end;
  gap: 0.7rem;
  background:
    radial-gradient(130% 120% at 12% -10%, rgba(72, 209, 191, 0.32), transparent 52%),
    linear-gradient(155deg, #123a38 0%, #0f2a2c 45%, #0c1622 100%);
  border-color: rgba(74, 251, 229, 0.24);
}

/* Blob aurora animado dentro de la celda destacada */
.bento-card--feature .bento-aurora {
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.45), transparent 65%);
  filter: blur(38px);
  z-index: 0;
  animation: bentoFloatA 12s ease-in-out infinite;
}

.bento-card--feature .bento-card__icon {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #eafffb;
}
.bento-card--feature .bento-card__icon svg { width: 29px; height: 29px; }

.bento-card--feature .bento-card__title { font-size: 1.5rem; margin-top: 0.6rem; }
.bento-card--feature .bento-card__desc { font-size: 1rem; color: rgba(255, 255, 255, 0.85); }

.bento-card--feature .bento-card__stat {
  color: #d8faf4;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Empuja el contenido del featured hacia abajo */
.bento-card--feature .bento-feature-top {
  margin-bottom: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* ---- Anillo de progreso (celda Progreso Mensual) ---- */
.bento-ring {
  --val: 0;
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    conic-gradient(var(--mdf-accent-ui, #4afbe5) calc(var(--val) * 1%), rgba(255, 255, 255, 0.08) 0);
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(74, 251, 229, 0.25);
}

.bento-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #101826;
}

.bento-ring__num {
  position: relative;
  z-index: 1;
  font-family: var(--mdf-font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ---- Tags de estrategia ---- */
.bento-card .strategy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.bento-card .strategy-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  color: var(--mdf-accent-bright, #5eead4);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.16);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bento-card:hover .strategy-tag { transform: translateY(-1px); }

/* ---- Visual inferior uniforme (banner de imagen o gráfico) ---- */
.bento-card__visual,
.bento-card__art {
  width: 100%;
  height: 150px;
  border-radius: 14px;
  margin-top: auto;
  border: 1px solid rgba(94, 234, 212, 0.14);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.bento-card__visual {
  object-fit: cover;
  object-position: top center;
  border-color: rgba(74, 251, 229, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bento-card:hover .bento-card__visual { transform: translateY(-3px) scale(1.02); }

/* Gráfico decorativo para tarjetas sin captura */
.bento-card__art {
  background:
    radial-gradient(120% 130% at 22% 8%, rgba(74, 251, 229, 0.16), transparent 55%),
    linear-gradient(160deg, rgba(30, 42, 58, 0.85), rgba(14, 20, 32, 0.92));
  display: grid;
  place-items: center;
}

.bento-card__art::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(94, 234, 212, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 28% 26%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 28% 26%, #000, transparent 72%);
}

.bento-card__art svg {
  position: relative;
  width: 46px;
  height: 46px;
  color: rgba(94, 234, 212, 0.55);
  filter: drop-shadow(0 0 14px rgba(74, 251, 229, 0.3));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bento-card:hover .bento-card__art svg { transform: scale(1.12) rotate(-4deg); }

.bento-card--wide .bento-card__visual { height: 160px; }
.bento-card--feature { justify-content: flex-start; }
.bento-card--feature .bento-card__visual { height: 190px; border-color: rgba(255, 255, 255, 0.16); }

@media (prefers-reduced-motion: reduce) {
  .bento-card,
  .bento-card__icon { transition: none; }
  .bento-card { opacity: 1; transform: none; }
  .bento-card:hover { transform: none; }
  .bento-stage::before,
  .bento-stage::after,
  .bento-card--feature .bento-aurora { animation: none; }
}

/* ==========================================================================
   GRID global de fondo — visible en toda la página (fijo al viewport)
   ========================================================================== */
body.mdf-site::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(94, 234, 212, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(94, 234, 212, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 30%, #000 55%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 30%, #000 55%, rgba(0, 0, 0, 0.35) 100%);
}

/* ==========================================================================
   HERO premium FX — Spotlight + Aurora + Grid (adaptado de Aceternity UI)
   ========================================================================== */
.hero-landing { position: relative; }
.hero-landing > .hero-grid { position: relative; z-index: 2; }

.hero-fx {
  position: absolute;
  top: -110px;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100%;
  height: calc(100% + 180px);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Rejilla técnica que se desvanece hacia los bordes */
.hero-fx__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(94, 234, 212, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(94, 234, 212, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 40% 0%, #000 20%, transparent 74%);
  mask-image: radial-gradient(ellipse 80% 70% at 40% 0%, #000 20%, transparent 74%);
}

/* Haz de luz tipo Spotlight — cono de luz que entra desde arriba-izquierda */
.hero-fx__spot {
  position: absolute;
  top: -42%;
  left: -18%;
  width: 68%;
  height: 165%;
  background:
    radial-gradient(ellipse 42% 50% at center, rgba(74, 251, 229, 0.32), rgba(72, 209, 191, 0.08) 46%, transparent 64%);
  filter: blur(40px);
  transform: rotate(-28deg) translateX(-40px);
  opacity: 0;
  animation: heroSpot 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
  mix-blend-mode: screen;
}

@keyframes heroSpot {
  to { opacity: 1; transform: rotate(-28deg) translateX(0); }
}

/* Aurora que flota al otro lado */
.hero-fx__aurora {
  position: absolute;
  top: -24%;
  right: -8%;
  width: 52%;
  height: 100%;
  background: radial-gradient(circle at 60% 38%, rgba(34, 211, 238, 0.22), transparent 60%);
  filter: blur(58px);
  animation: bentoFloatB 16s ease-in-out infinite;
  mix-blend-mode: screen;
}

/* Realce del titular */
.hero-landing h1 .grad-text {
  background: linear-gradient(120deg, #5eead4 0%, #4afbe5 45%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(74, 251, 229, 0.25));
}

@media (prefers-reduced-motion: reduce) {
  .hero-fx__spot { animation: none; opacity: 1; transform: rotate(-32deg); }
  .hero-fx__aurora { animation: none; }
}
