/*
 * Dokument-Droparea (elements/form/document.php, js/upload-document.js).
 * Gilt fuer alle Templates; die Markenfarbe kommt als --hey-docs-key aus dem style-Attribut.
 * Zustaende als Klassen am Wurzelelement: is-empty / has-files, is-dragover, is-invalid.
 *
 * Spezifitaet: Die Templates stylen Formular-Elemente ueber ID-Ketten wie
 * "body section#jp-section-form #job-form-wrapper span" (2 IDs). Jeder Selektor hier traegt
 * deshalb ":not(#hd)" dreimal - das trifft jedes Element und hebt die Spezifitaet auf 3 IDs,
 * ohne !important.
 */

.hey-docs:not(#hd):not(#hd):not(#hd) {
    --hey-docs-key: #35a8e0;
    --hey-docs-key-tint: rgba(53, 168, 224, .12);
    --hey-docs-text: #444;
    --hey-docs-muted: #888;
    --hey-docs-success: #2ebf6e;
    --hey-docs-error: #e8446f;
    --hey-docs-error-border: #f2b8c6;

    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-bottom: 1rem;
    color: var(--hey-docs-text);
    text-align: left;
}

.hey-docs:not(#hd):not(#hd):not(#hd) *,
.hey-docs:not(#hd):not(#hd):not(#hd) *::before,
.hey-docs:not(#hd):not(#hd):not(#hd) *::after {
    box-sizing: border-box;
}

/*
 * Template-Regeln fuer span/p/li/button (Abstaende, Farbe, Schrift) zuruecksetzen, damit die
 * Werte vom Elternelement erben. Elemente mit eigenem Wert setzen ihn unten selbst.
 */
.hey-docs:not(#hd):not(#hd):not(#hd) * {
    margin: 0;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: none;
    hyphens: manual;
}

.hey-docs:not(#hd):not(#hd):not(#hd) svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.hey-docs:not(#hd):not(#hd):not(#hd) svg .hey-docs__fill {
    fill: currentColor;
    stroke: none;
}

.hey-docs:not(#hd):not(#hd):not(#hd) svg .hey-docs__knockout {
    stroke: #fff;
    stroke-width: 2.4;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__hint {
    margin: -8px 0 0;
    font-size: 15px;
    line-height: 1.4;
    color: #666;
}

/* Das Feld bleibt im DOM, damit das Label der Templates (for=scope_document_type_<id>) den Dateidialog oeffnet. */
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    opacity: 0;
}

/* ---------- Droparea ---------- */

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__zone {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px 20px;
    border: 1px dashed var(--hey-docs-key);
    border-radius: 4px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

.hey-docs:not(#hd):not(#hd):not(#hd).is-empty .hey-docs__zone {
    display: flex;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__zone:focus-visible,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__pick:focus-visible,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__add:focus-visible,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__action:focus-visible {
    outline: 2px solid var(--hey-docs-key);
    outline-offset: 2px;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__zone .hey-docs__icon {
    font-size: 22px;
    color: var(--hey-docs-key);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__zone-text,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__zone-drag {
    font-size: 17px;
    line-height: 1.35;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__zone-drag {
    font-weight: 700;
    color: var(--hey-docs-key);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__formats {
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--hey-docs-muted);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__icon {
    display: inline-flex;
    line-height: 1;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__icon--drag,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__zone-drag,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__btn-drag,
.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__icon--idle,
.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__zone-text,
.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__btn-text {
    display: none;
}

.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__icon--drag,
.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__zone-drag,
.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__btn-drag {
    display: inline-flex;
}

.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__zone {
    border: 2px dashed var(--hey-docs-key);
    padding: 29px 19px;
    background: var(--hey-docs-key-tint);
}

.hey-docs:not(#hd):not(#hd):not(#hd).is-invalid .hey-docs__zone {
    border-color: var(--hey-docs-error);
}

/* ---------- Pflichtfehler ---------- */

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__error {
    display: none;
    align-items: center;
    gap: 8px;
    margin: -4px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--hey-docs-error);
}

.hey-docs:not(#hd):not(#hd):not(#hd).is-invalid .hey-docs__error--required,
.hey-docs:not(#hd):not(#hd):not(#hd).has-file-errors .hey-docs__error--files {
    display: flex;
}

/* Beides zugleich: nur die Datei-Meldung, die Pflichtpruefung greift beim naechsten Klick wieder */
.hey-docs:not(#hd):not(#hd):not(#hd).has-file-errors .hey-docs__error--required {
    display: none;
}

/* Abschicken mit abgelehnten Dateien: Fehlerzeilen zusaetzlich rot umranden */
.hey-docs:not(#hd):not(#hd):not(#hd).has-file-errors .hey-docs__list {
    border-color: var(--hey-docs-error-border);
}

/* ---------- Liste ---------- */

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__list {
    display: none;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
}

.hey-docs:not(#hd):not(#hd):not(#hd).has-files .hey-docs__list {
    display: block;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    line-height: 1.4;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__list-title {
    font-weight: 700;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--hey-docs-success);
    white-space: nowrap;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__count svg {
    font-size: 13px;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto 20px;
    gap: 12px;
    align-items: center;
    margin: 0;
    padding: 11px 14px;
    border-bottom: 1px solid #f1f1f1;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__row:last-child {
    border-bottom: 0;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__row::before {
    content: none;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__status {
    display: inline-flex;
    justify-content: center;
    font-size: 16px;
    color: var(--hey-docs-success);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__row.is-uploading .hey-docs__status {
    color: var(--hey-docs-key);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__row.is-error .hey-docs__status {
    color: var(--hey-docs-error);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__name {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__meta {
    font-size: 13px;
    line-height: 1.4;
    color: var(--hey-docs-muted);
    white-space: nowrap;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__row.is-uploading .hey-docs__meta {
    color: var(--hey-docs-key);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__row.is-error .hey-docs__meta {
    color: var(--hey-docs-error);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: none;
    box-shadow: none;
    font-size: 15px;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__action:hover {
    color: var(--hey-docs-text);
    background: none;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__action--retry,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__action--retry:hover {
    color: var(--hey-docs-key);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__spin {
    animation: hey-docs-spin 1s linear infinite;
}

@keyframes hey-docs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Buttons ---------- */

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__buttons {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.hey-docs:not(#hd):not(#hd):not(#hd).has-files .hey-docs__buttons {
    display: flex;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__pick,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 16px;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    font-family: inherit;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__pick {
    display: none;
    border: 1px solid #d6d6d6;
    color: var(--hey-docs-text);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__pick .hey-docs__icon {
    color: var(--hey-docs-key);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__add {
    border: 1px solid var(--hey-docs-key);
    color: var(--hey-docs-key);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__pick:hover,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__add:hover {
    background: var(--hey-docs-key-tint);
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__pick svg,
.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__add svg {
    font-size: 15px;
}

.hey-docs:not(#hd):not(#hd):not(#hd).is-dragover .hey-docs__add {
    height: 78px;
    border: 2px dashed var(--hey-docs-key);
    background: var(--hey-docs-key-tint);
    font-weight: 700;
}

.hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__drop-hint {
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--hey-docs-muted);
    text-align: center;
}

/* ---------- Mobil / Touch: Button statt Droparea ---------- */

@media (max-width: 575.98px), (hover: none) and (pointer: coarse) {
    .hey-docs:not(#hd):not(#hd):not(#hd).is-empty .hey-docs__zone,
    .hey-docs:not(#hd):not(#hd):not(#hd) .hey-docs__drop-hint {
        display: none;
    }

    .hey-docs:not(#hd):not(#hd):not(#hd).is-empty .hey-docs__buttons {
        display: flex;
    }

    .hey-docs:not(#hd):not(#hd):not(#hd).is-empty .hey-docs__pick {
        display: flex;
    }

    .hey-docs:not(#hd):not(#hd):not(#hd).is-empty .hey-docs__add {
        display: none;
    }

    .hey-docs:not(#hd):not(#hd):not(#hd).is-invalid .hey-docs__pick {
        border-color: var(--hey-docs-error);
    }
}

/* ---------- Absenden waehrend Upload ---------- */

.hey-docs-submit-status:not(#hd):not(#hd):not(#hd) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 18px;
    color: #5a6b7b;
}

.hey-docs-submit-status:not(#hd):not(#hd):not(#hd)[hidden] {
    display: none;
}

.hey-docs-submit-status:not(#hd):not(#hd):not(#hd) svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--hey-docs-key, #35a8e0);
    stroke-width: 2.5;
    stroke-linecap: round;
    animation: hey-docs-spin 1s linear infinite;
}

.hey-docs-submit-busy:not(#hd):not(#hd):not(#hd),
.hey-docs-submit-busy:not(#hd):not(#hd):not(#hd):hover {
    opacity: .45;
    cursor: not-allowed !important;
}
