/* ============================================================
   nouvelle_campagne3.css — création ET modification d'une campagne (We-Solidaire)
   Remplace nouvelle_campagne2.css et my_cagnotte_update5.css.
   - Tout est préfixé par .campagne-page : aucun effet sur l'en-tête ni
     le pied de page (plus de styles globaux sur body, form, label, a…)
   - Police : Manrope héritée de common.css (plus d'import Google Fonts
     Sora / DM Sans : appel externe à Google, à éviter côté RGPD)
   ============================================================ */

/* ---- Palette (identique aux autres pages du parcours) ---- */
.campagne-page
{
    --orange: #e1801d;          /* orange de marque */
    --orange-hover: #b8660f;    /* survol des boutons pleins */
    --orange-texte: #a85d0e;    /* orange foncé pour le texte sur blanc */
    --orange-pale: #fdf3e7;     /* fonds sélectionnés, survols */
    --creme: #fbf7f2;           /* fonds secondaires */
    --fond: #f6f4f1;            /* fond de page */
    --ligne: #ece6de;           /* bordures neutres */
    --champ: #e3dbd0;           /* bordure des champs */
    --encre: #2c2c2a;
    --texte: #4a4946;
    --discret: #888780;
    --aide: #b9b6ae;            /* placeholders */
    --rouge: #c0392b;           /* erreurs */

    background: var(--fond);
    padding: 32px 16px 56px;
}

.campagne-page *,
.campagne-page *::before,
.campagne-page *::after
{
    box-sizing: border-box;
}

/* Attribut hidden toujours respecté (blocs en display: flex/grid compris) */
.campagne-page [hidden]
{
    display: none !important;
}

/* ============================================================
   Carte du formulaire
   ============================================================ */
.campagne-page .campagne-form
{
    max-width: 740px;
    margin: 0 auto;
    padding: 30px 32px 32px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 0 15px #aaa;
}

.campagne-page h1
{
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--encre);
}

.campagne-sous-titre
{
    margin: 0 0 26px;
    font-size: 15px;
    color: var(--discret);
}

/* ---- Champs ---- */
.campagne-champ
{
    margin: 0 0 20px;
}

/* Objectif + date de fin côte à côte */
.campagne-duo
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

/* Libellé + aide à droite (compteur de caractères, "facultatif") */
.campagne-label-ligne
{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.campagne-page .campagne-label
{
    display: block;
    width: auto;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--texte);
    cursor: pointer;
}

.campagne-label-ligne .campagne-label
{
    margin: 0;
}

.campagne-aide
{
    font-size: 12px;
    color: var(--discret);
    white-space: nowrap;
}

.campagne-page input[type="text"],
.campagne-page select,
.campagne-page textarea
{
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--encre);
    background: #fff;
    border: 1.5px solid var(--champ);
    border-radius: 10px;
    box-shadow: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.campagne-page textarea
{
    height: auto;
    min-height: 96px;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

/* Liste déroulante : flèche dessinée en CSS */
.campagne-page select
{
    padding-right: 40px;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a85d0e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px 16px;
    cursor: pointer;
}

/* Catégorie pas encore choisie : texte d'invite en gris */
.campagne-page select:invalid
{
    color: var(--aide);
}

.campagne-page select option
{
    color: var(--encre);
}

.campagne-page input[type="text"]:focus,
.campagne-page select:focus,
.campagne-page textarea:focus
{
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(225, 128, 29, 0.18);
}

.campagne-page input[type="text"]::placeholder,
.campagne-page textarea::placeholder
{
    color: var(--aide);
}

/* Objectif : symbole € à droite du champ */
.campagne-euro
{
    position: relative;
}

.campagne-page .campagne-euro input
{
    padding-right: 40px;
}

.campagne-euro::after
{
    content: "€";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 800;
    color: var(--orange-texte);
    pointer-events: none;
}

/* Date : icône calendrier à droite */
.campagne-page #datepicker
{
    padding-right: 42px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a85d0e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 14px center / 18px 18px;
    cursor: pointer;
}

/* Messages d'erreur */
.campagne-page .error,
.campagne-page .error_options
{
    display: block;
    margin-top: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rouge);
}

.campagne-page .error:empty,
.campagne-page .error_options:empty
{
    display: none;
}

