/* ==========================================================================
   Compra de cursos con Stripe: ventana de compra (.cmp, la agrega renderer.js en las
   páginas con botón "Comprar curso") y página /compra/gracias (.cmpg).
   La ventana vive fuera de .rd-pagina, así que define aquí sus propios valores.
   ========================================================================== */
.cmp { position: fixed; inset: 0; z-index: 12000; /* encima del menú (4000), la franja (5000) y los botones flotantes */ display: grid; place-items: center; padding: 16px; background: rgb(18 18 18 / 62%); font-family: 'Poppins', 'Poppins Fallback', sans-serif; color: #121212; }
.cmp[hidden] { display: none; }
.cmp-caja { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 32px 28px 26px; border-radius: 24px; background: #fff; box-shadow: 0 30px 70px rgb(18 18 18 / 30%); }
.cmp-cerrar { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #dcdde3; border-radius: 50%; background: #fff; color: #121212; font-size: 22px; line-height: 1; cursor: pointer; }
.cmp-cerrar:hover { background: #121212; color: #fff; }
.cmp-ceja { margin: 0 0 4px; color: #7a34d4; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.cmp h2 { margin: 0 40px 20px 0; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }

.cmp-form { position: relative; display: grid; gap: 14px; margin: 0; }
.cmp-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cmp-campo { display: grid; gap: 6px; margin: 0; font-size: 14px; font-weight: 600; }
.cmp-campo :is(input, select) { width: 100%; min-height: 48px; margin: 0; padding: 10px 14px; border: 1.5px solid #dcdde3; border-radius: 12px; background: #fff; color: #121212; font: 400 16px/1.3 inherit; font-family: inherit; box-sizing: border-box; box-shadow: none; }
.cmp-campo :is(input, select):focus { border-color: #ac64fd; outline: 3px solid rgb(172 100 253 / 22%); outline-offset: 0; }
.cmp-campo :is(input, select)[aria-invalid="true"] { border-color: #d33a4a; }
.cmp-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 14px; font-weight: 400; line-height: 1.45; cursor: pointer; }
.cmp-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #7a34d4; }
.cmp-check small { color: #5b5b66; }
.cmp-check a { color: #7a34d4; font-weight: 600; }
.cmp-factura { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid #dcdde3; border-radius: 16px; background: #f5f6fa; }
.cmp-factura[hidden] { display: none; }
.cmp-factura legend { padding: 0 6px; font-size: 13px; font-weight: 700; }

.cmp-resumen { display: grid; gap: 6px; margin: 4px 0 0; padding: 16px; border-radius: 16px; background: linear-gradient(120deg, #f4effc, #e9e0fa); }
.cmp-resumen div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.cmp-resumen div[hidden] { display: none; }
.cmp-resumen dt { color: #5b5b66; }
.cmp-resumen dd { margin: 0; font-weight: 600; }
.cmp-resumen__total { margin-top: 4px; padding-top: 10px; border-top: 1px solid rgb(18 18 18 / 12%); }
.cmp-resumen__total dt, .cmp-resumen__total dd { color: #121212; font-size: 18px; font-weight: 700; }

.cmp-estado { min-height: 1.4em; margin: 0; font-size: 14px; }
.cmp-estado.is-error { color: #c0293a; }
.cmp-estado.is-ok { color: #121212; }
/* styles.css pinta todos los button[type="submit"] con degradado: este conserva su estilo. */
.cmp button[type="submit"].cmp-pagar { width: 100%; min-height: 54px; margin: 0; border-radius: 14px; background: #121212; color: #fff; font-size: 16px; }
.cmp button[type="submit"].cmp-pagar:disabled { opacity: .6; cursor: wait; transform: none; }
.cmp-campo small { color: #5b5b66; font-weight: 400; }
.cmp-campo input[name="cupon"] { text-transform: uppercase; letter-spacing: .06em; }
.cmp-nota-cupon { margin: 0 0 -6px; color: #5b5b66; font-size: 13px; }
.cmp-seguro { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: #5b5b66; font-size: 13px; text-align: center; }
.cmp-seguro svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Aviso al volver de Stripe sin pagar (?compra=cancelada) */
.cmp-aviso { position: fixed; z-index: 12001; left: 50%; bottom: 24px; width: min(460px, calc(100% - 32px)); padding: 14px 18px; border-radius: 14px; background: #121212; color: #fff; font: 500 14px/1.5 'Poppins', sans-serif; box-shadow: 0 16px 40px rgb(18 18 18 / 30%); transform: translateX(-50%); }

/* ---------- /compra/gracias ---------- */
.cmpg-hero { position: relative; overflow: hidden; padding-block: clamp(130px, 12vw, 170px) clamp(64px, 8vw, 104px); }
.cmpg-hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(38% 50% at 90% 10%, rgb(172 100 253 / 16%), transparent 70%),
  radial-gradient(34% 46% at 6% 80%, rgb(95 254 221 / 20%), transparent 70%); pointer-events: none; }
.cmpg-caja { position: relative; max-width: 680px; text-align: center; }
.cmpg-icono { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--rd-turquesa), var(--rd-morado)); }
.cmpg-icono--espera { background: var(--rd-papel); }
.cmpg-icono svg { width: 38px; fill: none; stroke: var(--rd-tinta); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cmpg-hero h1 { margin-bottom: 14px; font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.cmpg-lema { margin-bottom: 28px; color: var(--rd-texto-suave); font-size: 18px; line-height: 1.6; }
.cmpg-datos { display: grid; gap: 0; margin: 0 auto 28px; padding: 8px 22px; border-radius: 20px; background: var(--rd-blanco); box-shadow: var(--rd-sombra); text-align: left; }
.cmpg-datos div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rd-borde); }
.cmpg-datos div:last-child { border-bottom: 0; }
.cmpg-datos dt { color: var(--rd-texto-suave); }
.cmpg-datos dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.cmpg-pasos { display: grid; gap: 10px; margin: 0 auto 32px; text-align: left; counter-reset: paso; }
.cmpg-pasos li { position: relative; padding-left: 40px; line-height: 1.5; counter-increment: paso; }
.cmpg-pasos li::before { content: counter(paso); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--rd-lila); color: var(--rd-morado-texto); font-size: 13px; font-weight: 700; }
.cmpg-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

@media (max-width: 600px) {
  .cmp { padding: 0; place-items: end stretch; }
  .cmp-caja { width: 100%; max-height: 92dvh; padding: 28px 20px 22px; border-radius: 24px 24px 0 0; }
  .cmpg-acciones .rd-boton { width: 100%; }
}
