/*
 * Isolation du widget Altcha vis-a-vis du CSS des sites (ex. une classe .ck-content qui impose une couleur de texte :
 * le texte de la bulle heritait de « currentColor » et devenait invisible sur le fond blanc de la bulle).
 * Charge par loader.php (fichier du site : une CSP « style-src 'self' » refuserait un <style> en ligne).
 * Les variables --altcha-* sont celles du widget ; les regles !important empechent un CSS de site de les contourner.
 */
altcha-widget {
    display: block;
    --altcha-color-base: #ffffff;
    --altcha-color-text: #212529;
    --altcha-color-border: #a0a0a0;
    --altcha-color-border-focus: #212529;
    --altcha-border-radius: 3px;
    --altcha-max-width: 260px;
}
altcha-widget .altcha,
altcha-widget .altcha * {
    color: var(--altcha-color-text) !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 1.4 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-shadow: none !important;
    text-align: left !important;
}
altcha-widget .altcha {
    background: var(--altcha-color-base) !important;
}
altcha-widget .altcha a {
    text-decoration: underline !important;
}

/*
 * Case a cocher : des CSS de sites masquent ou redessinent les <input type="checkbox"> (display:none, appearance:none, opacity:0,
 * cases « maison » dessinees en ::before/::after). Les regles du widget sur cette case sont en :where() (specificite nulle) :
 * n'importe quel CSS de site les ecrase. On remet une case native, visible, de taille fixe.
 */
altcha-widget .altcha-checkbox {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
}
altcha-widget .altcha-checkbox input[type="checkbox"] {
    all: revert !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    transform: none !important;
    clip: auto !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: auto !important;
    accent-color: #212529 !important;
    cursor: pointer !important;
}
altcha-widget .altcha-checkbox input[type="checkbox"]::before,
altcha-widget .altcha-checkbox input[type="checkbox"]::after {
    content: none !important;
    display: none !important;
}

/*
 * RAPPEL (seul formulaire en auto=onfocus) : tant que la verification n'a pas demarre, le widget est « unverified » et n'a pas encore l'attribut
 * data-floating (pose au premier affichage de la bulle) : le CSS « display:none » du mode flottant ne s'applique pas, la case s'afficherait
 * dans la page. On la masque tant qu'elle est en attente ; au clic dans un champ elle passe a « verifying » et la bulle apparait.
 */
#form_call altcha-widget .altcha[data-state="unverified"] {
    display: none !important;
}
