.file-input-container {
    position: relative;
}
.file-input-control {
    display: block;
    width: 100%;
    background: #f9fafb;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    color: #111827;
}
.file-input-control.error {
    border-color: #ef4444;
    color: #7f1d1d;
}
.file-thumb-wrap {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10000;
    margin-top: 10px;
}
.file-remove-btn {
    position: absolute;
    right: -8px;
    top: -8px;
    background: #ef4444;
    color: #fff;
    border-radius: 9999px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 0;
    cursor: pointer;
}

.inline-block {
    display: inline-block;
}
.relative {
    position: relative;
}
.referential-card {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.referential-card.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.referential-card.show:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.referential-card-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.referential-image-container {
    padding: 12px;
    background: #f9fafb;
}
.referential-image-container img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}
.referential-card-title {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

.referential-card-actions {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.referential-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.referential-remove-btn:hover {
    background: #dc2626;
}

.file-input-container:hover .referential-card {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* When we need to programmatically hide the referential card even if the user is
   hovering the container (e.g. immediately after selecting a file), add this
   class to the container. This prevents the :hover rule from forcing the card
   open and avoids the card getting visually stuck open for dynamic traveler
   inputs. */
.file-input-container.suppress-hover .referential-card {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-10px) !important;
}

.file-input-thumb {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}
