/*
 * HTML to WP — base styles for the upload forms and the slot counter.
 * Kept neutral on purpose: the block that places the shortcodes styles them
 * in the site's design. Override the custom properties or the classes.
 */

.h2wp-slot {
    --h2wp-gap: 12px;
    --h2wp-radius: 8px;
    --h2wp-border: rgba(127, 127, 127, 0.45);
    --h2wp-accent: currentColor;
    --h2wp-track: rgba(127, 127, 127, 0.25);
    --h2wp-error: #d94848;
    --h2wp-success: #2e9b5f;
}

.h2wp-form {
    display: grid;
    gap: var(--h2wp-gap);
}

.h2wp-form[hidden],
.h2wp-busy[hidden],
.h2wp-progress[hidden],
.h2wp-cancel[hidden] {
    display: none;
}

.h2wp-field {
    display: grid;
    gap: 6px;
    margin: 0;
}

.h2wp-label {
    font-size: 0.875em;
}

.h2wp-input,
.h2wp-file {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
}

.h2wp-input {
    padding: 10px 12px;
    border: 1px solid var(--h2wp-border);
    border-radius: var(--h2wp-radius);
    background: transparent;
    color: inherit;
}

.h2wp-consent {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.8125em;
    line-height: 1.4;
}

.h2wp-consent a {
    color: inherit;
    text-decoration: underline;
}

.h2wp-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.h2wp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.h2wp-submit,
.h2wp-cancel {
    font: inherit;
    cursor: pointer;
}

.h2wp-submit[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

.h2wp-progress {
    display: flex;
    gap: 10px;
    align-items: center;
}

.h2wp-progress__track {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--h2wp-track);
    overflow: hidden;
}

.h2wp-progress__bar {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--h2wp-accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.2s linear;
}

@media (prefers-reduced-motion: reduce) {
    .h2wp-progress__bar {
        transition: none;
    }
}

.h2wp-progress__text {
    min-width: 3.5em;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.875em;
}

.h2wp-message {
    font-size: 0.875em;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.h2wp-message:empty {
    display: none;
}

.h2wp-message[data-type="error"] {
    color: var(--h2wp-error);
}

.h2wp-message[data-type="success"] {
    color: var(--h2wp-success);
}

.h2wp-busy__title {
    margin: 0 0 4px;
    font-weight: 600;
}

.h2wp-busy__status {
    margin: 0;
    opacity: 0.75;
}
