/* Drag-and-drop file field.
 *
 * Progressive enhancement over a plain <input type="file">: the real input
 * stays in the form and still carries the file, so server-side handling,
 * validation and the posted field name are all unchanged. Only the appearance
 * and the drop target are added.
 *
 * Opt in per field with data-filedrop — see web/js/file-drop.js.
 */

.fd {
    position: relative;
    display: block;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.fd:hover,
.fd:focus {
    border-color: #00a9a6;
    background: #f0fdfa;
    outline: none;
}

/* While a file is dragged over the field. */
.fd.is-over {
    border-color: #00a9a6;
    background: #e6f7f7;
    border-style: solid;
}

/* The native input still does the work; it just is not what you look at. */
.fd input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.fd-icon { font-size: 22px; color: #94a3b8; display: block; margin-bottom: 6px; }
.fd.is-over .fd-icon,
.fd.has-file .fd-icon { color: #00a9a6; }

.fd-text { font-size: 13px; color: #475569; line-height: 1.5; }
.fd-text b { color: #00a9a6; }
.fd-hint { display: block; font-size: 11px; color: #94a3b8; margin-top: 3px; }

/* Chosen file */
.fd.has-file { border-style: solid; border-color: #00a9a6; background: #f0fdfa; }

.fd-file {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    font-size: 13px;
    color: #334155;
}

.fd-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.fd-file-size { color: #64748b; font-size: 11px; white-space: nowrap; }

.fd-clear {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
}

.fd-clear:hover { color: #dc2626; background: #fee2e2; }

.fd-error {
    margin-top: 8px;
    font-size: 12px;
    color: #dc2626;
}

/* Nothing to drop onto without JS, so the plain input is left visible. */
.fd-fallback { display: block; }
