/* the label (h3) is rendered by Contao in front of the widget */
h3:has(+ .hm-import) {
    margin-bottom: 0.3em;
}

.hm-import {
    line-height: 1.5;
}

.hm-import-info {
    display: none;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border, #ccc);
    border-radius: var(--border-radius, 4px);
}

.hm-import.has-data .hm-import-info {
    display: block;
}

.hm-import-info p {
    margin: 0;
}

.hm-import-info a.tl_submit {
    display: flex;
    align-items: center;
    width: max-content;
    margin: 0.6rem 0 0;
    line-height: 1.2;
    text-decoration: none;
}

.hm-import-drop {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    width: 100%;
    padding: 1.75rem 1rem;
    font: inherit;
    color: var(--text, inherit);
    text-align: center;
    border: 2px dashed var(--form-border, #aaa);
    border-radius: var(--border-radius, 4px);
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.hm-import-drop:hover,
.hm-import-drop:focus-visible,
.hm-import-drop.is-dragover {
    border-color: var(--hm-red, #d51130);
    background: rgba(213, 17, 48, 0.06);
}

.hm-import-drop span {
    font-size: 0.8125rem;
    opacity: 0.7;
}

.hm-import-t-replace,
.hm-import.has-data .hm-import-t-new {
    display: none;
}

.hm-import.has-data .hm-import-t-replace {
    display: inline;
}

.hm-import.is-loading .hm-import-drop {
    opacity: 0.5;
    pointer-events: none;
}

.hm-import-progress {
    height: 0.5rem;
    margin-top: 0.75rem;
    overflow: hidden;
    border-radius: 0.25rem;
    background: var(--form-border, #ddd);
}

.hm-import-progress[hidden] {
    display: none;
}

.hm-import-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--hm-red, #d51130);
    transition: width 0.2s;
}

/* running bar while the server reads the file */
.hm-import-progress.is-indeterminate .hm-import-bar {
    width: 40%;
    animation: hm-import-run 1.2s ease-in-out infinite alternate;
}

@keyframes hm-import-run {
    from { transform: translateX(0); }
    to { transform: translateX(150%); }
}

@media (prefers-reduced-motion: reduce) {
    .hm-import-progress.is-indeterminate .hm-import-bar {
        width: 100%;
        animation: none;
        opacity: 0.6;
    }
}

.hm-import-status {
    min-height: 1.5em;
    margin: 0.5rem 0 0;
}

.hm-import-status:empty {
    display: none;
}

.hm-import-msg {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.hm-import-msg li {
    padding: 0.2rem 0;
}

.hm-import-msg .confirm { color: var(--green, #2a9d4a); }
.hm-import-msg .error { color: var(--red, #d51130); }