/* Catégorie "Autre" : orientation vers Papayoux (remplace la fenêtre confirm()) */
.campagne-note
{
    margin: 8px 0 0;
    padding: 12px 14px;
    border: 1px solid #f3d9bb;
    border-radius: 10px;
    background: var(--orange-pale);
    font-size: 13px;
    line-height: 1.5;
    color: var(--texte);
}

.campagne-note[hidden]
{
    display: none;
}

.campagne-note a
{
    font-weight: 700;
    color: var(--orange-texte);
}

/* ============================================================
   Photo principale
   ============================================================ */
.campagne-page #dropfile
{
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 220px;
    margin: 0;
    padding: 16px;
    overflow: hidden;
    border: 2px dashed #e6cfb4;
    border-radius: 14px;
    background: var(--creme);
    color: var(--texte);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

/* Icône image au-dessus du texte d'invite */
.campagne-page #dropfile::before
{
    content: "";
    width: 34px;
    height: 34px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a85d0e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") no-repeat center / contain;
}

.campagne-page #dropfile:hover
{
    border-color: var(--orange);
    background: var(--orange-pale);
}

.campagne-page #depot
{
    pointer-events: none;
}

/* Aperçu : remplit toute la zone */
.campagne-page #preview
{
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.campagne-page #preview:not([src]),
.campagne-page #preview[src=""]
{
    display: none;
}

/* Photo chargée : plus d'icône ni d'invite, mais une pastille "Changer la photo" */
.campagne-page #dropfile.has-image
{
    border-style: solid;
    border-color: transparent;
}

.campagne-page #dropfile.has-image::before,
.campagne-page #dropfile.has-image #depot
{
    display: none;
}

.campagne-changer
{
    display: none;
}

.campagne-page #dropfile.has-image .campagne-changer
{
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: block;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* Envoi en cours */
.campagne-page #dropfile.is-busy
{
    cursor: progress;
}

.campagne-page #dropfile.is-busy::after
{
    content: attr(data-envoi);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    color: var(--orange-texte);
    font-weight: 700;
}

/* ============================================================
   Présentation (TinyMCE)
   ============================================================ */
.campagne-page .tox-tinymce
{
    border: 1.5px solid var(--champ) !important;   /* !important : TinyMCE pose ses propres styles en ligne */
    border-radius: 10px !important;
}

/* ============================================================
   Options (bloc <details> repliable)
   ============================================================ */
.campagne-page #more_options
{
    margin: 4px 0 0;
    border: 1px solid var(--ligne);
    border-radius: 14px;
    background: #fff;
}

.campagne-page #more_options > summary
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--encre);
    cursor: pointer;
    list-style: none;
}

.campagne-page #more_options > summary::-webkit-details-marker
{
    display: none;
}

/* Pastille "+" qui devient "−" à l'ouverture */
.campagne-page #more_options > summary::before
{
    content: "+";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--orange-pale);
    color: var(--orange-texte);
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.campagne-page #more_options[open] > summary::before
{
    content: "−";
}

.campagne-options-corps
{
    padding: 4px 16px 16px;
    border-top: 1px solid var(--ligne);
}

.campagne-options-corps .campagne-champ
{
    margin: 16px 0 0;
}

/* Cases à cocher natives, à la couleur du site */
.campagne-check
{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 0;
}

.campagne-page .campagne-check input
{
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--orange);
    cursor: pointer;
}

.campagne-page .campagne-check label
{
    display: block;
    width: auto;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--texte);
    cursor: pointer;
}

/* ============================================================
   Boutons : Créer / Retour + Enregistrer
   ============================================================ */
.campagne-page #push
{
    display: flex;
    gap: 12px;
    margin-top: 26px;
}

.campagne-page .campagne-submit
{
    display: block;
    flex: 1;
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--orange);
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.18s;
}

.campagne-page .campagne-submit:hover
{
    background: var(--orange-hover);
}

.campagne-page .campagne-submit:disabled
{
    opacity: 0.55;
    cursor: progress;
}

/* Retour : bouton secondaire. #retour dans le sélecteur pour passer devant le #retour de common.css */
.campagne-page #retour
{
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    height: 56px;
    margin: 0;
    padding: 0 26px;
    border: 1.5px solid var(--champ);
    border-radius: 12px;
    background: #fff;
    color: var(--texte);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-transform: none;
    transition: border-color 0.18s, color 0.18s;
}

.campagne-page #retour:hover
{
    border-color: var(--orange);
    background: #fff;
    color: var(--orange-texte);
}

