/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   [JD 01/11/2026] ACCESO Y REGISTRO — REDISEÑO EN 5 FASES + CUENTAS DE EMPRESA.
   Lo cargan SOLO las vistas del tema ecommerce/customers/login y register (con <link> propio), así que
   no hace falta body:has(): todo cuelga de .jd-acceso, la envoltura que ponen esas vistas. Se apoya en
   el rediseño de agosto que sigue en jd-polish (campos, iconos, botón-tecla) y le gana con
   `html body .jd-acceso …` (más fuerte que `body:has(.auth-card) …` y que `.auth-card …`).
   Colores: solo el del tema (--jdc, lo pone la vista con theme_option('primary_color')), blanco y grises;
   los tonos oscuros salen del propio azul con color-mix. Sin rejilla, sin rayas de colores.
   El NOMBRE del archivo lleva huella: Cloudflare guarda /themes 10 años; al editarlo, nombre nuevo.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── FASE 1 · Dos columnas: la marca a la izquierda, el formulario a la derecha ───────────────────── */
html body .jd-acceso {
    --jdc: var(--tp-theme-primary, #0C55AA);
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    max-width: 1060px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 26px;
    /* clip y no hidden: hidden crea un contenedor de desplazamiento y anula el sticky de la marca. */
    overflow: hidden;
    overflow: clip;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 34px 70px -42px color-mix(in srgb, var(--jdc) 55%, rgba(16, 24, 40, .6));
    animation: jdAccesoEntra .5s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes jdAccesoEntra {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

html body .jd-acceso__marca {
    position: relative;
    overflow: hidden;
    overflow: clip;
    color: #fff;
    background:
        radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, #fff 16%, transparent), transparent 60%),
        linear-gradient(165deg, var(--jdc), color-mix(in srgb, var(--jdc) 62%, #000));
}
/* ADN de la casa: △ ○ ✕ □ en contorno, muy tenues, en una esquina. */
html body .jd-acceso__marca::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 260px;
    height: 260px;
    opacity: .12;
    pointer-events: none;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23fff' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M50 22L82 76H18Z'/%3E%3Ccircle cx='150' cy='50' r='30'/%3E%3Cpath d='M24 126l52 52M76 126l-52 52'/%3E%3Crect x='122' y='124' width='56' height='56' rx='8'/%3E%3C/svg%3E");
}
html body .jd-acceso__marca-in {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 46px 42px 40px;
    /* El formulario de registro es largo: la marca acompaña al bajar en vez de quedarse arriba. */
    position: sticky;
    top: 90px;
}
html body .jd-acceso__kicker {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, #fff 14%, transparent);
    border: 1px solid color-mix(in srgb, #fff 24%, transparent);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #fff !important;
}
html body .jd-acceso__titulo {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: #fff;
}
html body .jd-acceso__lema {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.55;
    color: color-mix(in srgb, #fff 86%, transparent);
}
html body .jd-acceso__lista {
    list-style: none;
    margin: 4px 0 6px;
    padding: 0;
    display: grid;
    gap: 12px;
}
html body .jd-acceso__lista li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.35;
    color: #fff;
}
html body .jd-acceso__lista svg {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 10px;
    background: color-mix(in srgb, #fff 14%, transparent);
    border: 1px solid color-mix(in srgb, #fff 22%, transparent);
}
html body .jd-acceso__empresa {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    color: #101828;
    text-decoration: none;
    box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .55);
}
html body .jd-acceso__empresa strong { display: block; font-size: 14.5px; color: #101828; }
html body .jd-acceso__empresa p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: #475467; }
html body .jd-acceso__empresa-ico {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--jdc) 10%, #fff);
    color: var(--jdc);
}
html body .jd-acceso__empresa--enlace { transition: transform .15s ease, box-shadow .15s ease; }
html body .jd-acceso__empresa--enlace:hover { color: #101828; transform: translateY(-2px); }
html body .jd-acceso__flecha { margin-left: auto; align-self: center; color: var(--jdc); }
html body .jd-acceso__mayor {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: color-mix(in srgb, #fff 88%, transparent);
    text-decoration: none;
}
html body .jd-acceso__mayor:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ── FASE 2 · La tarjeta del formulario se funde con la marca ────────────────────────────────────── */
html body .jd-acceso__form { min-width: 0; }
html body .jd-acceso__form > .container,
html body .jd-acceso__form .container { max-width: none; padding: 0; }
html body .jd-acceso__form .row { margin: 0; padding: 0 !important; }
html body .jd-acceso__form .row > [class*="col-"] { flex: 1 1 auto; width: 100%; max-width: none; padding: 0; }
html body .jd-acceso .auth-card {
    max-width: none;
    height: 100%;
    margin: 0;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    animation: none;
}
html body .jd-acceso .auth-card .auth-card__header { padding: 38px 40px 0; }
html body .jd-acceso .auth-card .auth-card__header > div {
    flex-direction: row !important;
    align-items: center !important;
    text-align: left;
    gap: 14px !important;
}
html body .jd-acceso .auth-card .auth-card__header-title { font-size: 22px !important; margin: 0 !important; }
/* La frase genérica del plugin sobra: la marca ya se presenta a la izquierda. */
html body .jd-acceso .auth-card .auth-card__header-description { display: none; }
html body .jd-acceso .auth-card .auth-card__body { padding: 24px 40px 36px; }

/* ── FASE 3 · Selector Persona / Empresa ─────────────────────────────────────────────────────────── */
html body .jd-tipo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 20px;
}
html body .jd-tipo-op { position: relative; display: block; margin: 0; cursor: pointer; }
html body .jd-tipo-op input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
html body .jd-tipo-caja {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 66px;
    /* A la derecha queda sitio para la marca de elegido, que tapaba el título en el teléfono. */
    padding: 11px 30px 11px 12px;
    border: 1.5px solid #e3e7ee;
    border-radius: 15px;
    background: #fff;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
html body .jd-tipo-op:hover .jd-tipo-caja { border-color: color-mix(in srgb, var(--jdc) 40%, #fff); }
html body .jd-tipo-ico {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--jdc) 9%, #fff);
    color: var(--jdc);
    transition: background-color .15s ease, color .15s ease;
}
html body .jd-tipo-txt { min-width: 0; }
html body .jd-tipo-txt strong { display: block; font-size: 14.5px; font-weight: 700; color: #101828; line-height: 1.2; }
html body .jd-tipo-txt small { display: block; margin-top: 2px; font-size: 12px; color: #667085; line-height: 1.3; }
html body .jd-tipo-marca {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--jdc);
    color: #fff;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .15s ease, transform .15s ease;
}
html body .jd-tipo-op input:checked + .jd-tipo-caja {
    border-color: var(--jdc);
    background: color-mix(in srgb, var(--jdc) 5%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--jdc) 14%, transparent);
}
html body .jd-tipo-op input:checked + .jd-tipo-caja .jd-tipo-ico { background: var(--jdc); color: #fff; }
html body .jd-tipo-op input:checked + .jd-tipo-caja .jd-tipo-marca { opacity: 1; transform: none; }
html body .jd-tipo-op input:focus-visible + .jd-tipo-caja { outline: 2px solid var(--jdc); outline-offset: 2px; }

/* ── FASE 4 · Bloque «Datos de la empresa» ───────────────────────────────────────────────────────── */
html body .jd-emp[hidden] { display: none !important; }
html body .jd-emp {
    margin: 4px 0 18px;
    padding: 16px 16px 2px;
    border: 1px solid color-mix(in srgb, var(--jdc) 22%, #fff);
    border-radius: 16px;
    background: color-mix(in srgb, var(--jdc) 3%, #fff);
    animation: jdEmpEntra .25s ease both;
}
@keyframes jdEmpEntra { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
html body .jd-emp-tit {
    /* Dentro del recuadro, no montado sobre el borde como hace <legend> por defecto. */
    float: left;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 6px;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--jdc);
}
html body .jd-emp-nota {
    clear: both;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0 0 14px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #475467;
}
html body .jd-emp-nota svg { flex: 0 0 15px; margin-top: 1px; color: var(--jdc); }
html body .jd-emp-fila { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; }
html body .jd-emp-opc { font-weight: 400; color: #98a2b3; }
html body .jd-emp .form-control,
html body .jd-emp .form-select { background-color: #fff; }

/* ── FASE 5 · Teléfono y accesibilidad ───────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    html body .jd-acceso { grid-template-columns: 1fr; border-radius: 22px; }
    html body .jd-acceso__marca-in { padding: 24px 22px 22px; gap: 8px; position: relative; top: auto; }
    html body .jd-acceso__titulo { font-size: 25px; }
    html body .jd-acceso__lema { font-size: 14px; margin: 0; }
    /* En el teléfono el formulario va primero: de la marca solo queda el saludo. */
    html body .jd-acceso__lista,
    html body .jd-acceso__mayor,
    html body .jd-acceso__marca::after { display: none; }
    html body .jd-acceso__empresa { margin-top: 8px; padding: 11px 12px; }
    html body .jd-acceso--registro .jd-acceso__empresa { display: none; }
    html body .jd-acceso .auth-card .auth-card__header { padding: 22px 20px 0; }
    html body .jd-acceso .auth-card .auth-card__body { padding: 18px 20px 26px; }
}
@media (max-width: 420px) {
    html body .jd-tipo { gap: 8px; }
    html body .jd-tipo-caja { padding: 10px 26px 10px 10px; gap: 9px; min-height: 60px; }
    html body .jd-tipo-ico { flex-basis: 34px; width: 34px; height: 34px; }
    html body .jd-tipo-txt small { font-size: 11px; }
    html body .jd-emp-fila { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
    html body .jd-acceso,
    html body .jd-emp { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   [JD 01/11/2026] TRES FASES MÁS + CONTRASTE (el dueño: «3 fases más al registro y login; algunas
   letras se ven oscuras»). Medido en escritorio: el rótulo «Juego Digital Store» del panel azul salía
   en AZUL sobre azul (contraste 1:1) porque el script de la insignia de tienda oficial envuelve ese
   nombre en un <span data-jd-oficial> con el color del tema. Y cinco textos grises claros quedaban por
   debajo de 3:1 sobre blanco.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Contraste ───────────────────────────────────────────────────────────────────────────────────── */
html body .jd-acceso__marca [data-jd-oficial],
html body .jd-acceso__marca [data-jd-oficial] * { color: inherit !important; -webkit-text-fill-color: currentColor !important; background: none !important; }
html body .jd-tipo-txt small { color: #5b6b7f; }
html body .jd-emp-opc { color: #667085; }
html body .jd-acceso .login-options-title p { color: #5b6b7f !important; }
html body .jd-acceso .jd-docsel-vacio { color: #667085 !important; }

/* ── FASE 6 · Encabezado del formulario: icono relleno del tema y una línea de ayuda real ─────────── */
html body .jd-acceso .auth-card .auth-card__header-icon {
    background: var(--jdc) !important;
    border-color: var(--jdc) !important;
    box-shadow: 0 4px 0 color-mix(in srgb, var(--jdc) 68%, #000), 0 10px 20px -12px var(--jdc) !important;
}
html body .jd-acceso .auth-card .auth-card__header-icon svg { color: #fff !important; }
html body .jd-acceso .auth-card .auth-card__header-title { font-weight: 700 !important; color: #101828 !important; }
html body .jd-acceso__sub { margin: 3px 0 0; font-size: 14px; line-height: 1.45; color: #5b6b7f; }
html body .jd-acceso__lista li { animation: jdAccesoLi .5s cubic-bezier(.16, 1, .3, 1) both; }
html body .jd-acceso__lista li:nth-child(2) { animation-delay: .06s; }
html body .jd-acceso__lista li:nth-child(3) { animation-delay: .12s; }
html body .jd-acceso__lista li:nth-child(4) { animation-delay: .18s; }
@keyframes jdAccesoLi { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* ── FASE 7 · Contraseña: medidor de seguridad y aviso de que coinciden ──────────────────────────── */
html body .jd-clave { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
html body .jd-clave__barra { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
html body .jd-clave__barra i { height: 5px; border-radius: 99px; background: #e6ebf2; transition: background-color .2s ease; }
html body .jd-clave[data-n="1"] .jd-clave__barra i:nth-child(-n+1) { background: color-mix(in srgb, var(--jdc) 40%, #fff); }
html body .jd-clave[data-n="2"] .jd-clave__barra i:nth-child(-n+2) { background: color-mix(in srgb, var(--jdc) 62%, #fff); }
html body .jd-clave[data-n="3"] .jd-clave__barra i:nth-child(-n+3) { background: color-mix(in srgb, var(--jdc) 84%, #fff); }
html body .jd-clave[data-n="4"] .jd-clave__barra i { background: var(--jdc); }
html body .jd-clave__txt { min-width: 128px; text-align: right; font-size: 12.5px; font-weight: 600; color: #5b6b7f; }
html body .jd-clave[data-n="3"] .jd-clave__txt,
html body .jd-clave[data-n="4"] .jd-clave__txt { color: var(--jdc); }
html body .jd-coincide { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: #5b6b7f; }
html body .jd-coincide.ok { color: var(--jdc); }
html body .jd-coincide svg { flex: 0 0 14px; }

/* ── FASE 8 · Salidas y confianza ────────────────────────────────────────────────────────────────── */
/* El aviso de protección venía en una caja gris (estilo en línea del plugin): una línea discreta. */
html body .jd-acceso .honeypot-disclaimer {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent !important;
    padding: 0 !important;
    margin: 2px 0 14px !important;
    font-size: 12.5px;
    color: #5b6b7f;
    text-align: center;
}
/* «Otras formas de …» entre dos líneas. */
html body .jd-acceso .login-options-title p {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}
html body .jd-acceso .login-options-title p::before,
html body .jd-acceso .login-options-title p::after { content: ""; flex: 1; height: 1px; background: #e6ebf2; }
/* «¿Ya tienes una cuenta?» / «¿No tienes una cuenta?» como un pie suave. */
html body .jd-acceso .auth-card .auth-card__body .mt-3.text-center {
    margin-top: 16px !important;
    padding: 13px 14px;
    border-radius: 14px;
    background: #f6f8fb;
    font-size: 14px;
    color: #475467;
}
html body .jd-acceso__seguro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
    font-size: 12.5px;
    font-weight: 500;
    color: #5b6b7f;
}
html body .jd-acceso__seguro svg { flex: 0 0 15px; color: var(--jdc); }

@media (max-width: 991.98px) {
    html body .jd-acceso__sub { font-size: 13px; }
    html body .jd-clave__txt { min-width: 104px; }
}
@media (prefers-reduced-motion: reduce) {
    html body .jd-acceso__lista li { animation: none; }
}

/* ── Representante legal y documento de la empresa (el dueño: «pedimos datos del representante legal;
      también se puede pedir documento como Cámara de Comercio o LLC») ───────────────────────────── */
html body .jd-emp-sub {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 6px 0 10px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--jdc) 14%, #fff);
    font-size: 14px;
    font-weight: 700;
    color: #101828;
}
html body .jd-emp-sub svg { color: var(--jdc); }
html body .jd-emp-soyyo { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-left: 0; font-size: 13.5px; color: #344054; cursor: pointer; }
html body .jd-emp-soyyo .form-check-input { float: none; margin: 0; }
html body .jd-emp input[readonly] { background-color: #f6f8fb !important; color: #475467; }
html body .jd-emp-subir {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px;
    border: 1.5px dashed color-mix(in srgb, var(--jdc) 40%, #fff);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
html body .jd-emp-subir:hover { border-color: var(--jdc); background: color-mix(in srgb, var(--jdc) 4%, #fff); }
html body .jd-emp-subir input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
html body .jd-emp-subir:focus-within { outline: 2px solid var(--jdc); outline-offset: 2px; }
html body .jd-emp-subir__ico {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--jdc) 10%, #fff);
    color: var(--jdc);
}
html body .jd-emp-subir.lleno { border-style: solid; border-color: var(--jdc); background: color-mix(in srgb, var(--jdc) 5%, #fff); }
html body .jd-emp-subir.lleno .jd-emp-subir__ico { background: var(--jdc); color: #fff; }
html body .jd-emp-subir__txt { min-width: 0; }
html body .jd-emp-subir__txt strong { display: block; font-size: 14px; color: #101828; overflow-wrap: anywhere; }
html body .jd-emp-subir__txt small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: #5b6b7f; }
html body .jd-emp-ayuda { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: #5b6b7f; }
html body .jd-emp-ayuda svg { flex: 0 0 13px; color: var(--jdc); }

/* [JD 01/11/2026] Nombre nuevo: la versión da402870 quedó con un 404 guardado en Cloudflare (se pidió segundos antes de subirla). */

/* [JD 01/11/2026] El tema pone overflow:hidden en <main> y eso anula el sticky de la marca. Esta hoja solo
   carga en el acceso y el registro: aquí clip (recorta igual, sin crear contenedor de desplazamiento). */
html body main { overflow: clip; }

/* ── [JD 01/11/2026] FASES 9-11 (el dueño: «dale 3 fases más a login y register») ───────────────────── */
/* Fase 9 · Bloq Mayús: una línea con el color del tema bajo la contraseña. */
html body .jd-mayus { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--jdc); }
html body .jd-mayus[hidden] { display: none; }
/* Fase 10 · Botón ocupado: giro suave y sin segundo clic. */
html body .jd-acceso .btn-auth-submit.jd-cargando { display: inline-flex; align-items: center; justify-content: center; gap: 9px; opacity: .92; cursor: progress; }
html body .jd-giro { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: jdGiro .7s linear infinite; }
@keyframes jdGiro { to { transform: rotate(360deg); } }
/* Fase 11 · «¿Quisiste decir …?» bajo el correo; la sugerencia se corrige con un toque. */
html body .jd-sugiere { margin-top: 7px; font-size: 13px; color: #5b6b7f; }
html body .jd-sugiere[hidden] { display: none; }
html body .jd-sugiere button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--jdc); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
/* Sin el nombre de la tienda sobre el título: el logo ya está arriba. */
html body .jd-acceso__kicker { display: none !important; }
@media (prefers-reduced-motion: reduce) { html body .jd-giro { animation-duration: 1.6s; } }
