/* Reverso · Moxen — los estilos del efecto y de la demostración. */
:root {
  --rv-fondo: #0a0a0a;
  --rv-texto: #f4f4f4;
  --rv-tinta: #0a0a0a;                     /* lo que va sobre el botón blanco */
  --rv-suave: rgba(255, 255, 255, .52);
  --rv-linea: rgba(255, 255, 255, .1);
  --rv-campo-1: rgba(255, 255, 255, .06);
  --rv-campo-2: rgba(255, 255, 255, .025);
  --rv-filo: rgba(255, 255, 255, .08);
  --rv-anillo: rgba(255, 255, 255, .1);
  --rv-bien: #2fbf71;
  --rv-luz: rgba(255, 255, 255, .05);      /* la luz de la escena, detrás de la tarjeta */
  /* la tarjeta es un objeto: titanio oscuro cepillado en los dos temas */
  --rv-metal-1: #3a3b3f;
  --rv-metal-2: #1c1d20;
  --rv-metal-3: #0b0c0d;
  --rv-relieve: #e6e6e6;
  --rv-sombra: rgba(0, 0, 0, .9);
  --rv-ancho: 480px;
}
:root[data-tema="claro"] {
  --rv-fondo: #eeeeee;
  --rv-texto: #0a0a0a;
  --rv-tinta: #f4f4f4;
  --rv-suave: rgba(0, 0, 0, .52);
  --rv-linea: rgba(0, 0, 0, .1);
  --rv-campo-1: #ffffff;
  --rv-campo-2: #f8f8f8;
  --rv-filo: rgba(255, 255, 255, 1);
  --rv-anillo: rgba(0, 0, 0, .07);
  --rv-bien: #1f9d5a;
  --rv-luz: rgba(255, 255, 255, .8);
  --rv-sombra: rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--rv-fondo); color: var(--rv-texto); }
