/*
 * Fenêtre de consentement aux cookies.
 *
 * Reprend les couleurs et les formes de la page (mêmes valeurs que
 * .dev/page/v3.html et .dev/legal/build.mjs) : encre #11162F, bleu #202B68,
 * corail #FF5F6D, fond #FAFAF7, filets rgba(17,22,47,.12).
 *
 * La police Geist n'est pas chargée ici : sur la page d'accueil elle vient de
 * l'export (@font-face déjà présent), sur les pages légales la pile système
 * prend le relais. Aucune ressource externe, aucune requête.
 *
 * Le balisage est construit par cookies.js : toutes les classes ci-dessous
 * sont écrites par ce script.
 */

#crew-ck,
#crew-ck * {
    box-sizing: border-box;
}

#crew-ck {
    --ck-ink: #11162F;
    --ck-navy: #202B68;
    --ck-coral: #FF5F6D;
    --ck-bg: #FAFAF7;
    --ck-muted: #5a6080;
    --ck-soft: #4a5070;
    --ck-line: rgba(17, 22, 47, .12);

    position: fixed;
    inset: 0;
    /* Au-dessus de tout : le formulaire de candidature monte à 50, l'écran de
       chargement de l'export à 10000. */
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 16px;
    overflow-y: auto;
    background: rgba(17, 22, 47, .55);
    font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ck-ink);
    -webkit-font-smoothing: antialiased;
}

#crew-ck[hidden] {
    display: none;
}

.crew-ck-panel {
    width: 100%;
    max-width: 560px;
    margin: auto;
    background: var(--ck-bg);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(17, 22, 47, .3);
    display: flex;
    flex-direction: column;
    animation: crew-ck-in .22s ease both;
}

/* La fenêtre prend le focus à l'ouverture, sans se dessiner un contour : le
   lecteur d'écran l'annonce, l'œil ne voit aucun bouton présélectionné. */
.crew-ck-panel:focus {
    outline: none;
}

/* La vue détaillée est plus large : elle aligne un libellé et un interrupteur. */
.crew-ck-panel[data-view="details"] {
    max-width: 660px;
}

@keyframes crew-ck-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .crew-ck-panel { animation: none; }
}

/* ── En-tête ────────────────────────────────────────────────────────────── */

.crew-ck-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(17, 22, 47, .08);
}

.crew-ck-eyebrow {
    font: 500 12px 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--ck-navy);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* « Continuer sans accepter » : refuser doit être aussi simple et aussi
   lisible qu'accepter. Pas de gris pâle, pas de croix muette. */
.crew-ck-decline {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--ck-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.crew-ck-decline:hover {
    color: var(--ck-ink);
}

/* ── Corps ──────────────────────────────────────────────────────────────── */

.crew-ck-body {
    padding: 24px 28px 4px;
}

.crew-ck-panel[data-view="details"] .crew-ck-body {
    max-height: 56vh;
    overflow-y: auto;
}

.crew-ck-title {
    margin: 0 0 12px;
    font-size: 25px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.03em;
}

.crew-ck-body p {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ck-soft);
}

.crew-ck-body a {
    color: var(--ck-navy);
}

/* ── Cartes de catégories ───────────────────────────────────────────────── */

.crew-ck-card {
    background: #fff;
    border: 1px solid var(--ck-line);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 0 0 14px;
}

.crew-ck-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.crew-ck-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 5px;
    background: rgba(32, 43, 104, .08);
    color: var(--ck-navy);
    font: 500 11px 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.crew-ck-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.crew-ck-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ck-soft);
}

.crew-ck-always {
    flex: none;
    padding-top: 4px;
    font: 500 12px 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--ck-muted);
    white-space: nowrap;
}

/* Services d'une catégorie : repliés, ouverts par « Tout afficher ». */
.crew-ck-services[hidden] {
    display: none;
}

.crew-ck-service {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ck-line);
}

.crew-ck-service h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
}

.crew-ck-names {
    margin: 6px 0 0;
    font: 400 12px 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--ck-muted);
    word-break: break-word;
}

.crew-ck-more {
    margin-top: 14px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: var(--ck-navy);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Interrupteur ───────────────────────────────────────────────────────── */

.crew-ck-switch {
    flex: none;
    position: relative;
    width: 46px;
    height: 27px;
}

.crew-ck-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.crew-ck-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(17, 22, 47, .18);
    transition: background .15s ease;
    pointer-events: none;
}

.crew-ck-switch span::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 22, 47, .25);
    transition: transform .15s ease;
}

.crew-ck-switch input:checked + span {
    background: var(--ck-navy);
}

.crew-ck-switch input:checked + span::after {
    transform: translateX(19px);
}

.crew-ck-switch input:focus-visible + span {
    outline: 2px solid var(--ck-navy);
    outline-offset: 3px;
}

.crew-ck-switch input:disabled {
    cursor: default;
}

.crew-ck-switch input:disabled + span {
    background: rgba(32, 43, 104, .35);
}

/* ── Pied ───────────────────────────────────────────────────────────────── */

.crew-ck-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 20px 28px 24px;
}

/* Vue détaillée : « Tout refuser » et « Tout accepter » à gauche, le bouton
   d'enregistrement à droite. */
.crew-ck-foot-spread {
    justify-content: space-between;
}

.crew-ck-foot-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.crew-ck-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 13px 22px;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.crew-ck-btn-primary {
    background: var(--ck-coral);
    color: var(--ck-ink);
    font-weight: 700;
}

.crew-ck-btn-primary:hover {
    background: #ff4b5a;
}

.crew-ck-btn-ghost {
    background: transparent;
    border-color: rgba(17, 22, 47, .18);
    color: var(--ck-ink);
}

.crew-ck-btn-ghost:hover {
    border-color: var(--ck-ink);
}

.crew-ck-btn:focus-visible,
.crew-ck-decline:focus-visible,
.crew-ck-more:focus-visible {
    outline: 2px solid var(--ck-navy);
    outline-offset: 3px;
}

@media (max-width: 560px) {
    #crew-ck {
        padding: 0;
        align-items: flex-end;
    }

    .crew-ck-panel,
    .crew-ck-panel[data-view="details"] {
        max-width: none;
        margin: 0;
        max-height: 92vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
    }

    .crew-ck-panel[data-view="details"] .crew-ck-body {
        max-height: none;
    }

    .crew-ck-head,
    .crew-ck-body,
    .crew-ck-foot {
        padding-left: 20px;
        padding-right: 20px;
    }

    .crew-ck-title {
        font-size: 22px;
    }

    .crew-ck-foot,
    .crew-ck-foot-group {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .crew-ck-btn {
        width: 100%;
    }
}
