/* =====================================================================
   MyRentAr · V91 — Sistema de diseño + motion del sitio público
   Tokens, botones unificados y clases de animación (activadas por
   /ui/public-motion.js). Todo respeta prefers-reduced-motion.
   ===================================================================== */

:root {
  --navy: #07172f;
  --navy-deep: #050f1f;
  --navy-soft: #0b2a49;
  --gold: #f6a000;
  --gold-hover: #d98b00;
  --ivory: #f7f5f0;
  --aqua: #2dd4bf;
  --smoke: #f4f6f9;
  --ink: #0f172a;
  --muted: #64748b;
}

/* ---------------------------------------------------------------------
   BOTONES UNIFICADOS
--------------------------------------------------------------------- */
.btn-gold, .btn-navy, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 1rem; padding: .95rem 1.75rem;
  font-weight: 800; font-size: .95rem; line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  position: relative; overflow: hidden; cursor: pointer; text-decoration: none;
}
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 10px 28px rgba(246,160,0,.28); }
.btn-gold:hover { background: var(--gold-hover); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(246,160,0,.36); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: 0 10px 28px rgba(7,23,47,.22); }
.btn-navy:hover { background: var(--navy-soft); transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); transform: translateY(-2px); }
.btn-ghost.on-light { color: var(--navy); border-color: rgba(7,23,47,.18); background: rgba(7,23,47,.03); }
.btn-ghost.on-light:hover { background: rgba(7,23,47,.07); }

/* Barrido de luz en CTAs principales */
.shine::after {
  content: ''; position: absolute; top: 0; left: -80%; width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg); transition: left .6s ease; pointer-events: none;
}
.shine:hover::after { left: 130%; }

/* ---------------------------------------------------------------------
   REVEAL ON SCROLL (el JS agrega .rv-in al entrar en viewport)
--------------------------------------------------------------------- */
.rv, .rv-up, .rv-left, .rv-right, .rv-scale {
  opacity: 0;
  transition: opacity .7s cubic-bezier(.22,.9,.3,1), transform .7s cubic-bezier(.22,.9,.3,1);
  transition-delay: var(--rv-delay, 0s);
  will-change: opacity, transform;
}
.rv, .rv-up { transform: translateY(26px); }
.rv-left   { transform: translateX(-32px); }
.rv-right  { transform: translateX(32px); }
.rv-scale  { transform: scale(.94); }
.rv-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------
   GLASSMORPHISM + HERO
--------------------------------------------------------------------- */
.glass {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.glass-inner { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); }

/* Trama de líneas tenue para heroes oscuros */
.hero-grid {
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 45%, transparent 100%);
}

/* Spotlight que sigue el mouse (JS actualiza --mx / --my) */
.spot::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(520px circle at var(--mx, 60%) var(--my, 40%), rgba(45,212,191,.09), transparent 65%);
  transition: background .25s ease;
}

/* Gradiente radial animado lento del hero */
@keyframes mraHeroDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(4%, -3%) scale(1.06); }
  100% { transform: translate(0, 0) scale(1); }
}
.hero-blob { animation: mraHeroDrift 16s ease-in-out infinite; will-change: transform; }

/* ---------------------------------------------------------------------
   ESTADOS / BADGES
--------------------------------------------------------------------- */
.pulse-dot { position: relative; display: inline-flex; width: .55rem; height: .55rem; border-radius: 999px; background: var(--aqua); }
.pulse-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 999px;
  border: 2px solid rgba(45,212,191,.5); animation: mraPulse 1.8s ease-out infinite;
}
.pulse-dot.gold { background: var(--gold); }
.pulse-dot.gold::after { border-color: rgba(246,160,0,.5); }
@keyframes mraPulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

/* Efecto de escaneo IA (líneas de documento que se leen) */
@keyframes mraScan { 0% { transform: translateY(-110%); } 100% { transform: translateY(240%); } }
.scan-wrap { position: relative; overflow: hidden; }
.scan-line {
  position: absolute; left: 0; right: 0; height: 42%;
  background: linear-gradient(180deg, transparent, rgba(45,212,191,.14), transparent);
  animation: mraScan 3.2s ease-in-out infinite; pointer-events: none;
}

/* ---------------------------------------------------------------------
   TIMELINE (cómo funciona / expediente)
--------------------------------------------------------------------- */
.draw-line { position: relative; }
.draw-line .track { position: absolute; background: rgba(7,23,47,.1); }
.draw-line .fill {
  position: absolute; background: linear-gradient(90deg, var(--gold), var(--aqua));
  width: 0; transition: width 1.4s cubic-bezier(.22,.9,.3,1) .2s;
}
.draw-line.rv-in .fill, .draw-line.drawn .fill { width: 100%; }

/* Pasos del expediente del hero (JS los va tildando en loop) */
.exp-step { display: flex; align-items: center; gap: .6rem; opacity: .38; transition: opacity .45s ease; }
.exp-step .exp-check {
  display: grid; place-items: center; width: 1.35rem; height: 1.35rem; flex: none;
  border-radius: 999px; border: 1.5px solid rgba(255,255,255,.35);
  font-size: .65rem; color: transparent; transition: all .45s ease;
}
.exp-step.done { opacity: 1; }
.exp-step.done .exp-check { background: var(--aqua); border-color: var(--aqua); color: var(--navy); }

/* ---------------------------------------------------------------------
   TILT 3D (JS controla las variables)
--------------------------------------------------------------------- */
.tilt-wrap { perspective: 900px; }
[data-tilt] { transform: rotateX(var(--tx, 0)) rotateY(var(--ty, 0)); transition: transform .25s ease; transform-style: preserve-3d; will-change: transform; }

/* ---------------------------------------------------------------------
   HEADER SCROLLED (el JS agrega .scrolled)
--------------------------------------------------------------------- */
header.mra-public-header { transition: box-shadow .25s ease, padding .25s ease, background .25s ease; }
header.mra-public-header.scrolled { box-shadow: 0 8px 30px rgba(7,23,47,.1); background: rgba(255,255,255,.97) !important; }

/* ---------------------------------------------------------------------
   CARDS / IMÁGENES
--------------------------------------------------------------------- */
.card-lift { transition: transform .25s ease, box-shadow .25s ease; }
.card-lift:hover { transform: translateY(-6px); box-shadow: 0 26px 60px rgba(7,23,47,.14); }
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform .5s cubic-bezier(.22,.9,.3,1); }
.img-zoom:hover img { transform: scale(1.05); }

/* Contadores: tabular para que no "salten" los dígitos */
[data-count] { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   ACCESIBILIDAD: sin movimiento
--------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .rv, .rv-up, .rv-left, .rv-right, .rv-scale { opacity: 1; transform: none; transition: none; }
  .hero-blob, .scan-line, .pulse-dot::after { animation: none; }
  .shine::after { display: none; }
  .draw-line .fill { width: 100%; transition: none; }
  [data-tilt] { transform: none !important; }
  .exp-step { opacity: 1; }
  .exp-step .exp-check { background: var(--aqua); border-color: var(--aqua); color: var(--navy); }
}
