/* =========================================================
   PADRE AUDIT EXPRESS
   Portée : .pa-widget, .pa-overlay et .pa-inline uniquement.
========================================================= */

.pa-widget,
.pa-overlay,
.pa-inline{
    --pa-red:    #d90a2c;
    --pa-ink:    #17181b;
    --pa-body:   #55565b;
    --pa-muted:  #77757b;
    --pa-soft:   #99979d;
    --pa-line:   rgba(23,23,23,.12);
    --pa-line-2: rgba(23,23,23,.08);

    font-family: inherit;
}


/* ---------------------------------------------------------
   VISIBILITÉ — approche sans conflit

   Le navigateur applique [hidden] { display: none } avec une
   spécificité très faible : n'importe quelle règle d'auteur
   définissant `display` la supplantait, et la fenêtre
   s'affichait au chargement.

   Plutôt que de surenchérir en !important, on inverse la
   logique : l'état par défaut est CACHÉ, et `display` n'est
   attribué qu'en l'absence de l'attribut hidden. Il n'y a
   donc plus rien à gagner ni à perdre.
--------------------------------------------------------- */

.pa-overlay,
.pa-back,
.pa-callout{
    display: none;
}

.pa-overlay:not([hidden]){ display: flex; }
.pa-back:not([hidden])   { display: flex; }
.pa-callout:not([hidden]){ display: block; }


/* =========================================================
   LA BULLE
========================================================= */

.pa-widget{
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99000;

    display: flex;
    align-items: center;
    gap: 12px;
}

.pa-bubble{
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 58px;
    height: 58px;

    border: 0;
    border-radius: 50%;
    background: var(--pa-red);

    color: #fff;
    cursor: pointer;

    box-shadow:
        0 4px 12px rgba(217,10,44,.22),
        0 14px 34px rgba(23,23,23,.16);

    transition:
        transform .4s cubic-bezier(.22,1,.36,1),
        box-shadow .4s ease;
}

.pa-bubble svg{ width: 25px; height: 25px; }

.pa-bubble:hover,
.pa-bubble:focus-visible{
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 6px 16px rgba(217,10,44,.28),
        0 18px 42px rgba(23,23,23,.2);
}

/* halo qui pulse — attire l'œil sans bouger la bulle */
.pa-bubble::after{
    content: "";
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid var(--pa-red);
    animation: paPulse 2.6s ease-out infinite;
    pointer-events: none;
}

@keyframes paPulse{
    0%  { transform: scale(1);   opacity: .55; }
    70% { transform: scale(1.5); opacity: 0; }
    100%{ transform: scale(1.5); opacity: 0; }
}


/* =========================================================
   L'INFOBULLE
========================================================= */

.pa-callout{
    position: relative;

    max-width: 235px;
    padding: 14px 34px 14px 16px;

    border: 1px solid var(--pa-line-2);
    border-radius: 12px;
    background: #fff;

    box-shadow: 0 12px 32px rgba(23,23,23,.12);

    font-size: 13px;
    line-height: 1.45;
    color: var(--pa-body);

    animation: paCalloutIn .6s cubic-bezier(.22,1,.36,1) both;
}

.pa-callout strong{
    display: block;
    margin-bottom: 2px;
    color: var(--pa-ink);
    font-weight: 600;
}

.pa-callout span{ color: var(--pa-muted); }

/* toute l'infobulle ouvre le questionnaire */
.pa-callout-link,
.pa-callout-link:hover{
    display: block;
    color: inherit;
    text-decoration: none;
}

@keyframes paCalloutIn{
    from{ opacity: 0; transform: translateX(10px); }
    to  { opacity: 1; transform: none; }
}

