/* ========================================
   BOUTONS
======================================== */
.btn {
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: .25s;
    border-radius: var(--radius-pill);
    padding: 20px 32px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 18px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 4px solid #BCC9DC;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.campagne-actions {
    margin: var(--space-lg) 0;
}

/* ========================================
   CARTES
======================================== */

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.card-flat {
    box-shadow: none;
}

.card + .card {
    margin-top: var(--space-md);
}

/* ========================================
   HEADER LOGO
======================================== */

.brand-pill {
    height: 72px;
    padding: 0 28px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-soft);
}

.brand-pill img {
    height: 48px;
    width: auto;
    flex-shrink: 0;
}

.brand-pill strong {
    white-space: nowrap;
    color: var(--color-primary);
}

/* ========================================
   BOUTONS RONDS
======================================== */

.icon-button {
    width: 74px;
    height: 74px;

    border: none;
    border-radius: 50%;

    background: white;
    box-shadow: var(--shadow-soft);

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

/* ========================================
   BADGES
======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: var(--radius-pill);

    font-size: 14px;
    font-weight: 600;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ========================================
   FILE TRACKING (status list + detail timeline)
======================================== */

.file-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.file-status-list li + li {
    border-top: 2px solid var(--color-border);
}

.file-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    color: var(--color-text);
    text-decoration: none;
}

.file-status-item__name {
    overflow-wrap: anywhere;
    font-weight: var(--font-semi);
}

.file-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 12rem;
    margin-bottom: var(--space-md);
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-primary-dark);
    color: #fff;
}

/* Darkens the bottom so the caption stays readable on any picture. */
.file-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(11, 39, 49, 0.92) 100%);
}

.file-hero__badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 1;
}

.file-hero__caption {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--space-xs) var(--space-sm);
    width: 100%;
    padding: var(--space-md);
}

.file-hero__icon {
    padding: var(--space-xs);
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.2);
}

.file-hero__caption h1 {
    margin: 0;
    color: inherit;
    overflow-wrap: anywhere;
}

.file-hero__meta {
    grid-column: 1 / -1;
    margin: 0;
    font-size: var(--text-sm);
    opacity: 0.85;
}

.file-detail__hint {
    color: var(--color-text-light);
    font-size: var(--text-sm);
}

.file-detail__info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-xs) var(--space-md);
    margin: 0;
}

.file-detail__info dt {
    color: var(--color-text-light);
}

.file-detail__info dd {
    margin: 0;
    font-weight: var(--font-semi);
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline__step {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 0 var(--space-md) 36px;
    font-size: var(--text-sm);
}

.timeline__step::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
}

.timeline__step span {
    color: var(--color-text-light);
}

.timeline__step.is-done::before {
    background: var(--color-success);
    border-color: var(--color-success);
}

.timeline__step.is-current::before {
    border-color: var(--color-primary);
    border-width: 4px;
}

