/* ── Chunked File Uploader ─────────────────────────────────────────────── */

.cfu-wrap {
    max-width: 540px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.cfu-heading {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 18px;
    color: #1e293b;
}

/* ── Form card ─────────────────────────────────────────────────────────── */

.cfu-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.cfu-password-row {
    margin: -8px 0 20px;
}

.cfu-password-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.cfu-password-field {
    position: relative;
}

.cfu-form-password {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 44px 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: .9375rem;
}

.cfu-form-password:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

.cfu-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 6px;
    cursor: pointer;
    color: #64748b;
    border-radius: 6px;
    line-height: 0;
}

.cfu-password-toggle:hover:not(:disabled) {
    color: #2563eb;
    background: #f1f5f9;
}

.cfu-password-toggle:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.cfu-password-toggle:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.cfu-password-toggle-icons svg {
    display: block;
}

/* ── Drop zone ─────────────────────────────────────────────────────────── */

.cfu-drop-zone {
    position: relative;
    border: 2px dashed #bfdbfe;
    border-radius: 12px;
    background: #f8faff;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    outline: none;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfu-drop-zone:focus-visible {
    box-shadow: 0 0 0 3px rgba(37,99,235,.35);
}

.cfu-drop-zone:hover:not(.cfu-uploading) {
    border-color: #2563eb;
    background: #eff6ff;
}

/* Drag-over state */
.cfu-drop-zone.cfu-drag-over {
    border-color: #2563eb;
    background: #dbeafe;
    box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}

/* Error highlight */
.cfu-drop-zone.cfu-has-error {
    border-color: #f87171;
    background: #fff5f5;
}

/* Hidden real file input */
.cfu-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    pointer-events: none; /* clicks routed via JS */
}

/* ── Idle state ────────────────────────────────────────────────────────── */

.cfu-dz-idle {
    text-align: center;
    padding: 32px 20px;
    pointer-events: none;
    user-select: none;
}

.cfu-dz-icon svg {
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.cfu-dz-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.cfu-dz-sub {
    margin: 0 0 10px;
    font-size: .875rem;
    color: #64748b;
}

.cfu-browse-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* ── Selected-file state ───────────────────────────────────────────────── */

.cfu-dz-selected {
    text-align: left;
    padding: 18px 20px 28px;
    padding-right: 44px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.cfu-dz-files-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    width: 100%;
}

.cfu-dz-files-list > li.cfu-dz-file-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    pointer-events: auto;
}

.cfu-dz-files-list > li.cfu-dz-file-row:last-child {
    border-bottom: none;
}

.cfu-dz-row-meta {
    flex: 1;
    min-width: 0;
}

.cfu-dz-row-name {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: #1e293b;
    word-break: break-word;
}

.cfu-dz-row-size {
    display: block;
    font-size: .78rem;
    color: #64748b;
    margin-top: 2px;
}

.cfu-dz-remove-file {
    flex-shrink: 0;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.cfu-dz-remove-file:hover {
    background: #f87171;
    color: #fff;
}

.cfu-dz-remove-file:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.cfu-status .cfu-uploaded-label {
    margin: 10px 0 4px;
}

.cfu-status ul.cfu-uploaded-names {
    margin: 0;
    padding-left: 1.2em;
}

.cfu-status ul.cfu-uploaded-names li {
    margin: 0.2em 0;
    word-break: break-word;
}

.cfu-clear-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: background .15s, color .15s;
    line-height: 1;
}

.cfu-clear-btn:hover {
    background: #f87171;
    color: #fff;
}

/* ── Completed uploads (under drop zone) ───────────────────────────────── */

.cfu-completed-wrap {
    margin: 0 0 20px;
    padding: 0;
}

.cfu-completed-wrap[hidden] {
    display: none !important;
}

.cfu-completed-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #0f766e;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.cfu-completed-head .cfu-completed-icon {
    display: flex;
    color: #14b8a6;
}

.cfu-completed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cfu-completed-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 14px;
    border-radius: 12px;
    border: 1px solid #d1fae5;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 55%, #f8fafc 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 6px 18px rgba(15, 118, 110, .08);
}

.cfu-completed-file-badge {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #0d9488;
    border: 1px solid #99f6e4;
}

.cfu-completed-main {
    flex: 1;
    min-width: 0;
}

.cfu-completed-filename {
    font-size: .92rem;
    font-weight: 600;
    color: #134e4a;
    line-height: 1.35;
    word-break: break-word;
}

button.cfu-completed-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-left: 4px;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

button.cfu-completed-remove:hover:not(:disabled) {
    background: #f87171;
    color: #fff;
}

button.cfu-completed-remove:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .cfu-completed-file-badge {
        width: 40px;
        height: 40px;
    }
}

/* ── Progress ──────────────────────────────────────────────────────────── */

.cfu-progress-wrap {
    margin-bottom: 18px;
}

.cfu-progress-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 7px;
}

.cfu-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
    border-radius: 999px;
    transition: width .3s ease;
}

.cfu-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    color: #64748b;
}

.cfu-progress-pct {
    font-weight: 700;
    color: #2563eb;
}

/* ── Status messages ───────────────────────────────────────────────────── */

.cfu-status {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 2rem;
    line-height: 1.55;
    margin-bottom: 16px;
    text-align: center;
}
.cfu-status p { margin: 0; }

.cfu-status.cfu-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.cfu-status.cfu-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.cfu-status.cfu-info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

.cfu-dl-link {
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
}

/* ── Submit button ─────────────────────────────────────────────────────── */

.cfu-submit-btn {
    width: 100%;
    padding: 13px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: .3px;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

.cfu-submit-btn:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

.cfu-submit-btn:active:not(:disabled) {
    transform: scale(.98);
}

.cfu-submit-btn:disabled {
    background: #93c5fd;
    box-shadow: none;
    cursor: not-allowed;
}

.cfu-btn-icon {
    font-style: normal;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .cfu-form    { padding: 18px 14px; }
    .cfu-dz-idle { padding: 24px 14px; }
}