.pa-callout-close{
    position: absolute;
    top: 6px;
    right: 8px;

    border: 0;
    background: none;
    padding: 4px;

    color: var(--pa-soft);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.pa-callout-close:hover{ color: var(--pa-ink); }


/* =========================================================
   LA FENÊTRE
========================================================= */

.pa-overlay{
    position: fixed;
    inset: 0;
    z-index: 99100;

    /* display géré plus haut par :not([hidden]) */
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(17,19,24,.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    animation: paFade .3s ease both;
}

@keyframes paFade{ from{ opacity: 0 } to{ opacity: 1 } }

.pa-modal{
    position: relative;

    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 48px);

    display: flex;
    flex-direction: column;

    border-radius: 16px;
    background: #fff;
    overflow: hidden;

    box-shadow: 0 30px 80px rgba(23,23,23,.3);

    animation: paRise .45s cubic-bezier(.22,1,.36,1) both;
}

@keyframes paRise{
    from{ opacity: 0; transform: translateY(18px) scale(.985); }
    to  { opacity: 1; transform: none; }
}


/* ----- barre supérieure ----- */

.pa-modal-head{
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 16px 18px;
    border-bottom: 1px solid var(--pa-line-2);
}

.pa-back,
.pa-close{
    flex: 0 0 auto;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border: 0;
    border-radius: 50%;
    background: none;

    color: var(--pa-muted);
    cursor: pointer;

    transition: background .25s ease, color .25s ease;
}

.pa-close{ display: flex; }

.pa-back svg,
.pa-close svg{ width: 18px; height: 18px; }

.pa-back:hover,
.pa-close:hover{ background: #f4f4f5; color: var(--pa-ink); }

.pa-progress{
    flex: 1 1 auto;
    height: 2px;
    border-radius: 2px;
    background: var(--pa-line-2);
    overflow: hidden;
}

.pa-progress-bar{
    display: block;
    height: 100%;
    width: 0;
    background: var(--pa-red);
    transition: width .5s cubic-bezier(.22,1,.36,1);
}


/* ----- corps ----- */

.pa-body{
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 34px 34px 30px;
}

.pa-step{ animation: paStepIn .45s cubic-bezier(.22,1,.36,1) both; }

@keyframes paStepIn{
    from{ opacity: 0; transform: translateY(12px); }
    to  { opacity: 1; transform: none; }
}

.pa-kicker{
    display: block;
    margin-bottom: 12px;

    color: var(--pa-red);
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.pa-question{
    margin: 0 0 6px;
    font-size: 21px;
    line-height: 1.28;
    font-weight: 500;
    letter-spacing: -.025em;
    color: var(--pa-ink);
}

.pa-help{
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--pa-muted);
}

.pa-question + .pa-options{ margin-top: 24px; }


/* =========================================================
   LES CHOIX
========================================================= */

.pa-options{
    display: flex;
    flex-direction: column;
    gap: 9px;

    margin: 0;
    padding: 0;
    list-style: none;
}

.pa-option{
    display: flex;
    align-items: center;
    gap: 13px;

    width: 100%;
    padding: 13px 16px;

    border: 1px solid var(--pa-line);
    border-radius: 10px;
    background: #fff;

    text-align: left;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    color: var(--pa-ink);

    cursor: pointer;
    transition:
        border-color .25s ease,
        background .25s ease,
        transform .25s cubic-bezier(.22,1,.36,1);
}

.pa-option:hover{
    border-color: rgba(217,10,44,.4);
    transform: translateX(3px);
}

/* la lettre — raccourci clavier, comme sur Tally */
.pa-key{
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    border-radius: 6px;
    background: #f1f1f2;

    color: var(--pa-muted);
    font-size: 11px;
    font-weight: 600;

    transition: background .25s ease, color .25s ease;
}

.pa-option:hover .pa-key{ background: #e7e7e9; }

.pa-option[aria-pressed="true"],
.pa-option.is-selected{
    border-color: var(--pa-red);
    background: rgba(217,10,44,.04);
}

.pa-option[aria-pressed="true"] .pa-key,
.pa-option.is-selected .pa-key{
    background: var(--pa-red);
    color: #fff;
}


/* =========================================================
   LES CHAMPS
========================================================= */

.pa-field{ margin-bottom: 18px; }

.pa-field label{
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #35343a;
}

.pa-field input{
    width: 100%;
    box-sizing: border-box;
    height: 50px;
    padding: 0 15px;

    border: 1px solid #dedde1;
    border-radius: 9px;
    background: #fafafa;

    color: var(--pa-ink);
    font-family: inherit;
    font-size: 15px;

    outline: none;
    transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.pa-field input::placeholder{ color: #aaa8ae; }

.pa-field input:focus{
    border-color: var(--pa-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(217,10,44,.12);
}

/* erreur : bordeaux nettement plus sombre que le rouge de
   marque, sinon « champ actif » et « champ invalide » se
   confondent */
.pa-field.is-error input{
    border-color: #8c1d2e;
    background: #fdf4f5;
}

.pa-error{
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #8c1d2e;
}


/* consentement */
.pa-consent{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 22px;
}

.pa-consent input{
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--pa-red);
    cursor: pointer;
}

.pa-consent label{
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--pa-muted);
    cursor: pointer;
}

.pa-consent a{ color: var(--pa-red); }


/* =========================================================
   BOUTON
========================================================= */

.pa-submit{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-height: 50px;
    padding: 0 26px;

    border: 0;
    border-radius: 100px;
    background: var(--pa-ink);

    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    transition: background .25s ease, transform .25s ease, gap .25s ease;
}

.pa-submit:hover:not(:disabled){
    background: var(--pa-red);
    transform: translateY(-2px);
    gap: 16px;
}

.pa-submit:disabled{ opacity: .55; cursor: not-allowed; }

.pa-hint{
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--pa-soft);
}


/* =========================================================
   ÉCRAN FINAL
========================================================= */

.pa-done{ text-align: center; padding: 18px 0 8px; }

.pa-done-mark{
    display: flex;
    align-items: center;
    justify-content: center;

    width: 62px;
    height: 62px;
    margin: 0 auto 22px;

    border-radius: 50%;
    background: rgba(217,10,44,.08);
    color: var(--pa-red);
}

.pa-done-mark svg{ width: 28px; height: 28px; }

.pa-done h3{
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -.025em;
    color: var(--pa-ink);
}

.pa-done p{
    margin: 0 auto 8px;
    max-width: 390px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--pa-body);
}

.pa-done .pa-submit{ margin-top: 20px; }


/* piège à robots */
.pa-hp{
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px){

    .pa-widget{ right: 16px; bottom: 16px; }

    .pa-callout{ display: none; }   /* pas de place à côté de la bulle */

    .pa-bubble{ width: 54px; height: 54px; }
    .pa-bubble::after{ width: 54px; height: 54px; }

    .pa-overlay{ padding: 0; align-items: flex-end; }

    .pa-modal{
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }

    .pa-body{ padding: 26px 20px 24px; }

    .pa-question{ font-size: 19px; }
    .pa-option{ font-size: 14.5px; padding: 12px 14px; }

    /* le raccourci clavier n'a pas de sens sur mobile */
    .pa-key,
    .pa-hint-keys{ display: none; }

    .pa-submit{ width: 100%; }
}


/* =========================================================
   MODE INTÉGRÉ — [padre_audit_inline]

   Le cadre (fond, bordure, arrondi) vient du conteneur de la
   page : le questionnaire s'y glisse sans seconde carte.
   Sélecteurs préfixés par .pa-inline : ils passent devant les
   styles de titres du thème (h2 dans le contenu).
========================================================= */

.pa-inline .pa-modal{
    max-width: none;
    max-height: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    animation: none;
}

.pa-inline .pa-close{ display: none; }

.pa-inline .pa-modal-head{ padding: 18px 28px; }

/* hauteur stable d'une question à l'autre (5 à 8 réponses) :
   la page ne saute pas à chaque clic */
.pa-inline .pa-body{
    overflow: visible;
    min-height: 540px;
    padding: 30px 34px 32px;
}

.pa-inline .pa-question{
    margin: 0 0 6px;
    font-size: 21px;
    line-height: 1.28;
    font-weight: 500;
    letter-spacing: -.025em;
    color: var(--pa-ink);
}

.pa-inline .pa-done h3{ font-size: 22px; }

@media (max-width: 640px){
    .pa-inline .pa-modal{ max-height: none; border-radius: 0; }
    .pa-inline .pa-modal-head{ padding: 14px 16px; }
    .pa-inline .pa-body{ min-height: 0; padding: 24px 18px 22px; }
    .pa-inline .pa-question{ font-size: 19px; }
}


/* =========================================================
   MOUVEMENT RÉDUIT
========================================================= */

@media (prefers-reduced-motion: reduce){

    .pa-bubble::after{ animation: none; }

    .pa-callout,
    .pa-overlay,
    .pa-modal,
    .pa-step{
        animation: none !important;
    }

    .pa-bubble,
    .pa-option,
    .pa-submit,
    .pa-progress-bar{
        transition: none !important;
    }
}