.timeline__step.is-error::before {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.timeline__step.is-error span {
    color: var(--color-danger);
}

/* ========================================
   ALERTES
======================================== */

.alert {
    padding: 20px;
    border-radius: 24px;
    display: flex;
    gap: 12px;
}

.alert-info {
    background: var(--color-info-bg);
    color: var(--color-primary);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.alert-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ========================================
   CHAMPS DE SAISIES
======================================== */

.input {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-family: inherit;

    height: 72px;

    border: 4px solid #D2DDEB;
    border-radius: 24px;

    padding: 0 24px;

    font-size: 20px;

    background: white;
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.textarea {
    min-height: 180px;
    padding: 24px;
    resize: vertical;
}

/* ========================================
   SEGMENTED BOUTONS
======================================== */

.segment {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.segment-item {

    padding: 18px 32px;

    border-radius: var(--radius-pill);

    border: 4px solid #C8D4E4;

    color: var(--color-primary);

    background: white;

    cursor: pointer;
}

.segment-item.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ========================================
   PROGRESSION
======================================== */

.progress {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #D6E0ED;
    overflow: hidden;
}

.progress-value {
    height: 100%;
    background: var(--color-primary);
    border-radius: inherit;
}

/* ========================================
   ZONE UPLOAD FICHIERS
======================================== */

.upload-zone {
    border: 4px dashed #8AB0E2;
    border-radius: 32px;
    background: #EAF2FC;
    padding: 48px 24px;
    text-align: center;
}

/* ========================================
   TOGGLE
======================================== */

.switch {
    width: 104px;
    height: 56px;
    position: relative;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: #BCC9DC;
    border-radius: 999px;
    transition: .3s;
}

.slider::before {
    content: "";

    width: 40px;
    height: 40px;

    position: absolute;

    left: 8px;
    top: 8px;

    background: white;
    border-radius: 50%;

    transition: .3s;
}

input:checked + .slider {
    background: var(--color-primary);
}

input:checked + .slider::before {
    transform: translateX(48px);
}

/* ========================================
   FORMULAIRES
======================================== */

.form-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin: 0 0 var(--space-md);
}

.form-field label {
    font-weight: 600;
}

.form-help {
    color: var(--color-text-light);
    font-size: 14px;
}

.form-help ul {
    margin: 0;
    padding-left: 20px;
}

.form-error {
    color: var(--color-danger);
    font-size: 14px;
    font-weight: 600;
}

.input[aria-invalid="true"] {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
}

/* ========================================
   MENU BURGER
======================================== */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.burger-menu {
    position: relative;
    z-index: 1000;
}

.burger-button {
    list-style: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary);
}

.burger-button::-webkit-details-marker {
    display: none;
}

.burger-panel {
    position: absolute;
    top: 64px;
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
}

.burger-panel a,
.burger-panel button {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: var(--space-md);
    border: none;
    background: none;
    text-align: left;
    font: inherit;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.burger-panel a:hover,
.burger-panel button:hover {
    background: var(--color-info-bg);
}

/* Liens dans les pages de formulaire */
.login a,
.signup a {
    color: var(--color-primary);
    font-weight: 600;
}

/* Petits écrans : champs et boutons plus compacts */
@media (max-width: 360px) {
    .input {
        height: 60px;
        font-size: 18px;
        padding: 0 16px;
        border-width: 3px;
    }

    .btn {
        padding: 16px 24px;
    }
}

/* ========================================
   DÉPÔT DE FICHIERS
======================================== */

.file-dropper__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.file-dropper__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    box-sizing: border-box;
    min-height: 160px;
    padding: var(--space-lg);
    text-align: center;
    color: var(--color-primary);
    background: var(--color-surface);
    border: 4px dashed var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
}

.file-dropper__zone:hover,
.file-dropper__zone.is-dragover,
.file-dropper__input:focus-visible + .file-dropper__zone {
    background: var(--color-info-bg);
    border-color: var(--color-primary);
}

.file-dropper__hint,
.file-dropper__note {
    color: var(--color-text-light);
    font-size: var(--text-sm);
}

.file-list {
    list-style: none;
    margin: var(--space-md) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.file-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-xs) var(--space-sm);
    padding: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
}

.file-item__name {
    grid-column: 1 / -1;
    font-weight: var(--font-semi);
    overflow-wrap: anywhere;
}

a.file-item__name {
    color: inherit;
    text-decoration: none;
}

.file-item__progress {
    grid-column: 1 / -1;
    width: 100%;
    height: 10px;
}

.file-item__status {
    font-size: var(--text-sm);
    color: var(--color-text-light);
}

.file-item__cancel {
    border: none;
    background: none;
    color: var(--color-primary);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-semi);
    cursor: pointer;
}

.file-item.is-pending .file-item__status {
    color: var(--color-warning);
}

.file-item.is-error {
    background: var(--color-danger-bg);
}

.file-item.is-error .file-item__status {
    color: var(--color-danger);
}

/* ========================================
   AUTORISATIONS (CONSENTEMENTS)
======================================== */

