/*
 * The optional PDF field (_DocumentField.cshtml), shared by the inquiry form and the Website Services checkout's
 * Options step: a quiet drop area, then the chosen file in its place. Moved here from inquiry-form.css on 2026-12-03
 * so both pages draw it the same way.
 */

/* A long file name is cut short with an ellipsis instead of widening the form */
.document-field {
    grid-template-columns: minmax(0, 1fr);
}

/* The real file input covers the whole area, invisible, so clicking, the keyboard and dropping a file are all the browser's own */
.document-drop {
    position: relative;
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-4);
    border: 1px dashed var(--color-field-edge);
    border-radius: var(--radius-small);
    background: var(--color-ink);
    text-align: center;
    transition: border-color var(--duration-quick) var(--ease-out), background-color var(--duration-quick) var(--ease-out);
}

.document-drop[hidden],
.document-chosen[hidden] {
    display: none;
}

.document-drop .document-drop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.document-drop-icon {
    width: 24px;
    height: 24px;
    color: var(--color-text-muted);
}

.document-drop-prompt {
    color: var(--color-text-muted);
    font-size: var(--text-small);
}

.document-drop-action {
    color: var(--color-text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--color-field-edge-hover);
    text-underline-offset: 3px;
}

.document-drop-help {
    color: var(--color-text-faint);
    font-size: var(--text-small);
}

.document-drop:hover,
.document-drop.is-dragged-over {
    border-color: var(--color-field-edge-hover);
    background: var(--color-raised-high);
}

.document-drop:focus-within {
    border-style: solid;
    border-color: var(--color-focus);
}

.document-field.has-error .document-drop {
    border-color: var(--color-error);
}

/* The Attached row: a solid success edge and a tick, so a chosen file never looks like the empty drop area it replaces */
.document-chosen {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    min-height: 64px;
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-small);
    background: var(--color-ink);
}

.document-chosen-icon {
    flex: none;
    width: 24px;
    height: 24px;
    color: var(--color-success);
}

.document-chosen-text {
    display: grid;
    flex: 1;
    gap: 2px;
    min-width: 0;
}

.document-chosen-state {
    color: var(--color-success);
    font-size: var(--text-small);
    font-weight: 600;
}

.document-chosen-file {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-3);
    align-items: baseline;
    min-width: 0;
}

.document-chosen-name {
    overflow: hidden;
    max-width: 100%;
    color: var(--color-text);
    font-size: var(--text-small);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-chosen-size {
    color: var(--color-text-faint);
    font-size: var(--text-small);
}

.document-chosen-remove {
    flex: none;
    min-height: 44px;
    padding: 0 var(--space-4);
    border: 1px solid var(--color-field-edge);
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-small);
    font-weight: 600;
    cursor: pointer;
}

.document-chosen-remove:hover {
    background: var(--color-raised-high);
    color: var(--color-text);
}

.document-chosen-remove:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* The help line under the field, for a page that has no form-field styles of its own */
.document-field .form-field-help {
    color: var(--color-text-muted);
    font-size: var(--text-small);
}
