/*
 * Zone de dépôt des pièces jointes (public/js/ticketing-dropzone.js).
 *
 * Autonome et neutre : tout est limité à .tk-dz (aucun style global), les couleurs suivent le thème de la page (currentColor)
 * avec un accent configurable : --tk-dz-accent, sinon --tk-accent (feuille des thèmes), sinon un indigo.
 */
.tk-dz {
    --tk-dz-accent: var(--tk-accent, #4f46e5);
    --tk-dz-line: color-mix(in srgb, currentColor 28%, transparent);
    --tk-dz-soft: color-mix(in srgb, currentColor 6%, transparent);
    --tk-dz-muted: color-mix(in srgb, currentColor 62%, transparent);
    box-sizing: border-box;
    position: relative;
    width: 100%;
    margin: .3rem 0 .75rem;
    color: inherit;
}

.tk-dz *,
.tk-dz *::before,
.tk-dz *::after {
    box-sizing: inherit;
}

/* Sélecteur natif conservé pour la soumission : masqué visuellement, ouvert par la zone. */
.tk-dz__input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    pointer-events: none;
}

.tk-dz__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: 1.4rem 1rem;
    border: 2px dashed var(--tk-dz-line);
    border-radius: 14px;
    background: var(--tk-dz-soft);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.tk-dz__zone:hover,
.tk-dz__zone:focus-visible {
    border-color: var(--tk-dz-accent);
    background: color-mix(in srgb, var(--tk-dz-accent) 7%, transparent);
    outline: none;
}

.tk-dz__zone:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tk-dz-accent) 30%, transparent);
}

.tk-dz.is-dragging .tk-dz__zone {
    border-style: solid;
    border-color: var(--tk-dz-accent);
    background: color-mix(in srgb, var(--tk-dz-accent) 12%, transparent);
    transform: scale(1.01);
}

.tk-dz__icon {
    color: var(--tk-dz-accent);
    margin-bottom: .15rem;
}

.tk-dz__title {
    font-weight: 600;
    line-height: 1.3;
}

.tk-dz__browse {
    color: var(--tk-dz-accent);
    font-size: .9rem;
    font-weight: 500;
}

.tk-dz__hint {
    color: var(--tk-dz-muted);
    font-size: .8rem;
}

.tk-dz__error {
    margin: .5rem 0 0;
    color: #b91c1c;
    font-size: .85rem;
    font-weight: 500;
}

.tk-dz__status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.tk-dz__list {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tk-dz__list:not(:empty) {
    margin-top: .75rem;
}

.tk-dz__item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .6rem;
    border: 1px solid var(--tk-dz-line);
    border-radius: 12px;
    background: color-mix(in srgb, Canvas 85%, transparent);
}

.tk-dz__thumb {
    display: inline-flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 9px;
    background: var(--tk-dz-soft);
    color: var(--tk-dz-muted);
}

.tk-dz__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
}

.tk-dz__meta {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.tk-dz__name {
    overflow: hidden;
    font-size: .9rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tk-dz__size {
    color: var(--tk-dz-muted);
    font-size: .78rem;
}

.tk-dz__remove {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--tk-dz-muted);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.tk-dz__remove:hover,
.tk-dz__remove:focus-visible {
    background: color-mix(in srgb, #dc2626 12%, transparent);
    color: #b91c1c;
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .tk-dz__zone,
    .tk-dz__remove {
        transition: none;
    }

    .tk-dz.is-dragging .tk-dz__zone {
        transform: none;
    }
}
