/*
 * Emaús Turnstile — Estilos del widget
 * ===================================================
 * Colores institucionales:
 *   Naranja  #fe5000
 *   Azul     #00406e
 *
 * NOTA TÉCNICA — Ajuste de ancho en wp-login.php:
 *   El iframe de Cloudflare Turnstile es siempre 300px fijos.
 *   El área de contenido de #loginform es 272px (320px total − 24px padding c/lado).
 *   Solución: con .login activo, extendemos el wrapper hasta los bordes del
 *   formulario (margin: -24px, width: calc(100% + 48px) = 320px) y añadimos
 *   padding: 0 10px al cuerpo → 320px − 20px = 300px exactos para el iframe.
 */

/* ── Wrapper base ──────────────────────────────────── */

.emaus-ts-wrapper {
    width: fit-content;
    max-width: 350px;
    clear: both;
    box-sizing: border-box;
    margin: 10px 0 16px;
}

/* Modo invisible: sin espacio visual */
.emaus-ts-hidden {
    margin: 0;
    height: 0;
    overflow: hidden;
}

/* ── Cabecera con logo (modo gestionado + show_logo) ─ */

.emaus-ts-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 12px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-top: 3px solid #fe5000;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 2px;
}

/* ── Cuerpo: contiene el widget de Cloudflare ── */

.emaus-ts-body {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.emaus-ts-logo {
    height: 22px;
    width: auto;
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
}

.emaus-ts-label {
    font-size: 10px;
    color: #00406e;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1;
}

/* ── Ajuste específico para wp-login.php (.login) ────
   Extendemos hasta los bordes del #loginform para que
   el iframe de 300px quepa sin recortes ni trucos.
   Header: banner ancho sin bordes laterales.
   Body: 320px − 10px padding c/lado = 300px exactos.  */

.login .emaus-ts-wrapper {
    max-width: none;
    margin-left:  -24px;
    margin-right: -24px;
    margin-top:    10px;
    margin-bottom: 8px;
    width: calc(100% + 48px);
    box-sizing: border-box;
}

.login .emaus-ts-header {
    border-left:   none;
    border-right:  none;
    border-radius: 0;
    width: 100%;
    margin-bottom: 0;
    border-bottom: 1px solid #e6e6e6;
}

.login .emaus-ts-body {
    padding: 0 10px 4px;
    background: #fff;
    border-left:   1px solid #e6e6e6;
    border-right:  1px solid #e6e6e6;
    border-bottom: 1px solid #e6e6e6;
}

/* ── Tema oscuro ───────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    .emaus-ts-header {
        background: #1a1a1a;
        border-color: #333;
        border-top-color: #fe5000;
    }
    .login .emaus-ts-body {
        background: #1a1a1a;
        border-color: #333;
    }
    .emaus-ts-label {
        color: #5a9fc8;
    }
}

/* ── Botón de envío bloqueado mientras Turnstile verifica ─ */

#wp-submit[data-emaus-locked],
.wpcf7-submit[data-emaus-locked],
.forminator-button-submit[data-emaus-locked],
.forminator-button[data-emaus-locked] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}
