/* ==========================================================================
   ApplicationForm.css

   Dropzone & form styles for the LfJobs Application plugin.
   Mirrors the BEM architecture of the existing site (c-form, c-button, c-icon).
   ========================================================================== */

.c-form--application {
    max-width: 100%;
}

/* Dropzone base container ------------------------------------------------- */
.c-dropzone {
    position: relative;
    display: block;
    padding: 1.25rem 1rem;
    margin-top: 0.5rem;
    border: 2px dashed var(--color-border, #d0d7de);
    border-radius: 0.375rem;
    background-color: var(--color-surface, #f8f9fa);
    color: var(--color-text-muted, #57606a);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.c-dropzone:hover,
.c-dropzone--hover {
    border-color: var(--color-primary, #2563eb);
    background-color: var(--color-surface-hover, #eef4ff);
}

.c-dropzone--error {
    border-color: var(--color-danger, #d1242f);
    background-color: var(--color-surface-danger, #fdecee);
}

/* Hint area (icon + text) ------------------------------------------------- */
.c-dropzone__hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: inherit;
    font-size: 0.95rem;
}

.c-dropzone__hint .c-icon {
    color: currentColor;
}

/* Items list (uploaded/queued/failed) ------------------------------------- */
.c-dropzone__items {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.c-dropzone__items:empty {
    display: none;
}

.c-dropzone__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border, #d0d7de);
    border-radius: 0.25rem;
    background-color: var(--color-surface-default, #fff);
    color: var(--color-text, #1f2328);
    text-align: left;
}

.c-dropzone__item--success {
    border-color: var(--color-success, #1a7f37);
    background-color: var(--color-surface-success, #dafbe1);
}

.c-dropzone__item--error {
    border-color: var(--color-danger, #d1242f);
    background-color: var(--color-surface-danger, #fdecee);
    color: var(--color-danger, #d1242f);
}

.c-dropzone__icon {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: var(--color-text-muted, #57606a);
}

.c-dropzone__item--success .c-dropzone__icon {
    color: var(--color-success, #1a7f37);
}

.c-dropzone__item--error .c-dropzone__icon {
    color: var(--color-danger, #d1242f);
}

.c-dropzone__label {
    flex: 1 1 auto;
    word-break: break-word;
    font-size: 0.9rem;
}

.c-dropzone__remove {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0.25rem;
}

/* Progress bar ------------------------------------------------------------ */
.c-dropzone__progress {
    flex: 0 0 4rem;
    height: 0.375rem;
    border-radius: 999px;
    background-color: var(--color-border, #d0d7de);
    overflow: hidden;
    position: relative;
}

.c-dropzone__progress-bar {
    display: block;
    height: 100%;
    background-color: var(--color-primary, #2563eb);
    transition: width 0.15s ease-in-out;
}

.c-dropzone__item--success .c-dropzone__progress-bar {
    background-color: var(--color-success, #1a7f37);
}

.c-dropzone__item--error .c-dropzone__progress-bar {
    background-color: var(--color-danger, #d1242f);
}

/* Hide the native file input visually — accessible label remains on the group */
.c-form--application .c-form__element--file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Submit button with spinner ---------------------------------------------- */
.c-form--application .c-button--loading {
    position: relative;
}

.c-form--application .c-button__icon--loading svg {
    animation: lf-jobs-spin 1s linear infinite;
}

@keyframes lf-jobs-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Small screen tweaks ----------------------------------------------------- */
@media (max-width: 599px) {
    .c-dropzone {
        padding: 1rem 0.5rem;
    }
    .c-dropzone__label {
        font-size: 0.85rem;
    }
    .c-dropzone__progress {
        flex-basis: 3rem;
    }
}