/* ============================================================
   Modification : bannière bord à bord, au format de la page publique
   ============================================================ */
.campagne-page.has-banniere
{
    padding-top: 0;
}

/* Annule le padding latéral de la page : la bannière touche les bords */
.campagne-banniere
{
    margin: 0 -16px 26px;
}

/* Zone de recadrage : uniquement du cosmétique.
   Ni position, ni taille ne changent (le recadrage de component.js s'appuie dessus) */
.campagne-page .crop-wrapper
{
    overflow: hidden;
    cursor: pointer;
    background-color: var(--orange-pale);
    background-image: repeating-linear-gradient(135deg, rgba(225, 128, 29, 0.06) 0 12px, transparent 12px 24px);
    outline: 2px dashed #ebb47c;
    outline-offset: -10px;
    transition: background-color 0.18s, outline-color 0.18s;
}

.campagne-page .crop-wrapper:hover
{
    background-color: #fbe8d2;
    outline-color: var(--orange);
}

/* Bannière en place ou image en cours de cadrage : plus de pointillés par-dessus */
.campagne-page .crop-wrapper.has-banner,
.campagne-page .crop-wrapper.is-loaded
{
    outline: none;
    background: #f3f1ec;
}

.campagne-page .crop-wrapper:focus-visible
{
    outline: 3px solid var(--orange);
    outline-offset: -3px;
}

/* Bannière actuelle : remplit le cadre, comme sur la page publique */
.campagne-page #ban_new
{
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Consigne : pastille blanche + icône image quand le cadre est vide */
.campagne-page .overlay-inner
{
    position: relative;
    z-index: 1;
    width: fit-content;
    max-width: 90%;
    margin: 18px auto 0;
    padding: 9px 18px 9px 42px;
    border-radius: 999px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a85d0e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") no-repeat 15px center / 18px 18px;
    box-shadow: 0 2px 10px rgba(168, 93, 14, 0.15);
    color: var(--orange-texte);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

/* Par-dessus une image : pastille sombre, discrète, plus visible au survol */
.campagne-page .crop-wrapper.has-banner .overlay-inner,
.campagne-page .crop-wrapper.is-loaded .overlay-inner
{
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.85;
    transition: opacity 0.18s;
}

.campagne-page .crop-wrapper.has-banner:hover .overlay-inner
{
    opacity: 1;
}

/* Outils sous la bannière, alignés sur la carte */
.campagne-banniere-outils
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    max-width: 740px;
    margin: 14px auto 0;
    padding: 0 4px;
}

.campagne-page .campagne-banniere-aide
{
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--discret);
}

.campagne-banniere-aide strong
{
    font-size: 15px;
    font-weight: 800;
    color: var(--encre);
}

.campagne-page #btn_ban
{
    display: flex;
    gap: 10px;
}

/* Boutons de la bannière (écrasent les styles génériques de common.css) */
.campagne-page #btn_ban .btn
{
    height: 42px;
    margin: 0;
    padding: 0 20px;
    border: 1.5px solid var(--champ);
    border-radius: 10px;
    background: #fff;
    color: var(--texte);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.campagne-page #btn_ban .js-reset:hover
{
    border-color: var(--orange);
    background: #fff;
    color: var(--orange-texte);
}

/* Valider : action principale, pleine */
.campagne-page #btn_ban .js-crop
{
    border-color: var(--orange);
    background: var(--orange);
    color: #fff;
}

.campagne-page #btn_ban .js-crop:hover
{
    border-color: var(--orange-hover);
    background: var(--orange-hover);
    color: #fff;
}

/* Rien à valider tant qu'aucune image n'est chargée */
.campagne-page #btn_ban .js-crop:disabled
{
    border-color: var(--ligne);
    background: var(--ligne);
    color: var(--discret);
    cursor: not-allowed;
}

/* Retour de component.js (bannière enregistrée…) */
.campagne-page #ok
{
    flex-basis: 100%;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #2f7a3e;
    text-align: right;
}

.campagne-page #ok:empty
{
    display: none;
}

/* Sur ordinateur, la remarque "bannière depuis un ordinateur" n'a pas lieu d'être */
.campagne-note-mobile
{
    display: none;
}

/* ============================================================
   Bloc éditorial SEO / GEO (étapes, avantages, conseils, FAQ)
   ============================================================ */
.campagne-page #bloc2
{
    max-width: 740px;
    margin: 28px auto 0;
    padding: 30px 32px;
    background: #fff;
    border: 1px solid var(--ligne);
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--texte);
}