.consent-card {
    border: 0;
    margin: 0 0 16px;
    padding: 20px 24px;
    min-width: 0;
}

.consent-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.consent-title {
    padding: 0;
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: var(--font-bold);
    line-height: 1.2;
}

.consent-description {
    margin: 0 0 12px;
    color: var(--color-text-light);
    font-size: 16px;
    line-height: 1.4;
}

.consent-card .consent-description {
    margin: 0;
}

/* Non/Oui selector: neither side is selected until the user answers. */
.consent-choice {
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
    background: #BCC9DC;
    border-radius: var(--radius-pill);
    padding: 4px;
}

.file-detail .consent-choice {
    max-width: 150px;
    margin-inline: auto;
}

.consent-choice label {
    position: relative;
    cursor: pointer;
}

.consent-choice input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.consent-choice span {
    display: block;
    min-width: 44px;
    padding: 10px 14px;
    text-align: center;
    font-weight: var(--font-semi);
    font-size: var(--text-sm);
    color: var(--color-text-light);
    border-radius: var(--radius-pill);
}

.consent-choice input:checked + span {
    background: var(--color-primary);
    color: white;
}

.consent-choice input:focus-visible + span {
    outline: 3px solid var(--color-secondary);
    outline-offset: 2px;
}

.consent-info {
    margin-top: 8px;
}

.consent-info summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--color-primary);
    font-weight: var(--font-bold);
    font-size: 14px;
}

.consent-card {
    position: relative;
}

/* Floats over the following content, anchored to the card (the <details> stays static) */
.consent-info__bubble {
    position: absolute;
    left: 16px;
    right: 16px;
    z-index: 10;
    box-shadow: var(--shadow-soft);
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: var(--radius-md, 8px);
    background: var(--color-info-bg);
    color: var(--color-text);
    font-size: 14px;
}

.consent-info__bubble::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--color-info-bg);
    transform: rotate(45deg);
}

/* .campagne-details {
    /* margin: 24px 0; */
    /* padding: 16px; */
    /* background: var(--color-background); */
    /* border-radius: 12px; */
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); */
/*} */

.campagne-details summary {
    cursor: pointer;
    color: var(--color-text);
    font-weight: var(--font-bold);
    font-size: 18px;
    margin-bottom: 20px;
}

.campagne-details[open] summary {
    margin-bottom: 16px;
}

/* ========================================
   ESPACE PERSONNEL (dashboard)
======================================== */

.espace-greeting {
    margin: 0;
    color: var(--color-text-light);
}

.espace-name {
    margin: 0 0 var(--space-md);
}

.campagne-card {
    display: block;
    color: var(--color-text);
    text-decoration: none;
}

.campagne-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
}

.campagne-card__header h3 {
    margin: 0;
}

.campagne-card__header .badge {
    padding: 4px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.campagne-card__dates {
    margin: 4px 0 var(--space-sm);
    color: var(--color-text-light);
}

.campagne-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
    margin: 0;
    padding: var(--space-sm) 0 0;
    border-top: 1px solid var(--color-border);
    list-style: none;
    color: var(--color-text-light);
    font-size: 14px;
}

.campagne-card__stats li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.campagne-card__stats svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-text);
    color: white;
    font-weight: var(--font-semi);
}

.profile-email {
    color: var(--color-text-light);
    font-size: 14px;
}

.profile-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-links li + li {
    border-top: 1px solid var(--color-border);
}

.profile-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    color: var(--color-text);
    font-weight: var(--font-semi);
    text-decoration: none;
}

.profile-links a::after {
    content: "›";
    color: var(--color-text-light);
    font-size: 22px;
}

.profile-links .profile-links__icon {
    display: grid;
    place-items: center;
    flex: none;
    overflow: hidden;
    line-height: 1;
    width: 36px;
    height: 36px;
    margin-right: var(--space-md);
    border-radius: var(--radius-md, 8px);
    background: var(--color-background);
    font-size: 20px;
}

.profile-links a::after {
    margin-left: auto;
}