body { font-family: "General Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

/* ── el efecto ─────────────────────────────────────────────────────── */
/* El escenario da la perspectiva y mide la tarjeta: todo lo de dentro va
   en cqw (centésimas de su ancho), así la tarjeta escala entera. La
   tarjeta la gira reverso.js: inclinación hacia el puntero y la vuelta,
   con resortes. */
.rv-escenario { position: relative; flex: none; width: var(--rv-ancho); aspect-ratio: 1.586; perspective: 1600px; container-type: inline-size; }
.rv-carta { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
/* la sombra sobre la mesa: se abre y se aclara cuando la tarjeta se alza */
.rv-sombra {
  position: absolute; left: 4%; right: 4%; bottom: -12%; height: 34%; border-radius: 50%; will-change: transform, opacity;
  background: radial-gradient(closest-side, var(--rv-sombra), transparent);
}
/* el canto: unas láminas entre las dos caras, que se ven cuando está de lado */
.rv-canto { position: absolute; inset: 0; border-radius: 4.6cqw; background: linear-gradient(90deg, #4a4b4f, #1a1a1c 30%, #2c2d30 70%, #4a4b4f); }

.rv-cara {
  position: absolute; inset: 0; overflow: hidden; border-radius: 4.6cqw; color: var(--rv-relieve);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: radial-gradient(140% 120% at 0% 0%, var(--rv-metal-1), var(--rv-metal-2) 52%, var(--rv-metal-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.rv-frente { transform: translateZ(1.2px); }
.rv-dorso { transform: rotateY(180deg) translateZ(1.2px); }
/* el cepillado: vetas horizontales de ruido, fundidas con el metal */
.rv-cara::before {
  content: ""; position: absolute; inset: 0; opacity: .7; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0025 .85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 0' /%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 .55'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='600' height='300' filter='url(%23c)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='300'%3E%3Cfilter id='v'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.002 .6' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='600' height='300' filter='url(%23v)' opacity='.35'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
/* las luces que pone reverso.js: el brillo especular que corre con el
   giro y la sombra de la cara cuando se pone de canto */
.rv-brillo {
  position: absolute; left: -60%; top: -60%; width: 220%; height: 220%; pointer-events: none; will-change: transform;
  background:
    linear-gradient(112deg, transparent 40%, rgba(255, 255, 255, .06) 45.5%, rgba(255, 255, 255, .2) 49.5%, rgba(255, 255, 255, .05) 53%, transparent 58%),
    radial-gradient(22% 30% at 50% 50%, rgba(255, 255, 255, .12), transparent 70%);
}
.rv-tono { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; will-change: opacity; }
.rv-barrido {
  position: absolute; top: -30%; bottom: -30%; left: 0; width: 34%; opacity: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .32) 50%, transparent);
}
.rv-roseta { position: absolute; right: -14cqw; top: -26cqw; width: 78cqw; height: 78cqw; fill: none; stroke: rgba(255, 255, 255, .045); stroke-width: .3; pointer-events: none; }

.rv-frente { display: flex; flex-direction: column; padding: 6.2cqw 6.4cqw 5.6cqw; }
/* el chip: paladio con sus contactos grabados */
.rv-chip {
  position: relative; width: 12.2cqw; height: 9.3cqw; border-radius: 1.9cqw;
  background: linear-gradient(135deg, #ececec, #a2a2a2 36%, #dadada 58%, #8a8a8a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 2px rgba(0, 0, 0, .55);
}
.rv-chip svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(0, 0, 0, .38); stroke-width: .9; }
.rv-sin-contacto {
  position: absolute; left: calc(6.4cqw + 15.6cqw); top: 7.5cqw; width: 6.4cqw; height: 6.4cqw;
  fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1.6; stroke-linecap: round;
}
/* las cifras en relieve: luz por arriba, sombra por debajo */
.rv-numero {
  position: relative; align-self: flex-start; display: flex; gap: 3.2cqw; margin: auto 0 4.4cqw; font-size: 5.8cqw; font-weight: 500; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; text-shadow: 0 -1px 0 rgba(255, 255, 255, .3), 0 1.5px 1px rgba(0, 0, 0, .85);
}
.rv-numero b { display: flex; font-weight: inherit; }
.rv-numero i { display: inline-block; width: .64em; font-style: normal; text-align: center; }
.rv-numero i.is-vacia { opacity: .32; }
.rv-pie { position: relative; display: flex; justify-content: space-between; align-items: flex-end; }
.rv-pie p { margin: 0; display: flex; flex-direction: column; gap: 1cqw; font-size: 3.5cqw; font-weight: 500; letter-spacing: .1em; text-shadow: 0 -1px 0 rgba(255, 255, 255, .25), 0 1px 1px rgba(0, 0, 0, .8); }
.rv-pie p:last-child { text-align: right; }
.rv-pie small { font-size: 1.9cqw; letter-spacing: .22em; text-transform: uppercase; opacity: .55; text-shadow: none; }
.rv-pie span { display: block; white-space: nowrap; }

.rv-banda {
  position: absolute; left: 0; right: 0; top: 7.6cqw; height: 11.6cqw;
  background: linear-gradient(#050505, #1c1c1c 45%, #060606); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 0 rgba(255, 255, 255, .04);
}
.rv-leyenda { position: absolute; right: 6.4cqw; top: 23.4cqw; margin: 0; font-size: 1.9cqw; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; opacity: .6; }
.rv-firma {
  position: absolute; left: 6.4cqw; right: 6.4cqw; top: 27.6cqw; height: 10.6cqw; display: flex; justify-content: flex-end; border-radius: 1.2cqw;
  background: repeating-linear-gradient(-55deg, #e2e2e2 0 1.1cqw, #d0d0d0 1.1cqw 2.2cqw); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}
.rv-firma span {
  min-width: 18cqw; display: grid; place-items: center; padding: 0 2.6cqw; border-radius: 0 1.2cqw 1.2cqw 0; background: #fbfbfb;
  color: #111; font-size: 4.4cqw; font-weight: 600; font-style: italic; letter-spacing: .16em; box-shadow: -1px 0 0 rgba(0, 0, 0, .1);
}
/* el holograma: un tornasol gris que gira con la tarjeta (reverso.js mueve --rv-holo) */
.rv-holo { position: absolute; left: 6.4cqw; bottom: 6.2cqw; width: 15cqw; height: 9.6cqw; overflow: hidden; border-radius: 1.4cqw; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.rv-holo::before {
  content: ""; position: absolute; inset: -60%; transform: rotate(var(--rv-holo, 0deg));
  background: conic-gradient(#5c5c5c, #efefef, #7c7c7c, #fafafa, #555, #cfcfcf, #6a6a6a, #e6e6e6, #5c5c5c);
}
.rv-holo::after { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 30% 120%, transparent 0 2px, rgba(0, 0, 0, .12) 2px 3px); }
.rv-letra { position: absolute; right: 6.4cqw; bottom: 6.8cqw; display: flex; flex-direction: column; align-items: flex-end; gap: 1.4cqw; }
.rv-letra i { display: block; height: .9cqw; border-radius: 1cqw; background: rgba(255, 255, 255, .13); }
.rv-letra i:nth-child(1) { width: 40cqw; }
.rv-letra i:nth-child(2) { width: 31cqw; }
.rv-letra i:nth-child(3) { width: 22cqw; }

/* el visor: cuatro esquinas que se deslizan hasta la zona que llenas */
.rv-foco { position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; transition: opacity .3s; }
.rv-foco.is-visible { opacity: 1; }
.rv-foco i {
  position: absolute; left: 0; top: 0; width: 13px; height: 13px; border: 0 solid rgba(255, 255, 255, .92);
  transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}
.rv-foco i:nth-child(1) { border-width: 2px 0 0 2px; border-top-left-radius: 6px; }
.rv-foco i:nth-child(2) { border-width: 2px 2px 0 0; border-top-right-radius: 6px; }
.rv-foco i:nth-child(3) { border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }
.rv-foco i:nth-child(4) { border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }

/* ── la demostración ───────────────────────────────────────────────── */
.rv-escena {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background: radial-gradient(40% 50% at 32% 50%, var(--rv-luz), transparent 70%);
}
.rv-pago { display: flex; align-items: center; gap: 80px; }
/* minmax(0, …): sin él, el ancho mínimo de los campos ensancharía la grilla en pantallas chicas */
.rv-formulario { width: 400px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 14px; }
.rv-ancho { grid-column: 1 / -1; }
.rv-aviso { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 0 0 4px; color: var(--rv-suave); font-size: 14px; }
.rv-aviso svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rv-campo { display: flex; flex-direction: column; gap: 8px; color: var(--rv-suave); font-size: 14px; font-weight: 500; }
.rv-campo input {
  width: 100%; min-width: 0; height: 58px; padding: 0 18px; border: 0; border-radius: 16px; outline: none; color: var(--rv-texto);
  background: linear-gradient(var(--rv-campo-1), var(--rv-campo-2));
  box-shadow: inset 0 1px 0 var(--rv-filo), inset 0 0 0 1px var(--rv-linea), 0 1px 2px rgba(0, 0, 0, .2);
  font: inherit; font-size: 18px; font-weight: 500; letter-spacing: .01em; font-variant-numeric: tabular-nums; transition: box-shadow .25s;
}
.rv-campo input::placeholder { color: var(--rv-suave); opacity: .5; }
.rv-campo input:focus { box-shadow: inset 0 0 0 1.5px var(--rv-texto), 0 0 0 5px var(--rv-anillo); }
.rv-pagar {
  position: relative; height: 60px; margin-top: 6px; overflow: hidden; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--rv-texto); color: var(--rv-tinta); font: inherit; font-size: 18px; font-weight: 600;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 14px 30px -14px var(--rv-sombra);
  transition: background-color .35s, color .35s, transform .4s cubic-bezier(.34, 1.56, .64, 1);
}
.rv-pagar:active { transform: scale(.97); }
.rv-pagar:focus-visible { outline: 2px solid var(--rv-suave); outline-offset: 4px; }
.rv-pagar > span { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 8px; transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .3s; }
.rv-pagar > span + span { transform: translateY(100%); opacity: 0; }
.rv-pagar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.rv-pagar path { stroke-dasharray: 1 1.2; stroke-dashoffset: 1.1; }
.rv-pagar.is-listo { background: var(--rv-bien); color: #fff; }
.rv-pagar.is-listo > span:first-child { transform: translateY(-100%); opacity: 0; }
.rv-pagar.is-listo > span + span { transform: none; opacity: 1; }
.rv-pagar.is-listo path { stroke-dashoffset: 0; transition: stroke-dashoffset .4s cubic-bezier(.65, 0, .35, 1) .2s; }

@media (max-width: 960px) {
  :root { --rv-ancho: min(480px, calc(100vw - 2rem)); }
  .rv-pago { flex-direction: column; gap: 40px; }
  .rv-formulario { width: var(--rv-ancho); }
  .rv-escena { background: radial-gradient(60% 30% at 50% 25%, var(--rv-luz), transparent 70%); }
}
@media (prefers-reduced-motion: reduce) {
  .rv-foco i { transition-duration: .01s; }
}