.campagne-page #bloc2 .titre2
{
    margin: 28px 0 12px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--encre);
}

.campagne-page #bloc2 .titre2:first-child
{
    margin-top: 0;
}

.campagne-page #bloc2 ul,
.campagne-page #bloc2 ol
{
    margin: 0;
    padding-left: 22px;
}

.campagne-page #bloc2 li
{
    margin-bottom: 8px;
}

.campagne-page #bloc2 b
{
    color: var(--encre);
}

.campagne-page #bloc2 a
{
    font-weight: 700;
    color: var(--orange-texte);
}

.campagne-page #bloc2 a:hover
{
    color: var(--orange-hover);
}

/* FAQ : questions repliables */
.seo_faq details
{
    margin-bottom: 10px;
    padding: 12px 16px;
    border: 1px solid var(--ligne);
    border-radius: 12px;
    background: #fff;
}

.seo_faq summary
{
    cursor: pointer;
}

.seo_faq summary h3
{
    display: inline;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--encre);
}

.seo_faq details[open] summary h3
{
    color: var(--orange-texte);
}

.seo_faq details p
{
    margin: 10px 0 0;
    line-height: 1.6;
}

/* ---- Focus clavier visible ---- */
.campagne-page #dropfile:focus-visible,
.campagne-page .campagne-submit:focus-visible,
.campagne-page #retour:focus-visible,
.campagne-page #btn_ban .btn:focus-visible,
.campagne-page summary:focus-visible
{
    outline: 3px solid rgba(225, 128, 29, 0.45);
    outline-offset: 2px;
}

/* ============================================================
   Calendrier jQuery UI (ajouté en fin de page, hors de .campagne-page)
   ============================================================ */
.ui-datepicker
{
    z-index: 9999 !important;          /* au-dessus de TinyMCE */
    padding: 8px;
    border: 1px solid #ece6de !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-family: inherit;
}

.ui-datepicker .ui-datepicker-header
{
    border: none !important;
    border-radius: 10px !important;
    background: #e1801d !important;
    color: #fff !important;
}

.ui-datepicker td span,
.ui-datepicker td a
{
    border-radius: 6px !important;
    text-align: center !important;
}

.ui-datepicker .ui-state-active,
.ui-datepicker .ui-state-hover
{
    border-color: #e1801d !important;
    background: #e1801d !important;
    color: #fff !important;
}

/* ============================================================
   Mobile
   ============================================================ */
@media screen and (max-width: 767px)
{
    .campagne-page
    {
        padding: 16px 10px 40px;
    }

    .campagne-page .campagne-form
    {
        padding: 22px 16px 22px;
        border-radius: 16px;
    }

    .campagne-page h1
    {
        font-size: 22px;
    }

    .campagne-sous-titre
    {
        margin-bottom: 20px;
        font-size: 14px;
    }

    /* Objectif et date l'un sous l'autre */
    .campagne-duo
    {
        grid-template-columns: 1fr;
    }

    .campagne-page #dropfile
    {
        height: 180px;
    }

    /* Modification : bannière masquée (comme avant), remplacée par une remarque */
    .campagne-page.has-banniere
    {
        padding-top: 16px;
    }

    .campagne-banniere
    {
        display: none;
    }

    .campagne-page .campagne-note-mobile
    {
        display: block;
        margin: -8px 0 20px;
    }

    /* Enregistrer au-dessus, Retour en dessous, pleine largeur */
    .campagne-page #push
    {
        flex-direction: column-reverse;
    }

    /* En colonne, flex: 1 écraserait la hauteur du bouton */
    .campagne-page .campagne-submit
    {
        flex: none;
    }

    .campagne-page #retour
    {
        height: 50px;
    }

    .campagne-page #bloc2
    {
        margin-top: 20px;
        padding: 22px 18px;
        border-radius: 16px;
    }
}

/* Pas d'animation pour qui l'a désactivée */
@media (prefers-reduced-motion: reduce)
{
    .campagne-page .campagne-submit,
    .campagne-page #retour,
    .campagne-page .crop-wrapper,
    .campagne-page .overlay-inner,
    .campagne-page #btn_ban .btn,
    .campagne-page #dropfile,
    .campagne-page input[type="text"],
    .campagne-page select,
    .campagne-page textarea
    {
        transition: none;
    }
}